Sample Code

All source code shown in lecture can be directly downloaded from your workbook.

Source code can be easily downloaded by simply copying it to the clipboard using the button in the upper right-hand corner of the code block window, and then pasting into a text file. You can test this using the code example below.

USE AdventureWorks2016

SELECT MAX(LineTotal) AS BiggestLineTotal
FROM Sales.SalesOrderDetail
 
SELECT MIN(LineTotal) AS SmallestLineTotal
FROM Sales.SalesOrderDetail

SELECT AVG(LineTotal) AS AverageLineTotal
FROM Sales.SalesOrderDetail

SELECT COUNT(SalesOrderDetailID) AS TotalRecordsInTable
FROM Sales.SalesOrderDetail

SELECT SUM(LineTotal) AS TotalOfTheOrdersInTheTable
FROM Sales.SalesOrderDetail

Last updated