1sf/bird-sql-train-with-schema huggingface dataset:
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: What is the average number of customers per sales person?
Evidence: average = DIVIDE(COUNT(CustomerID), COUNT(EmployeeID));
SQL: SELECT CAST(COUNT(T1.CustomerID) AS REAL) / COUNT(T3.EmployeeID) FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Employees AS T3 ON T2.SalesPersonID = T3.EmployeeID
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Among all customers handled by Innes E. del Castillo, how many have purchased Short-Sleeve Classic Jersey, L?
Evidence: Short-Sleeve Classic Jersey, L' is name of product;
SQL: SELECT COUNT(T2.CustomerID) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Employees AS T3 ON T2.SalesPersonID = T3.EmployeeID WHERE T3.FirstName = 'Innes' AND T3.LastName = 'del Castillo' AND T1.Name = 'Short-Sleeve Classic Jersey, L' AND T3.MiddleInitial = 'e'
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Name the sales person who helped Elizabeth A. White to purchase Road-250 Black, 48.
Evidence: name of the sales person = FirstName, MiddleInitial, LastName; 'Road-250 Black, 48' is name of product;
SQL: SELECT DISTINCT T3.FirstName, T3.MiddleInitial, T3.LastName FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Employees AS T3 ON T2.SalesPersonID = T3.EmployeeID INNER JOIN Customers AS T4 ON T2.CustomerID = T4.CustomerID WHERE T4.MiddleInitial = 'A' AND T4.LastName = 'White' AND T1.Name = 'Road-250 Black, 48' AND T4.FirstName = 'Elizabeth'
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: How many sales people managed to sell Headlights - Weatherproof?
Evidence: Headlights - Weatherproof' is name of product
SQL: SELECT COUNT(T2.SalesPersonID) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Headlights - Weatherproof'
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Calculate the revenue produced through sales of HL Road Frame - Red, 56.
Evidence: revenue = MULTIPLY(SUM(Quantity, Price)); 'HL Road Frame - Red, 56' is name of product;
SQL: SELECT SUM(T2.Quantity * T1.Price) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'HL Road Frame - Red, 56'
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: How many sales transactions were given by the customer named Joe L. Lopez?
Evidence: sales transactions refers to SalesID;
SQL: SELECT COUNT(T1.SalesID) FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.FirstName = 'Joe' AND T2.MiddleInitial = 'L' AND T2.LastName = 'Lopez'
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Name the customers who received 'Touring Rim' as a free gift.
Evidence: name of the customer = FirstName, MiddleInitial, LastName; 'Touring Rim' is name of product;
SQL: SELECT DISTINCT T1.FirstName, T1.MiddleInitial, T1.LastName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T3.Name = 'Touring Rim' AND T3.Price = 0
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Find the number of customers handled by each of the sales people.
SQL: SELECT COUNT(CustomerID) FROM Sales GROUP BY SalesPersonID
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: How many sales people are handling all the customers?
SQL: SELECT COUNT(EmployeeID) FROM Employees
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Identify the name of the sales person with employee ID 7.
Evidence: name of the sales person = FirstName, MiddleInitial, LastName;
SQL: SELECT FirstName, MiddleInitial, LastName FROM Employees WHERE EmployeeID = 7
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Name the most expensive and the least expensive products available, excluding free gifts.
Evidence: most expensive product refers to MAX(Price); least expensive product refers to MIN(Price); excluding free gifts refers to not including Price = 0;
SQL: SELECT Name FROM Products WHERE Price IN (( SELECT MAX(Price) FROM Products ), ( SELECT MIN(Price) FROM Products ))
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Among all the customers who have purchased ML Bottom Bracket, identify the percentage of sales by Albert I. Ringer?
Evidence: ML Bottom Bracket' is name of product; percentage = MULTIPLY(DIVIDE(SUM(CustomerID WHERE FirstName = 'Albert' AND MiddleInitial = 'I' AND LastName = 'Ringer'), COUNT(CustomerID)), 1.0);
SQL: SELECT CAST(SUM(IIF(T3.FirstName = 'Albert' AND T3.MiddleInitial = 'I' AND T3.LastName = 'Ringer', 1, 0)) AS REAL) * 100 / COUNT(T2.CustomerID) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Employees AS T3 ON T2.SalesPersonID = T3.EmployeeID WHERE T1.Name = 'ML Bottom Bracket'
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: How many customers have the first name Abigail?
SQL: SELECT COUNT(CustomerID) FROM Customers WHERE FirstName = 'Abigail'
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Indicate the quantity of Blade products sold.
Evidence: Blade' is name of product;
SQL: SELECT DISTINCT T2.Quantity FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Blade'
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Give the full name of the employee who has sold the most quantity.
Evidence: full name of the employee = FirstName, LastName; most quantity refers to MAX(Quantity);
SQL: SELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID ORDER BY T2.Quantity DESC LIMIT 1
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: List the full name of the customer who purchased the most quantity of products.
Evidence: full name of the customer = FirstName, LastName; most quantity refers to MAX(Quantity);
SQL: SELECT T1.FirstName, T1.LastName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID ORDER BY T2.Quantity DESC LIMIT 1
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: What is the name of the product that is most sold by sale person id 20?
Evidence: most sold refers to MAX(Quantity);
SQL: SELECT T1.Name FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T2.SalesPersonID = 20 ORDER BY T2.Quantity DESC LIMIT 1
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: List the first names of employees with trading quantity for more than 500.
Evidence: trading quantity for more than 500 refers to Quantity > 500;
SQL: SELECT DISTINCT T1.FirstName FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID WHERE T2.Quantity > 500
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: List the first names of customers who have purchased products from sale person id 1.
SQL: SELECT T1.FirstName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.SalesPersonID = 1
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Calculate the total trading quantity of Abraham sold to Aaron Alexander.
Evidence: total trading quantity = SUM(Quantity WHERE Employees.FirstName = 'Abraham' AND Customers.FirstName = 'Aaron' AND Customers.LastName = 'Alexander');
SQL: SELECT SUM(T2.Quantity) FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Employees AS T3 ON T2.SalesPersonID = T3.EmployeeID WHERE T2.SalesPersonID = 1 AND T1.FirstName = 'Aaron' AND T1.LastName = 'Alexander' AND T3.FirstName = 'Abraham'
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: List the full names of customers who have purchased products in quantity over 600.
Evidence: full names of customers = FirstName, LastName; quantity over 600 refers to quantity > 600;
SQL: SELECT T1.FirstName, T1.LastName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.Quantity > 600
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Among the customers whose first name is Cameron, who bought the product in the most quantity?
Evidence: most quantity refers to MAX(Quantity); who refers to FirstName, LastName;
SQL: SELECT T1.FirstName, T1.LastName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.FirstName = 'Cameron' ORDER BY T2.Quantity DESC LIMIT 1
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Please provide sales ID for products named Hex Nut with a price greater than 100.
Evidence: price greater than 100 refers to price > 100;
SQL: SELECT T2.SalesID FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name LIKE 'Hex Nut%' AND T1.Price > 100
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Identify customer IDs who bought products priced from 1000 to 2000.
Evidence: priced from 1000 to 2000 refers to Price BETWEEN 1000 AND 2000;
SQL: SELECT DISTINCT T2.CustomerID FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Price BETWEEN 1000 AND 2000
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Calculate the total quantity of products that are gifts.
Evidence: total quantity = SUM(Quantity); gifts refers to Price = 0;
SQL: SELECT SUM(T2.Quantity) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Price = 0
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Calculate the quantity percentage of the gift products in the total trading quantity.
Evidence: percentage = MULTIPLY(DIVIDE(SUM(Quantity WHERE Price = 0), SUM(Quantity)), 1.0); gift products refers to Price = 0;
SQL: SELECT CAST(SUM(IIF(T1.Price = 0, T2.Quantity, 0)) AS REAL) * 100 / SUM(T2.Quantity)FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Calculate the percentage of sold blades in the total number of transactions.
Evidence: percentage = MULTIPLY(DIVIDE(SUM(Quantity WHERE Name = 'Blade'), SUM(Quantity)), 1.0); 'blades' refers to name of product;
SQL: SELECT CAST(SUM(IIF(T1.Name = 'Blade', T2.Quantity, 0)) AS REAL) * 100 / SUM(T2.Quantity) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: How many of the employees have the last name "Ringer" ?
SQL: SELECT COUNT(LastName) FROM Employees WHERE LastName = 'Ringer'
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Among the products with product ID lower than 15, how many of them costs 10 and below?
Evidence: product ID lower than 15 refers to ProductID < 15; costs 10 and below refers to Price; Price < = 10;
SQL: SELECT COUNT(ProductID) FROM Products WHERE ProductID < 15 AND Price <= 10
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Give the product's name brought by Aaron Alexander.
SQL: SELECT DISTINCT T1.Name FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Customers AS T3 ON T2.CustomerID = T3.CustomerID WHERE T3.FirstName = 'Aaron' AND T3.LastName = 'Alexander'
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Give the product ID and name of the product with the highest prices among the quantity ranges from 400 to 500.
Evidence: highest prices refers to MAX(Price); quantity ranges from 400 to 500 refers to Quantity BETWEEN 400 AND 500;
SQL: SELECT T1.ProductID, T1.Name FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T2.quantity BETWEEN 400 AND 500 ORDER BY T1.Price DESC LIMIT 1
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Among customers named Kate, who has the highest quantity?
Evidence: highest quantity refers to MAX(Quantity);
SQL: SELECT T2.FirstName, T2.LastName FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.FirstName = 'Kate' ORDER BY T1.Quantity DESC LIMIT 1
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Among the products that have price ranges from 100 to 150, what is the customer ID and sales ID of the product with a quantity lower than 25?
Evidence: price ranges from 100 to 150 refers to Price BETWEEN 100 AND 150; quantity lower than 25 refers to Quantity < 25;
SQL: SELECT T2.CustomerID, T2.SalesID FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Price BETWEEN 100 AND 150 AND T2.Quantity < 25
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: List the quantity and price of the product bought by Abigail Henderson.
SQL: SELECT T2.Quantity, T1.Price FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Customers AS T3 ON T2.CustomerID = T3.CustomerID WHERE T3.FirstName = 'Abigail' AND T3.LastName = 'Henderson'
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: In sales with a quantity of 60, how many of them have a price not greater than 500?
SQL: SELECT COUNT(T1.ProductID) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T2.quantity = 60 AND T1.Price <= 500
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: In customers with the first name of Erica, how many of them bought a quantity below 200?
Evidence: quantity below 200 refers to quantity < 200;
SQL: SELECT COUNT(T1.ProductID) FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.FirstName = 'Erica' AND T1.Quantity < 200
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Among products bought by Kathryn Ashe, what is the name of the product with the highest quantity?
Evidence: highest quantity refers to MAX(Quantity);
SQL: SELECT T1.Name FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Customers AS T3 ON T2.CustomerID = T3.CustomerID WHERE T3.FirstName = 'Kathryn' AND T3.LastName = 'Ashe' ORDER BY T2.Quantity DESC LIMIT 1