-- Database schema
| Customers : CustomerID [ INTEGER ] primary_key , FirstName [ TEXT ] , MiddleInitial [ TEXT ] , LastName [ TEXT ] | Employees : EmployeeID [ INTEGER ] primary_key , FirstName [ TEXT ] , MiddleInitial [ TEXT ] , LastName [ TEXT ] | Products : ProductID [ INTEGER ] primary_key , Name [ TEXT ] , Price [ REAL ] | Sales : SalesID [ INTEGER ] primary_key , SalesPersonID [ INTEGER ] Sales.SalesPersonID = Employees.EmployeeID , CustomerID [ INTEGER ] Sales.CustomerID = Customers.CustomerID , ProductID [ INTEGER ] Sales.ProductID = Products.ProductID , Quantity [ INTEGER ] |
-- -- Calculate the average quantity per sales from sales id 20 to 30.

SELECT AVG(Quantity) FROM Sales WHERE SalesID BETWEEN 20 AND 30;