db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
sales | 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 | Question: what is the average number of customers per sales person? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales.Pro... | what is the average number of customers per sales person? |
sales | 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' | Question: among all customers handled by innes e. del castillo, how many have purchased short-sleeve classic jersey, l? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID,... | among all customers handled by innes e. del castillo, how many have purchased short-sleeve classic jersey, l? |
sales | 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... | Question: name the sales person who helped elizabeth a. white to purchase road-250 black, 48. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Qu... | name the sales person who helped elizabeth a. white to purchase road-250 black, 48. |
sales | select count(t2.salespersonid) from products as t1 inner join sales as t2 on t1.productid = t2.productid where t1.name = 'headlights - weatherproof' | Question: how many sales people managed to sell headlights - weatherproof? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sa... | how many sales people managed to sell headlights - weatherproof? |
sales | 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' | Question: calculate the revenue produced through sales of hl road frame - red, 56. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | J... | calculate the revenue produced through sales of hl road frame - red, 56. |
sales | 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' | Question: how many sales transactions were given by the customer named joe l. lopez? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. |... | how many sales transactions were given by the customer named joe l. lopez? |
sales | 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 | Question: name the customers who received 'touring rim' as a free gift. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales... | name the customers who received 'touring rim' as a free gift. |
sales | select count(customerid) from sales group by salespersonid | Question: find the number of customers handled by each of the sales people. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: S... | find the number of customers handled by each of the sales people. |
sales | select count(employeeid) from employees | Question: how many sales people are handling all the customers? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales.Product... | how many sales people are handling all the customers? |
sales | select firstname, middleinitial, lastname from employees where employeeid = 7 | Question: identify the name of the sales person with employee id 7. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales.Pro... | identify the name of the sales person with employee id 7. |
sales | select name from products where price in (( select max(price) from products ), ( select min(price) from products )) | Question: name the most expensive and the least expensive products available, excluding free gifts. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, Product... | name the most expensive and the least expensive products available, excluding free gifts. |
sales | 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' | Question: among all the customers who have purchased ml bottom bracket, identify the percentage of sales by albert i. ringer? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPer... | among all the customers who have purchased ml bottom bracket, identify the percentage of sales by albert i. ringer? |
sales | select count(customerid) from customers where firstname = 'abigail' | Question: how many customers have the first name abigail? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales.ProductID = P... | how many customers have the first name abigail? |
sales | select distinct t2.quantity from products as t1 inner join sales as t2 on t1.productid = t2.productid where t1.name = 'blade' | Question: indicate the quantity of blade products sold. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales.ProductID = Pro... | indicate the quantity of blade products sold. |
sales | 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 | Question: give the full name of the employee who has sold the most quantity. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: ... | give the full name of the employee who has sold the most quantity. |
sales | 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 | Question: list the full name of the customer who purchased the most quantity of products. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quanti... | list the full name of the customer who purchased the most quantity of products. |
sales | 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 | Question: what is the name of the product that is most sold by sale person id 20? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Jo... | what is the name of the product that is most sold by sale person id 20? |
sales | select distinct t1.firstname from employees as t1 inner join sales as t2 on t1.employeeid = t2.salespersonid where t2.quantity > 500 | Question: list the first names of employees with trading quantity for more than 500. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. |... | list the first names of employees with trading quantity for more than 500. |
sales | select t1.firstname from customers as t1 inner join sales as t2 on t1.customerid = t2.customerid where t2.salespersonid = 1 | Question: list the first names of customers who have purchased products from sale person id 1. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Q... | list the first names of customers who have purchased products from sale person id 1. |
sales | 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' | Question: calculate the total trading quantity of abraham sold to aaron alexander. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | J... | calculate the total trading quantity of abraham sold to aaron alexander. |
sales | select t1.firstname, t1.lastname from customers as t1 inner join sales as t2 on t1.customerid = t2.customerid where t2.quantity > 600 | Question: list the full names of customers who have purchased products in quantity over 600. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Qua... | list the full names of customers who have purchased products in quantity over 600. |
sales | 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 | Question: among the customers whose first name is cameron, who bought the product in the most quantity? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, Pro... | among the customers whose first name is cameron, who bought the product in the most quantity? |
sales | 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 | Question: please provide sales id for products named hex nut with a price greater than 100. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quan... | please provide sales id for products named hex nut with a price greater than 100. |
sales | 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 | Question: identify customer ids who bought products priced from 1000 to 2000. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins:... | identify customer ids who bought products priced from 1000 to 2000. |
sales | select sum(t2.quantity) from products as t1 inner join sales as t2 on t1.productid = t2.productid where t1.price = 0 | Question: calculate the total quantity of products that are gifts. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales.Prod... | calculate the total quantity of products that are gifts. |
sales | 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 | Question: calculate the quantity percentage of the gift products in the total trading quantity. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, ... | calculate the quantity percentage of the gift products in the total trading quantity. |
sales | 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 | Question: calculate the percentage of sold blades in the total number of transactions. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity.... | calculate the percentage of sold blades in the total number of transactions. |
sales | select count(lastname) from employees where lastname = 'ringer' | Question: how many of the employees have the last name 'ringer' ? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales.Produ... | how many of the employees have the last name 'ringer' ? |
sales | select count(productid) from products where productid < 15 and price <= 10 | Question: among the products with product id lower than 15, how many of them costs 10 and below? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID,... | among the products with product id lower than 15, how many of them costs 10 and below? |
sales | 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' | Question: give the product's name brought by aaron alexander. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales.ProductID... | give the product's name brought by aaron alexander. |
sales | 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 | Question: give the product id and name of the product with the highest prices among the quantity ranges from 400 to 500. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID... | give the product id and name of the product with the highest prices among the quantity ranges from 400 to 500. |
sales | 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 | Question: among customers named kate, who has the highest quantity? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales.Pro... | among customers named kate, who has the highest quantity? |
sales | 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 | 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? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. ... | 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? |
sales | 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' | Question: list the quantity and price of the product bought by abigail henderson. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Jo... | list the quantity and price of the product bought by abigail henderson. |
sales | 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 | Question: in sales with a quantity of 60, how many of them have a price not greater than 500? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Qu... | in sales with a quantity of 60, how many of them have a price not greater than 500? |
sales | 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 | Question: in customers with the first name of erica, how many of them bought a quantity below 200? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductI... | in customers with the first name of erica, how many of them bought a quantity below 200? |
sales | 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 | Question: among products bought by kathryn ashe, what is the name of the product with the highest quantity? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID,... | among products bought by kathryn ashe, what is the name of the product with the highest quantity? |
sales | 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' | Question: what is the price and quantity of the product named seat tube? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sale... | what is the price and quantity of the product named seat tube? |
sales | 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' | Question: what is the price and name of the product bought by erica xu? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales... | what is the price and name of the product bought by erica xu? |
sales | 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 | Question: list the sales id of the product with a quantity of 590 and named 'external lock washer 7'. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, Produ... | list the sales id of the product with a quantity of 590 and named 'external lock washer 7'. |
sales | 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 | Question: in sales id between 30 and 40, who is the customer that bought a total quantity of 403? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID... | in sales id between 30 and 40, who is the customer that bought a total quantity of 403? |
sales | 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 | Question: list the customer's id and last name of the customer that purchased a product with a quantity greater than 90% of the average quantity of all listed products. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> Product... | 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. |
sales | 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 | Question: among the sales id ranges from 1 to 200, what is the percentage of the products with a price ranging from 200 to 300? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesP... | among the sales id ranges from 1 to 200, what is the percentage of the products with a price ranging from 200 to 300? |
sales | select name from products where price = ( select max(price) from products ) | Question: what is the name of the most expensive product? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales.ProductID = P... | what is the name of the most expensive product? |
sales | select count(customerid) from customers where firstname = 'madison' | Question: how many customers are named madison? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales.ProductID = Products.Pr... | how many customers are named madison? |
sales | select count(productid) from products where name like '%hl touring frame%' | Question: how many types of 'hl touring frames' are there? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales.ProductID = ... | how many types of 'hl touring frames' are there? |
sales | select count(customerid) from customers group by lastname order by count(lastname) desc limit 1 | Question: how many customers share the most common last name? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales.ProductID... | how many customers share the most common last name? |
sales | select count(productid) from products where price = 0 | Question: how many free or gift products are there? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales.ProductID = Product... | how many free or gift products are there? |
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 | Question: what is the name of the sales person who handled the highest number of sales? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity... | what is the name of the sales person who handled the highest number of sales? |
sales | 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 | Question: what is the full name of the customer who purchased the highest amount of total price in a single purchase? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, C... | what is the full name of the customer who purchased the highest amount of total price in a single purchase? |
sales | 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' | Question: how many 'mountain-500 black 42' were sold in total? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales.ProductI... | how many 'mountain-500 black 42' were sold in total? |
sales | 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' | Question: how much is the total amount of sales handled by heather mcbadden? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: ... | how much is the total amount of sales handled by heather mcbadden? |
sales | 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' | Question: how many 'mountain-100 silver, 38' were sold by stearns macfeather? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins:... | how many 'mountain-100 silver, 38' were sold by stearns macfeather? |
sales | 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' | Question: how many type of products did dalton m. coleman purchase? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales.Pro... | how many type of products did dalton m. coleman purchase? |
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 | Question: what are the full names of the top 3 employees who handled the highest number of sales? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID... | what are the full names of the top 3 employees who handled the highest number of sales? |
sales | 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 | Question: among the 'mountain-500 black' product types, which type was purchased the most? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quant... | among the 'mountain-500 black' product types, which type was purchased the most? |
sales | 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' | Question: how many employees sold 'ml road frame-w - yellow, 40'? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales.Produ... | how many employees sold 'ml road frame-w - yellow, 40'? |
sales | 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 | Question: how many chainring bolts were sold under sales id 551971? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales.Pro... | how many chainring bolts were sold under sales id 551971? |
sales | 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 ) | Question: how many employees sold over 20,000 quantities of 'touring-2000 blue, 50'? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. |... | how many employees sold over 20,000 quantities of 'touring-2000 blue, 50'? |
sales | 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' | Question: what is the total cost of all the 'road-650, red, 60' products that abraham e. bennet sold? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, Produ... | what is the total cost of all the 'road-650, red, 60' products that abraham e. bennet sold? |
sales | 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 | Question: which product has the highest total amount of quantity sold? calculate its overall total price. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, P... | which product has the highest total amount of quantity sold? calculate its overall total price. |
sales | select firstname, lastname from customers where lastname = 'chen' | Question: list the first name of all the customers whose last name is chen. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: S... | list the first name of all the customers whose last name is chen. |
sales | select middleinitial from employees group by middleinitial order by count(middleinitial) desc limit 1 | Question: among the employee names, what is the most common middle initial? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: S... | among the employee names, what is the most common middle initial? |
sales | select avg(price) from products where price between 100 and 200 | Question: what is the average price of products that cost between 100 and 200? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins... | what is the average price of products that cost between 100 and 200? |
sales | 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 ) | Question: find and list the full name of customers who bought products above-average quantity. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Q... | find and list the full name of customers who bought products above-average quantity. |
sales | 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 | Question: give the full name of the customer who bought the most amount of products. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. |... | give the full name of the customer who bought the most amount of products. |
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 | Question: of the employees who sold blade, who has the most amount of sales? | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: ... | of the employees who sold blade, who has the most amount of sales? |
sales | 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 | Question: list the full name of customers who spend more than 50,000 in descending order the amount spend. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ... | list the full name of customers who spend more than 50,000 in descending order the amount spend. |
sales | select t2.name from sales as t1 inner join products as t2 on t1.productid = t2.productid order by t1.quantity desc limit 1 | Question: name the product that sold the most quantity. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sales.ProductID = Pro... | name the product that sold the most quantity. |
sales | 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 ) | Question: find and list the products that sold below the average quantity. | Tables: Customers -> CustomerID, FirstName, MiddleInitial, LastName. Employees -> EmployeeID, FirstName, MiddleInitial, LastName. Products -> ProductID, Name, Price. Sales -> SalesID, SalesPersonID, CustomerID, ProductID, Quantity. | Joins: Sa... | find and list the products that sold below the average quantity. |
menu | select count(*) from dish where first_appeared < 1851 or first_appeared > 2012 | Question: how many dishes do not have correct data for the year in which it appeared first? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, call_num... | how many dishes do not have correct data for the year in which it appeared first? |
menu | 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',... | Question: which dish lasted longer, anchovies or fresh lobsters in every style? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, call_number, keyword... | which dish lasted longer, anchovies or fresh lobsters in every style? |
menu | select name from dish where lowest_price = 0 order by menus_appeared desc limit 1 | Question: among all the dishes that were once free, what is the name of the dish that had appeared on most menus? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occ... | among all the dishes that were once free, what is the name of the dish that had appeared on most menus? |
menu | select count(*) from menu where name = 'waldorf astoria' and page_count = 4 | Question: how many menus with the name 'waldorf astoria' have 4 pages? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, call_number, keywords, langua... | how many menus with the name 'waldorf astoria' have 4 pages? |
menu | 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 | Question: what is the name of the dish that appeared on the upper left corner on menu page no. 1389? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes,... | what is the name of the dish that appeared on the upper left corner on menu page no. 1389? |
menu | select t2.price from dish as t1 inner join menuitem as t2 on t1.id = t2.dish_id where t1.name = 'clear green turtle' | Question: please list the prices of the dish 'clear green turtle' on every menu page it appeared on. | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes,... | please list the prices of the dish 'clear green turtle' on every menu page it appeared on. |
menu | 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 | Question: 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? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, ... | 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? |
menu | 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 | Question: what is the highest price of the dish 'clear green turtle' on a menu page? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, call_number, ke... | what is the highest price of the dish 'clear green turtle' on a menu page? |
menu | 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' | Question: please list the ids of all the menus in which the dish 'clear green turtle' had appeared. | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, ... | please list the ids of all the menus in which the dish 'clear green turtle' had appeared. |
menu | 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' | Question: among the menus in which the dish 'clear green turtle' had appeared, how many of them used the dollar as their currency? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical... | among the menus in which the dish 'clear green turtle' had appeared, how many of them used the dollar as their currency? |
menu | 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 | Question: 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? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, ... | 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? |
menu | 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' | Question: please list the names of all the dishes that appeared on the menu 'zentral theater terrace'. | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, note... | please list the names of all the dishes that appeared on the menu 'zentral theater terrace'. |
menu | 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 | Question: which dish has the highest price on the menu 'zentral theater terrace'? please give its name. | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, not... | which dish has the highest price on the menu 'zentral theater terrace'? please give its name. |
menu | 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 | Question: how many dishes are there on the menu 'zentral theater terrace'? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, call_number, keywords, la... | how many dishes are there on the menu 'zentral theater terrace'? |
menu | 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 | Question: how many dishes are there in total in the menus with the name 'waldorf astoria'? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, call_numb... | how many dishes are there in total in the menus with the name 'waldorf astoria'? |
menu | 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 | Question: please list the ids of the menus that are diys of the restaurant and have the dish 'clear green turtle'. | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, oc... | please list the ids of the menus that are diys of the restaurant and have the dish 'clear green turtle'. |
menu | 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' | Question: what is the average page number of the menus that have the dish 'clear green turtle'? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, call... | what is the average page number of the menus that have the dish 'clear green turtle'? |
menu | 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' | Question: what is the average price of the dishes on the menu 'zentral theater terrace'? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, call_number... | what is the average price of the dishes on the menu 'zentral theater terrace'? |
menu | select count(*) from menuitem where created_at like '2011-03-28%' | Question: how many menu items were created on 28th march 2011? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, call_number, keywords, language, date... | how many menu items were created on 28th march 2011? |
menu | select count(*) from menuitem where menu_page_id = 144 | Question: how many dishes are included in the menu page id 144? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, call_number, keywords, language, dat... | how many dishes are included in the menu page id 144? |
menu | select count(*) from menu where location = 'dutcher house' | Question: how many menus were used in dutcher house? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, call_number, keywords, language, date, location... | how many menus were used in dutcher house? |
menu | select count(*) from dish where times_appeared > menus_appeared | Question: how many dishes appeared on a menu more than once? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, call_number, keywords, language, date, ... | how many dishes appeared on a menu more than once? |
menu | select count(*) from menu where venue = 'steamship' | Question: how many menus were created for steamship? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, call_number, keywords, language, date, location... | how many menus were created for steamship? |
menu | 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 | Question: how many pages were there on the menu created on 17th november 1898? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, call_number, keywords... | how many pages were there on the menu created on 17th november 1898? |
menu | select t2.name from menuitem as t1 inner join dish as t2 on t2.id = t1.dish_id where t1.menu_page_id = 174 | Question: name the dishes that were on the menu page id 174. | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, call_number, keywords, language, date, ... | name the dishes that were on the menu page id 174. |
menu | 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 | Question: list the names and menu page ids of the dishes that first appeared in 1861. | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, call_number, k... | list the names and menu page ids of the dishes that first appeared in 1861. |
menu | 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 | Question: 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. | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue,... | 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. |
menu | 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 | Question: list the dishes included on page number 30 with the least in full height. | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, call_number, key... | list the dishes included on page number 30 with the least in full height. |
menu | 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 | Question: provide the page ids and name of the menu which had the highest page count. | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, call_number, k... | provide the page ids and name of the menu which had the highest page count. |
menu | 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 | Question: on the menu with the most dishes, how many dishes were there on its second page? | Tables: Dish -> id, name, description, menus_appeared, times_appeared, first_appeared, last_appeared, lowest_price, highest_price. Menu -> id, name, sponsor, event, venue, place, physical_description, occasion, notes, call_numb... | on the menu with the most dishes, how many dishes were there on its second page? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.