-- 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 ] |
-- -- Find and list the full name of customers who bought products above-average quantity.

SELECT T2.FirstName, T2.MiddleInitial, T2.LastName FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID GROUP BY T1.Quantity HAVING T1.Quantity > ( SELECT AVG(Quantity) FROM Sales );