id int64 0 9.43k | db_id stringclasses 69
values | schema stringclasses 69
values | question stringlengths 24 325 | output stringlengths 23 804 | evidence stringlengths 0 673 | filtered_schema listlengths 0 16 |
|---|---|---|---|---|---|---|
5,400 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | What is the average number of customers per sales person? | 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 | average = DIVIDE(COUNT(CustomerID), COUNT(EmployeeID)); | [
"Customers.CustomerID",
"Employees.EmployeeID",
"Sales.CustomerID",
"Sales.SalesPersonID"
] |
5,401 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Among all customers handled by Innes E. del Castillo, how many have purchased Short-Sleeve Classic Jersey, L? | 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' | Short-Sleeve Classic Jersey, L' is name of product; | [
"Employees.EmployeeID",
"Employees.FirstName",
"Employees.LastName",
"Employees.MiddleInitial",
"Products.Name",
"Products.ProductID",
"Sales.CustomerID",
"Sales.ProductID",
"Sales.SalesPersonID"
] |
5,402 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Name the sales person who helped Elizabeth A. White to purchase Road-250 Black, 48. | 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.N... | name of the sales person = FirstName, MiddleInitial, LastName; 'Road-250 Black, 48' is name of product; | [
"Customers.CustomerID",
"Customers.FirstName",
"Customers.LastName",
"Customers.MiddleInitial",
"Employees.EmployeeID",
"Employees.FirstName",
"Employees.LastName",
"Employees.MiddleInitial",
"Products.Name",
"Products.ProductID",
"Sales.CustomerID",
"Sales.ProductID",
"Sales.SalesPersonID"
... |
5,403 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | How many sales people managed to sell Headlights - Weatherproof? | SELECT COUNT(T2.SalesPersonID) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Headlights - Weatherproof' | Headlights - Weatherproof' is name of product | [
"Products.Name",
"Products.ProductID",
"Sales.ProductID",
"Sales.SalesPersonID"
] |
5,404 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Calculate the revenue produced through sales of HL Road Frame - Red, 56. | 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' | revenue = MULTIPLY(SUM(Quantity, Price)); 'HL Road Frame - Red, 56' is name of product; | [
"Products.Name",
"Products.Price",
"Products.ProductID",
"Sales.ProductID",
"Sales.Quantity"
] |
5,405 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | How many sales transactions were given by the customer named Joe L. Lopez? | 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' | sales transactions refers to SalesID; | [
"Customers.CustomerID",
"Customers.FirstName",
"Customers.LastName",
"Customers.MiddleInitial",
"Sales.CustomerID",
"Sales.SalesID"
] |
5,406 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Name the customers who received 'Touring Rim' as a free gift. | 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 | name of the customer = FirstName, MiddleInitial, LastName; 'Touring Rim' is name of product; | [
"Customers.CustomerID",
"Customers.FirstName",
"Customers.LastName",
"Customers.MiddleInitial",
"Products.Name",
"Products.Price",
"Products.ProductID",
"Sales.CustomerID",
"Sales.ProductID"
] |
5,407 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Find the number of customers handled by each of the sales people. | SELECT COUNT(CustomerID) FROM Sales GROUP BY SalesPersonID | [
"Sales.CustomerID",
"Sales.SalesPersonID"
] | |
5,408 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | How many sales people are handling all the customers? | SELECT COUNT(EmployeeID) FROM Employees | [
"Employees.EmployeeID"
] | |
5,409 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Identify the name of the sales person with employee ID 7. | SELECT FirstName, MiddleInitial, LastName FROM Employees WHERE EmployeeID = 7 | name of the sales person = FirstName, MiddleInitial, LastName; | [
"Employees.EmployeeID",
"Employees.FirstName",
"Employees.LastName",
"Employees.MiddleInitial"
] |
5,410 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Name the most expensive and the least expensive products available, excluding free gifts. | SELECT Name FROM Products WHERE Price IN (( SELECT MAX(Price) FROM Products ), ( SELECT MIN(Price) FROM Products )) | most expensive product refers to MAX(Price); least expensive product refers to MIN(Price); excluding free gifts refers to not including Price = 0; | [
"Products.Name",
"Products.Price"
] |
5,411 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Among all the customers who have purchased ML Bottom Bracket, identify the percentage of sales by Albert I. Ringer? | 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' | 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); | [
"Employees.EmployeeID",
"Employees.FirstName",
"Employees.LastName",
"Employees.MiddleInitial",
"Products.Name",
"Products.ProductID",
"Sales.CustomerID",
"Sales.ProductID",
"Sales.SalesPersonID"
] |
5,412 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | How many customers have the first name Abigail? | SELECT COUNT(CustomerID) FROM Customers WHERE FirstName = 'Abigail' | [
"Customers.CustomerID",
"Customers.FirstName"
] | |
5,413 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Indicate the quantity of Blade products sold. | SELECT DISTINCT T2.Quantity FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Blade' | Blade' is name of product; | [
"Products.Name",
"Products.ProductID",
"Sales.ProductID",
"Sales.Quantity"
] |
5,414 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Give the full name of the employee who has sold the most quantity. | 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 | full name of the employee = FirstName, LastName; most quantity refers to MAX(Quantity); | [
"Employees.EmployeeID",
"Employees.FirstName",
"Employees.LastName",
"Sales.Quantity",
"Sales.SalesPersonID"
] |
5,415 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | List the full name of the customer who purchased the most quantity of products. | 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 | full name of the customer = FirstName, LastName; most quantity refers to MAX(Quantity); | [
"Customers.CustomerID",
"Customers.FirstName",
"Customers.LastName",
"Sales.CustomerID",
"Sales.Quantity"
] |
5,416 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | What is the name of the product that is most sold by sale person id 20? | 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 | most sold refers to MAX(Quantity); | [
"Products.Name",
"Products.ProductID",
"Sales.ProductID",
"Sales.Quantity",
"Sales.SalesPersonID"
] |
5,417 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | List the first names of employees with trading quantity for more than 500. | SELECT DISTINCT T1.FirstName FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID WHERE T2.Quantity > 500 | trading quantity for more than 500 refers to Quantity > 500; | [
"Employees.EmployeeID",
"Employees.FirstName",
"Sales.Quantity",
"Sales.SalesPersonID"
] |
5,418 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | List the first names of customers who have purchased products from sale person id 1. | SELECT T1.FirstName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.SalesPersonID = 1 | [
"Customers.CustomerID",
"Customers.FirstName",
"Sales.CustomerID",
"Sales.SalesPersonID"
] | |
5,419 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Calculate the total trading quantity of Abraham sold to Aaron Alexander. | 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' | total trading quantity = SUM(Quantity WHERE Employees.FirstName = 'Abraham' AND Customers.FirstName = 'Aaron' AND Customers.LastName = 'Alexander'); | [
"Customers.CustomerID",
"Customers.FirstName",
"Customers.LastName",
"Employees.EmployeeID",
"Employees.FirstName",
"Sales.CustomerID",
"Sales.Quantity",
"Sales.SalesPersonID"
] |
5,420 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | List the full names of customers who have purchased products in quantity over 600. | SELECT T1.FirstName, T1.LastName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.Quantity > 600 | full names of customers = FirstName, LastName; quantity over 600 refers to quantity > 600; | [
"Customers.CustomerID",
"Customers.FirstName",
"Customers.LastName",
"Sales.CustomerID",
"Sales.Quantity"
] |
5,421 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Among the customers whose first name is Cameron, who bought the product in the most quantity? | 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 | most quantity refers to MAX(Quantity); who refers to FirstName, LastName; | [
"Customers.CustomerID",
"Customers.FirstName",
"Customers.LastName",
"Sales.CustomerID",
"Sales.Quantity"
] |
5,422 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Please provide sales ID for products named Hex Nut with a price greater than 100. | 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 | price greater than 100 refers to price > 100; | [
"Products.Name",
"Products.Price",
"Products.ProductID",
"Sales.ProductID",
"Sales.SalesID"
] |
5,423 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Identify customer IDs who bought products priced from 1000 to 2000. | 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 | priced from 1000 to 2000 refers to Price BETWEEN 1000 AND 2000; | [
"Products.Price",
"Products.ProductID",
"Sales.CustomerID",
"Sales.ProductID"
] |
5,424 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Calculate the total quantity of products that are gifts. | SELECT SUM(T2.Quantity) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Price = 0 | total quantity = SUM(Quantity); gifts refers to Price = 0; | [
"Products.Price",
"Products.ProductID",
"Sales.ProductID",
"Sales.Quantity"
] |
5,425 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Calculate the quantity percentage of the gift products in the total trading quantity. | 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 | percentage = MULTIPLY(DIVIDE(SUM(Quantity WHERE Price = 0), SUM(Quantity)), 1.0); gift products refers to Price = 0; | [
"Products.Price",
"Products.ProductID",
"Sales.ProductID",
"Sales.Quantity"
] |
5,426 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Calculate the percentage of sold blades in the total number of transactions. | 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 | percentage = MULTIPLY(DIVIDE(SUM(Quantity WHERE Name = 'Blade'), SUM(Quantity)), 1.0); 'blades' refers to name of product; | [
"Products.Name",
"Products.ProductID",
"Sales.ProductID",
"Sales.Quantity"
] |
5,427 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | How many of the employees have the last name "Ringer" ? | SELECT COUNT(LastName) FROM Employees WHERE LastName = 'Ringer' | [
"Employees.LastName"
] | |
5,428 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Among the products with product ID lower than 15, how many of them costs 10 and below? | SELECT COUNT(ProductID) FROM Products WHERE ProductID < 15 AND Price <= 10 | product ID lower than 15 refers to ProductID < 15; costs 10 and below refers to Price; Price < = 10; | [
"Products.Price",
"Products.ProductID"
] |
5,429 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Give the product's name brought by Aaron Alexander. | 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' | [
"Customers.CustomerID",
"Customers.FirstName",
"Customers.LastName",
"Products.Name",
"Products.ProductID",
"Sales.CustomerID",
"Sales.ProductID"
] | |
5,430 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Give the product ID and name of the product with the highest prices among the quantity ranges from 400 to 500. | 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 | highest prices refers to MAX(Price); quantity ranges from 400 to 500 refers to Quantity BETWEEN 400 AND 500; | [
"Products.Name",
"Products.Price",
"Products.ProductID",
"Sales.ProductID",
"Sales.quantity"
] |
5,431 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Among customers named Kate, who has the highest quantity? | 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 | highest quantity refers to MAX(Quantity); | [
"Customers.CustomerID",
"Customers.FirstName",
"Customers.LastName",
"Sales.CustomerID",
"Sales.Quantity"
] |
5,432 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | 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? | 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 | price ranges from 100 to 150 refers to Price BETWEEN 100 AND 150; quantity lower than 25 refers to Quantity < 25; | [
"Products.Price",
"Products.ProductID",
"Sales.CustomerID",
"Sales.ProductID",
"Sales.Quantity",
"Sales.SalesID"
] |
5,433 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | List the quantity and price of the product bought by Abigail Henderson. | 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' | [
"Customers.CustomerID",
"Customers.FirstName",
"Customers.LastName",
"Products.Price",
"Products.ProductID",
"Sales.CustomerID",
"Sales.ProductID",
"Sales.Quantity"
] | |
5,434 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | In sales with a quantity of 60, how many of them have a price not greater than 500? | 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 | [
"Products.Price",
"Products.ProductID",
"Sales.ProductID",
"Sales.quantity"
] | |
5,435 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | In customers with the first name of Erica, how many of them bought a quantity below 200? | 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 | quantity below 200 refers to quantity < 200; | [
"Customers.CustomerID",
"Customers.FirstName",
"Sales.CustomerID",
"Sales.ProductID",
"Sales.Quantity"
] |
5,436 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Among products bought by Kathryn Ashe, what is the name of the product with the highest quantity? | 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 | highest quantity refers to MAX(Quantity); | [
"Customers.CustomerID",
"Customers.FirstName",
"Customers.LastName",
"Products.Name",
"Products.ProductID",
"Sales.CustomerID",
"Sales.ProductID",
"Sales.Quantity"
] |
5,437 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | What is the price and quantity of the product named Seat Tube? | SELECT DISTINCT T2.Price, T1.Quantity FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'Seat Tube' | [
"Products.Name",
"Products.Price",
"Products.ProductID",
"Sales.ProductID",
"Sales.Quantity"
] | |
5,438 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | What is the price and name of the product bought by Erica Xu? | SELECT T3.Price, T3.Name FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Products AS T3 ON T1.ProductID = T3.ProductID WHERE T2.FirstName = 'Erica' AND T2.LastName = 'Xu' | [
"Customers.CustomerID",
"Customers.FirstName",
"Customers.LastName",
"Products.Name",
"Products.Price",
"Products.ProductID",
"Sales.CustomerID",
"Sales.ProductID"
] | |
5,439 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | List the sales ID of the product with a quantity of 590 and named "External Lock Washer 7". | SELECT T1.SalesID FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'External Lock Washer 7' AND T1.Quantity = 590 | External Lock Washer 7' is name of product; | [
"Products.Name",
"Products.ProductID",
"Sales.ProductID",
"Sales.Quantity",
"Sales.SalesID"
] |
5,440 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | In sales ID between 30 and 40, who is the customer that bought a total quantity of 403? | SELECT T2.FirstName, T2.LastName FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Quantity = 403 AND T1.SalesID BETWEEN 30 AND 40 | who refers to FirstName, LastName; | [
"Customers.CustomerID",
"Customers.FirstName",
"Customers.LastName",
"Sales.CustomerID",
"Sales.Quantity",
"Sales.SalesID"
] |
5,441 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | 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. | 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 | quantity greater than 90% of the average quantity = Quantity > MULTIPLY(AVG(Quantity), 0.9); | [
"Customers.CustomerID",
"Customers.LastName",
"Sales.CustomerID",
"Sales.Quantity"
] |
5,442 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Among the sales ID ranges from 1 to 200, what is the percentage of the products with a price ranging from 200 to 300? | SELECT CAST(SUM(IIF(T2.Price BETWEEN 200 AND 300, 1, 0)) AS REAL) * 100 / COUNT(T2.Price) FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID WHERE T1.SalesID BETWEEN 1 AND 200 | sales ID ranges from 1 to 200 refers to SalesID between 1 and 200; percentage = MULTIPLY(DIVIDE(SUM(Price between 200 and 300), COUNT(Price)), 1.0); | [
"Products.Price",
"Products.ProductID",
"Sales.ProductID",
"Sales.SalesID"
] |
5,443 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | What is the name of the most expensive product? | SELECT Name FROM Products WHERE Price = ( SELECT MAX(Price) FROM Products ) | most expensive product refers to MAX(Price); | [
"Products.Name",
"Products.Price"
] |
5,444 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | How many customers are named Madison? | SELECT COUNT(CustomerID) FROM Customers WHERE FirstName = 'Madison' | [
"Customers.CustomerID",
"Customers.FirstName"
] | |
5,445 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | How many types of "HL Touring Frames" are there? | SELECT COUNT(ProductID) FROM Products WHERE Name LIKE '%HL Touring Frame%' | types of HL Touring Frames refers to Name like '%HL Touring Frame%'; | [
"Products.Name",
"Products.ProductID"
] |
5,446 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | How many customers share the most common last name? | SELECT COUNT(CustomerID) FROM Customers GROUP BY LastName ORDER BY COUNT(LastName) DESC LIMIT 1 | most common last name refers to MAX(COUNT(LastName)); | [
"Customers.CustomerID",
"Customers.LastName"
] |
5,447 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | How many free or gift products are there? | SELECT COUNT(ProductID) FROM Products WHERE Price = 0 | free gift refers to Price = 0; | [
"Products.Price",
"Products.ProductID"
] |
5,448 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | What is the name of the sales person who handled the highest number of sales? | SELECT T1.FirstName, T1.MiddleInitial, T1.LastName FROM Employees AS T1 INNER JOIN Sales AS T2 ON T2.SalesPersonID = T1.EmployeeID GROUP BY T2.SalesPersonID, T1.FirstName, T1.MiddleInitial, T1.LastName ORDER BY COUNT(T2.SalesID) DESC LIMIT 1 | name of the sales person = FirstName, MiddleInitial, LastName; highest number of sales refers to MAX(COUNT(SalesID)); | [
"Employees.EmployeeID",
"Employees.FirstName",
"Employees.LastName",
"Employees.MiddleInitial",
"Sales.SalesID",
"Sales.SalesPersonID"
] |
5,449 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | What is the full name of the customer who purchased the highest amount of total price in a single purchase? | SELECT T2.FirstName, T2.MiddleInitial, T2.LastName FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Products AS T3 ON T1.ProductID = T3.ProductID GROUP BY T1.SalesID, T1.Quantity, T3.Price, FirstName, MiddleInitial, LastName ORDER BY T1.Quantity * T3.Price DESC LIMIT 1 | full name of the customer = FirstName, MiddleInitial, LastName; highest amount of total price refers to MAX(MULTIPLY(Quantity, Price)); | [
"Customers.CustomerID",
"Customers.FirstName",
"Customers.LastName",
"Customers.MiddleInitial",
"Products.Price",
"Products.ProductID",
"Sales.CustomerID",
"Sales.ProductID",
"Sales.Quantity",
"Sales.SalesID"
] |
5,450 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | How many "Mountain-500 Black 42" were sold in total? | SELECT SUM(T2.Quantity) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Mountain-500 Black, 42' | Mountain-500 Black 42' is name of product; sold in total = SUM(Quantity); | [
"Products.Name",
"Products.ProductID",
"Sales.ProductID",
"Sales.Quantity"
] |
5,451 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | How much is the total amount of sales handled by Heather McBadden? | SELECT SUM(T2.Quantity * T3.Price) FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T1.FirstName = 'Heather' AND T1.LastName = 'McBadden' | total amount of sales = SUM(MULTIPLY(Quantity, Price)); | [
"Employees.EmployeeID",
"Employees.FirstName",
"Employees.LastName",
"Products.Price",
"Products.ProductID",
"Sales.ProductID",
"Sales.Quantity",
"Sales.SalesPersonID"
] |
5,452 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | How many "Mountain-100 Silver, 38" were sold by Stearns MacFeather? | SELECT SUM(T2.Quantity) FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T1.FirstName = 'Stearns' AND T1.LastName = 'MacFeather' AND T3.Name = 'Mountain-100 Silver, 38' | Mountain-100 Silver, 38' is name of product; | [
"Employees.EmployeeID",
"Employees.FirstName",
"Employees.LastName",
"Products.Name",
"Products.ProductID",
"Sales.ProductID",
"Sales.Quantity",
"Sales.SalesPersonID"
] |
5,453 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | How many type of products did Dalton M. Coleman purchase? | SELECT COUNT(T2.ProductID) FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.FirstName = 'Dalton' AND T1.MiddleInitial = 'M' AND T1.LastName = 'Coleman' | [
"Customers.CustomerID",
"Customers.FirstName",
"Customers.LastName",
"Customers.MiddleInitial",
"Sales.CustomerID",
"Sales.ProductID"
] | |
5,454 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | What are the full names of the top 3 employees who handled the highest number of sales? | SELECT T1.FirstName, T1.MiddleInitial, T1.LastName FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID GROUP BY T2.SalesPersonID, T1.FirstName, T1.MiddleInitial, T1.LastName ORDER BY COUNT(T2.SalesID) DESC LIMIT 3 | full names of employees = FirstName, MiddleInitital, LastName; highest number of sales refers to MAX(COUNT(SalesID)); | [
"Employees.EmployeeID",
"Employees.FirstName",
"Employees.LastName",
"Employees.MiddleInitial",
"Sales.SalesID",
"Sales.SalesPersonID"
] |
5,455 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Among the "Mountain-500 Black" product types, which type was purchased the most? | SELECT T1.Name FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name LIKE 'Mountain-500 Black%' GROUP BY T2.Quantity, T1.Name ORDER BY SUM(T2.Quantity) DESC LIMIT 1 | Mountain-500 Black product types refers to Name like 'Mountain-500 Black%'; purchased the most refers to MAX(SUM(Quantity)); | [
"Products.Name",
"Products.ProductID",
"Sales.ProductID",
"Sales.Quantity"
] |
5,456 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | How many employees sold "ML Road Frame-W - Yellow, 40"? | SELECT COUNT(T2.SalesPersonID) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'ML Road Frame-W - Yellow, 40' | ML Road Frame-W - Yellow, 40' is name of product; | [
"Products.Name",
"Products.ProductID",
"Sales.ProductID",
"Sales.SalesPersonID"
] |
5,457 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | How many chainring bolts were sold under sales ID 551971? | SELECT T1.Quantity FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'Chainring Bolts' AND T1.SalesID = 551971 | Chainring Bolts' is name of product; | [
"Products.Name",
"Products.ProductID",
"Sales.ProductID",
"Sales.Quantity",
"Sales.SalesID"
] |
5,458 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | How many employees sold over 20,000 quantities of "Touring-2000 Blue, 50"? | SELECT COUNT(*) FROM ( SELECT SUM(Quantity) FROM Sales WHERE ProductID IN ( SELECT ProductID FROM Products WHERE Name = 'Touring-2000 Blue, 50' ) GROUP BY Quantity, SalesPersonID HAVING SUM(Quantity) > 20000 ) | over 20,000 quantities refers to Quantity > 20000; 'Touring-2000 Blue, 50' is name of product; | [
"Products.Name",
"Products.ProductID"
] |
5,459 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | What is the total cost of all the "Road-650, Red, 60" products that Abraham E. Bennet sold? | SELECT SUM(T2.Quantity * T3.Price) FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T1.FirstName = 'Abraham' AND T1.MiddleInitial = 'e' AND T1.LastName = 'Bennet' AND T3.Name = 'Road-650 Red, 60' | total cost = SUM(MULTIPLY(Quantity, Price)); 'Road-650, Red, 60' is name of product; | [
"Employees.EmployeeID",
"Employees.FirstName",
"Employees.LastName",
"Employees.MiddleInitial",
"Products.Name",
"Products.Price",
"Products.ProductID",
"Sales.ProductID",
"Sales.Quantity",
"Sales.SalesPersonID"
] |
5,460 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Which product has the highest total amount of quantity sold? Calculate its overall total price. | SELECT T1.Name, SUM(T2.Quantity * T1.Price) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID GROUP BY T1.ProductID, T1.Name ORDER BY SUM(T2.Quantity) DESC LIMIT 1 | highest total amount of quantity refers to MAX(Quantity); overall total price = SUM(MULTIPLY(Quantity, Price)); | [
"Products.Name",
"Products.Price",
"Products.ProductID",
"Sales.ProductID",
"Sales.Quantity"
] |
5,461 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | List the first name of all the customers whose last name is Chen. | SELECT FirstName, LastName FROM Customers WHERE LastName = 'Chen' | [
"Customers.FirstName",
"Customers.LastName"
] | |
5,462 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Among the employee names, what is the most common middle initial? | SELECT MiddleInitial FROM Employees GROUP BY MiddleInitial ORDER BY COUNT(MiddleInitial) DESC LIMIT 1 | most common middle initial refers to MAX(COUNT(MiddleInitial)); | [
"Employees.MiddleInitial"
] |
5,463 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | What is the average price of products that cost between 100 and 200? | SELECT AVG(Price) FROM Products WHERE Price BETWEEN 100 AND 200 | average price = DIVIDE(SUM(Price, COUNT(Price))); cost refers to Price; Price BETWEEN 100 AND 200; | [
"Products.Price"
] |
5,464 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | 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 ) | full name of the customer = FirstName, MiddleInitial, LastName; above-average quantity = Quantity > AVG(Quantity); | [
"Customers.CustomerID",
"Customers.FirstName",
"Customers.LastName",
"Customers.MiddleInitial",
"Sales.CustomerID",
"Sales.Quantity"
] |
5,465 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Give the full name of the customer who bought the most amount of products. | SELECT T3.FirstName, T3.MiddleInitial, T3.LastName FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Customers AS T3 ON T2.CustomerID = T3.CustomerID ORDER BY T2.Quantity * T1.Price DESC LIMIT 1 | full name of the customer = FirstName, MiddleInitial, LastName; most amount of products refers to MAX(MULTIPLY(Quantity, Price)); | [
"Customers.CustomerID",
"Customers.FirstName",
"Customers.LastName",
"Customers.MiddleInitial",
"Products.Price",
"Products.ProductID",
"Sales.CustomerID",
"Sales.ProductID",
"Sales.Quantity"
] |
5,466 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Of the employees who sold Blade, who has the most amount of sales? | SELECT T1.FirstName, T1.MiddleInitial, T1.LastName FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID ORDER BY T2.Quantity * T3.Price DESC LIMIT 1 | Blade' is name of product; most amount of sales refers to MAX(MULTIPLY(Quantity, Price)); | [
"Employees.EmployeeID",
"Employees.FirstName",
"Employees.LastName",
"Employees.MiddleInitial",
"Products.Price",
"Products.ProductID",
"Sales.ProductID",
"Sales.Quantity",
"Sales.SalesPersonID"
] |
5,467 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | List the full name of customers who spend more than 50,000 in descending order the amount spend. | SELECT DISTINCT T3.FirstName, T3.MiddleInitial, T3.LastName 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 T2.Quantity * T1.Price > 50000 | full name of the customer = FirstName, MiddleInitial, LastName; more than 50,000 in the amount refers to MULTIPLY(Quantity, Price) > 50000; | [
"Customers.CustomerID",
"Customers.FirstName",
"Customers.LastName",
"Customers.MiddleInitial",
"Products.Price",
"Products.ProductID",
"Sales.CustomerID",
"Sales.ProductID",
"Sales.Quantity"
] |
5,468 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Name the product that sold the most quantity. | SELECT T2.Name FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID ORDER BY T1.Quantity DESC LIMIT 1 | most quantity refers to MAX(Quantity); | [
"Products.Name",
"Products.ProductID",
"Sales.ProductID",
"Sales.Quantity"
] |
5,469 | sales | CREATE TABLE Customers
(
CustomerID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleInitial TEXT null,
LastName TEXT not null
);
CREATE TABLE Employees
(
EmployeeID INTEGER not null
primary key,
FirstName TEXT not null,
MiddleI... | Find and list the products that sold below the average quantity. | SELECT DISTINCT T2.Name FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Quantity < ( SELECT AVG(Quantity) FROM Sales ) | below the average quantity refers to Quantity < AVG(Quantity); | [
"Products.Name",
"Products.ProductID",
"Sales.ProductID",
"Sales.Quantity"
] |
5,470 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | How many dishes do not have correct data for the year in which it appeared first? | SELECT COUNT(*) FROM Dish WHERE first_appeared < 1851 OR first_appeared > 2012 | do not have correct data refers to first_appeared < 1851 or first_appeared > 2012; | [
"Dish.first_appeared"
] |
5,471 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | Which dish lasted longer, Anchovies or Fresh lobsters in every style? | SELECT CASE WHEN SUM(CASE WHEN name = 'Anchovies' THEN last_appeared - first_appeared ELSE 0 END) - SUM(CASE WHEN name = 'Fresh lobsters in every style' THEN last_appeared - first_appeared ELSE 0 END) > 0 THEN 'Anchovies' ELSE 'Fresh lobsters in every style' END FROM Dish WHERE name IN ('Fresh lobsters in every style',... | if (SUBTRACT(last_appeared, first_appeared) WHERE name = 'Anchovies') > (SUBTRACT(last_appeared, first_appeared) WHERE name = 'Fresh lobsters in every style'), it means 'Anchovies' lasted longer; if (SUBTRACT(last_appeared , first_appeared) WHERE name = 'Fresh lobsters in every style') > (SUBTRACT(last_appeared , first... | [
"Dish.first_appeared",
"Dish.last_appeared",
"Dish.name"
] |
5,472 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | Among all the dishes that were once free, what is the name of the dish that had appeared on most menus? | SELECT name FROM Dish WHERE lowest_price = 0 ORDER BY menus_appeared DESC LIMIT 1 | dishes that were once free refers to lowest_price = 0; appeared on most menus refers to MAX(menus_appeared); | [
"Dish.lowest_price",
"Dish.menus_appeared",
"Dish.name"
] |
5,473 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | How many menus with the name "Waldorf Astoria" have 4 pages? | SELECT COUNT(*) FROM Menu WHERE name = 'Waldorf Astoria' AND page_count = 4 | 4 pages refers to page_count = 4; | [
"Menu.name",
"Menu.page_count"
] |
5,474 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | What is the name of the dish that appeared on the upper left corner on menu page no. 1389? | SELECT T1.name FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T2.menu_page_id = 1389 AND T2.xpos < 0.25 AND T2.ypos < 0.25 | appeared on the upper left corner on menu refers to xpos < 0.25 AND ypos < 0.25; menu page no. refers to menu_page_id; menu_page_id = 1389; | [
"Dish.id",
"Dish.name",
"MenuItem.dish_id",
"MenuItem.menu_page_id",
"MenuItem.xpos",
"MenuItem.ypos"
] |
5,475 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | Please list the prices of the dish "Clear green turtle" on every menu page it appeared on. | SELECT T2.price FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name = 'Clear green turtle' | Clear green turtle is a name of dish; | [
"Dish.id",
"Dish.name",
"MenuItem.dish_id",
"MenuItem.price"
] |
5,476 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | Among all the menu pages with the appearance of the dish "Clear green turtle", how many of them have the dish at a stable price? | SELECT SUM(CASE WHEN T1.name = 'Clear green turtle' THEN 1 ELSE 0 END) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.highest_price IS NULL | Clear green turtle is a name of dish; stable price refers to highest_price is null; | [
"Dish.highest_price",
"Dish.id",
"Dish.name",
"MenuItem.dish_id"
] |
5,477 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | What is the highest price of the dish "Clear green turtle" on a menu page? | SELECT T2.price FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name = 'Clear green turtle' ORDER BY T2.price DESC LIMIT 1 | highest price refers to MAX(Price); Clear green turtle is a name of dish; | [
"Dish.id",
"Dish.name",
"MenuItem.dish_id",
"MenuItem.price"
] |
5,478 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | Please list the IDs of all the menus in which the dish "Clear green turtle" had appeared. | SELECT T1.menu_id FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id WHERE T3.name = 'Clear green turtle' | Clear green turtle is a name of dish; | [
"Dish.id",
"Dish.name",
"MenuItem.dish_id",
"MenuItem.menu_page_id",
"MenuPage.id",
"MenuPage.menu_id"
] |
5,479 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | Among the menus in which the dish "Clear green turtle" had appeared, how many of them used the dollar as their currency? | SELECT SUM(CASE WHEN T3.currency = 'Dollars' THEN 1 ELSE 0 END) FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id INNER JOIN Dish AS T4 ON T1.dish_id = T4.id WHERE T4.name = 'Clear green turtle' | Clear green turtle is a name of dish; dollar as currency refers to currency = 'Dollars'; | [
"Dish.id",
"Dish.name",
"Menu.currency",
"Menu.id",
"MenuItem.dish_id",
"MenuItem.menu_page_id",
"MenuPage.id",
"MenuPage.menu_id"
] |
5,480 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | Among the menus in which the dish "Clear green turtle" had appeared, how many of them did not support taking out or booking in advance? | SELECT SUM(CASE WHEN T4.name = 'Clear green turtle' THEN 1 ELSE 0 END) FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id INNER JOIN Dish AS T4 ON T1.dish_id = T4.id WHERE T3.call_number IS NULL | Clear green turtle is a name of dish; not support taking out or booking in advance refers to call_number is null; | [
"Dish.id",
"Dish.name",
"Menu.call_number",
"Menu.id",
"MenuItem.dish_id",
"MenuItem.menu_page_id",
"MenuPage.id",
"MenuPage.menu_id"
] |
5,481 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | Please list the names of all the dishes that appeared on the menu "Zentral Theater Terrace". | SELECT T4.name FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id INNER JOIN Dish AS T4 ON T1.dish_id = T4.id WHERE T3.name = 'Zentral Theater Terrace' | Zentral Theater Terrace is a name of menu; | [
"Dish.id",
"Dish.name",
"Menu.id",
"Menu.name",
"MenuItem.dish_id",
"MenuItem.menu_page_id",
"MenuPage.id",
"MenuPage.menu_id"
] |
5,482 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | Which dish has the highest price on the menu "Zentral Theater Terrace"? Please give its name. | SELECT T4.name FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id INNER JOIN Dish AS T4 ON T1.dish_id = T4.id WHERE T3.name = 'Zentral Theater Terrace' ORDER BY T1.price DESC LIMIT 1 | highest price refers to MAX(Price); Zentral Theater Terrace is a name of menu; | [
"Dish.id",
"Dish.name",
"Menu.id",
"Menu.name",
"MenuItem.dish_id",
"MenuItem.menu_page_id",
"MenuItem.price",
"MenuPage.id",
"MenuPage.menu_id"
] |
5,483 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | How many dishes are there on the menu "Zentral Theater Terrace"? | SELECT SUM(CASE WHEN T3.name = 'Zentral Theater Terrace' THEN 1 ELSE 0 END) FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id | Zentral Theater Terrace is a name of menu; | [
"Menu.id",
"Menu.name",
"MenuItem.menu_page_id",
"MenuPage.id",
"MenuPage.menu_id"
] |
5,484 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | How many dishes are there in total in the menus with the name "Waldorf Astoria"? | SELECT SUM(CASE WHEN T3.name = 'Waldorf Astoria' THEN 1 ELSE 0 END) FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id | FALSE; | [
"Menu.id",
"Menu.name",
"MenuItem.menu_page_id",
"MenuPage.id",
"MenuPage.menu_id"
] |
5,485 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | Please list the IDs of the menus that are DIYs of the restaurant and have the dish "Clear green turtle". | SELECT T2.menu_id FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id INNER JOIN Dish AS T4 ON T1.dish_id = T4.id WHERE T4.name = 'Clear green turtle' AND T3.sponsor IS NULL | IDs of the menus refers to menu_id; menus that are DIYs of the restaurant refers to sponsor is null; Clear green turtle is a name of dish; | [
"Dish.id",
"Dish.name",
"Menu.id",
"Menu.sponsor",
"MenuItem.dish_id",
"MenuItem.menu_page_id",
"MenuPage.id",
"MenuPage.menu_id"
] |
5,486 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | What is the average page number of the menus that have the dish "Clear green turtle"? | SELECT AVG(T1.page_number) FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id WHERE T3.name = 'Clear green turtle' | average page number = AVG(page_number); Clear green turtle is a name of dish; | [
"Dish.id",
"Dish.name",
"MenuItem.dish_id",
"MenuItem.menu_page_id",
"MenuPage.id",
"MenuPage.page_number"
] |
5,487 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | What is the average price of the dishes on the menu "Zentral Theater Terrace"? | SELECT SUM(T1.price) / COUNT(T1.price) FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id WHERE T3.name = 'Zentral Theater Terrace' | average price = AVG(price); Zentral Theater Terrace refers to menu; | [
"Menu.id",
"Menu.name",
"MenuItem.menu_page_id",
"MenuItem.price",
"MenuPage.id",
"MenuPage.menu_id"
] |
5,488 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | How many menu items were created on 28th March 2011? | SELECT COUNT(*) FROM MenuItem WHERE created_at LIKE '2011-03-28%' | created on 28th March 2011 refers to created_at like '2011-03-28%'; | [
"MenuItem.created_at"
] |
5,489 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | How many dishes are included in the menu page ID 144? | SELECT COUNT(*) FROM MenuItem WHERE menu_page_id = 144 | FALSE; | [
"MenuItem.menu_page_id"
] |
5,490 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | How many menus were used in Dutcher House? | SELECT COUNT(*) FROM Menu WHERE location = 'Dutcher House' | Dutcher House refers to location = 'Dutcher House'; | [
"Menu.location"
] |
5,491 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | How many dishes appeared on a menu more than once? | SELECT COUNT(*) FROM Dish WHERE times_appeared > menus_appeared | appeared on a menu more than once refers to times_appeared > menus_appeared; | [
"Dish.menus_appeared",
"Dish.times_appeared"
] |
5,492 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | How many menus were created for steamship? | SELECT COUNT(*) FROM Menu WHERE venue = 'STEAMSHIP' | steamship refers to venue = 'STEAMSHIP'; | [
"Menu.venue"
] |
5,493 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | How many pages were there on the menu created on 17th November 1898? | SELECT SUM(CASE WHEN T1.date = '1898-11-17' THEN 1 ELSE 0 END) FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id | created on 17th November 1898 refers to date = '1898-11-17'; | [
"Menu.date",
"Menu.id",
"MenuPage.menu_id"
] |
5,494 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | Name the dishes that were on the menu page ID 174. | SELECT T2.name FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE T1.menu_page_id = 174 | FALSE; | [
"Dish.id",
"Dish.name",
"MenuItem.dish_id",
"MenuItem.menu_page_id"
] |
5,495 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | List the names and menu page IDs of the dishes that first appeared in 1861. | SELECT T2.name, T1.dish_id FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE T2.first_appeared = 1861 | first appeared in 1861 refers to first_appeared = 1861; | [
"Dish.first_appeared",
"Dish.id",
"Dish.name",
"MenuItem.dish_id"
] |
5,496 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | Among the dishes on menu page ID 7610, list the names and highest prices of the dishes in menu items that were created on 23rd May 2011. | SELECT T1.name, T2.price FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T2.created_at LIKE '2011-05-23%' ORDER BY T2.price DESC LIMIT 1 | highest prices of the dishes refers to MAX(price); created on 23rd May 2011 refers to created_at like '2011-05-23%'; | [
"Dish.id",
"Dish.name",
"MenuItem.created_at",
"MenuItem.dish_id",
"MenuItem.price"
] |
5,497 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | List the dishes included on page number 30 with the least in full height. | SELECT T3.name FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id WHERE T1.page_number = 30 ORDER BY T1.full_height DESC, T1.full_height ASC LIMIT 1 | least in full height refers to MIN(full_height); | [
"Dish.id",
"Dish.name",
"MenuItem.dish_id",
"MenuItem.menu_page_id",
"MenuPage.full_height",
"MenuPage.id",
"MenuPage.page_number"
] |
5,498 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | Provide the page IDs and name of the menu which had the highest page count. | SELECT T1.page_number, T2.name FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id ORDER BY T2.page_count DESC LIMIT 1 | page IDs refers to page_number; highest page count refers to MAX(page_count); | [
"Menu.id",
"Menu.name",
"Menu.page_count",
"MenuPage.menu_id",
"MenuPage.page_number"
] |
5,499 | menu | CREATE TABLE Dish
(
id INTEGER
primary key,
name TEXT,
description TEXT,
menus_appeared INTEGER,
times_appeared INTEGER,
first_appeared INTEGER,
last_appeared INTEGER,
lowest_price REAL,
highest_price REAL
);
CREATE TABLE Menu
(
id ... | On the menu with the most dishes, how many dishes were there on its second page? | SELECT COUNT(T1.dish_id) FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id WHERE T2.page_number = 2 GROUP BY T3.name ORDER BY T3.dish_count DESC LIMIT 1 | menu with the most dishes refers to menu.id with MAX(dish_count); second page refers to page_number = 2; | [
"Menu.dish_count",
"Menu.id",
"Menu.name",
"MenuItem.dish_id",
"MenuItem.menu_page_id",
"MenuPage.id",
"MenuPage.menu_id",
"MenuPage.page_number"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.