# 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.

```sql
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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mass-street-data-school.gitbook.io/deng100-workbook-example/syllabus/lecture-organization/sample-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
