Database schema:

CREATE TABLE "Customers" (
	"CustomerID" INTEGER NOT NULL -- example: ['2', '1'],
	"FirstName" TEXT NOT NULL -- example: ['Abby', 'Aaron'],
	"MiddleInitial" TEXT -- example: ['A', 'B'],
	"LastName" TEXT NOT NULL -- example: ['Bryant', 'Alexander'],
	PRIMARY KEY ("CustomerID")
)


CREATE TABLE "Employees" (
	"EmployeeID" INTEGER NOT NULL -- example: ['2', '1'],
	"FirstName" TEXT NOT NULL -- example: ['Reginald', 'Abraham'],
	"MiddleInitial" TEXT -- example: ['l', 'e'],
	"LastName" TEXT NOT NULL -- example: ['Blotchet-Halls', 'Bennet'],
	PRIMARY KEY ("EmployeeID")
)


CREATE TABLE "Products" (
	"ProductID" INTEGER NOT NULL -- example: ['2', '1'],
	"Name" TEXT NOT NULL -- example: ['Adjustable Race', 'Bearing Ball'],
	"Price" REAL -- example: ['1.6', '0.8'],
	PRIMARY KEY ("ProductID")
)


CREATE TABLE "Sales" (
	"SalesID" INTEGER NOT NULL -- example: ['2', '1'],
	"SalesPersonID" INTEGER NOT NULL -- example: ['5', '17'],
	"CustomerID" INTEGER NOT NULL -- example: ['1964', '10482'],
	"ProductID" INTEGER NOT NULL -- example: ['500', '306'],
	"Quantity" INTEGER NOT NULL -- example: ['500', '810'],
	PRIMARY KEY ("SalesID"), 
	CONSTRAINT fk_sales_employees FOREIGN KEY("SalesPersonID") REFERENCES "Employees" ("EmployeeID"),
	CONSTRAINT fk_sales_customers FOREIGN KEY("CustomerID") REFERENCES "Customers" ("CustomerID"),
	CONSTRAINT fk_sales_products FOREIGN KEY("ProductID") REFERENCES "Products" ("ProductID")
)

Question: List the customer's ID and last name of the customer that purchased a product with a quantity greater than 90% of the average quantity of all listed products.
Evidence: quantity greater than 90% of the average quantity = Quantity > MULTIPLY(AVG(Quantity), 0.9);

SQL:
SELECT T2.CustomerID, T2.LastName FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Quantity > ( SELECT AVG(Quantity) FROM Sales ) * 0.9