minktn/spider-data huggingface dataset:
Database: bakery_1
Question: How many customers have bought each food?
SQL: SELECT T1.food ,  count(DISTINCT T3.CustomerId) FROM goods AS T1 JOIN items AS T2 ON T1.Id  =  T2.Item JOIN receipts AS T3 ON T2.Receipt  =  T3.ReceiptNumber GROUP BY T1.food
Database: bakery_1
Question: Find the id of customers who shopped at the bakery at least 15 times.
SQL: SELECT CustomerId FROM receipts GROUP BY CustomerId HAVING count(*)  >=  15
Database: bakery_1
Question: What are the customer ids of customers who have at least 15 receipts?
SQL: SELECT CustomerId FROM receipts GROUP BY CustomerId HAVING count(*)  >=  15
Database: bakery_1
Question: What is the last name of the customers who shopped at the bakery more than 10 times?
SQL: SELECT T2.LastName FROM receipts AS T1 JOIN customers AS T2 ON T1.CustomerId  =  T2.id GROUP BY T2.id HAVING count(*)  >  10
Database: bakery_1
Question: Give the last names of customers who have been to the bakery more than 10 times?
SQL: SELECT T2.LastName FROM receipts AS T1 JOIN customers AS T2 ON T1.CustomerId  =  T2.id GROUP BY T2.id HAVING count(*)  >  10
Database: bakery_1
Question: How many types of Cake does this bakery sell?
SQL: SELECT count(*) FROM goods WHERE food  =  "Cake"
Database: bakery_1
Question: Count the number of types of cake this bakery sells.
SQL: SELECT count(*) FROM goods WHERE food  =  "Cake"
Database: bakery_1
Question: List all the flavors of Croissant available in this bakery.
SQL: SELECT flavor FROM goods WHERE food  =  "Croissant"
Database: bakery_1
Question: What are all the flavors of croissant?
SQL: SELECT flavor FROM goods WHERE food  =  "Croissant"
Database: bakery_1
Question: Give me a list of all the distinct items bought by the customer number 15.
SQL: SELECT DISTINCT T1.item FROM items AS T1 JOIN receipts AS T2 ON T1.receipt  =  T2.ReceiptNumber WHERE T2.CustomerId  =  15
Database: bakery_1
Question: What are all the distinct items bought by customer 15?
SQL: SELECT DISTINCT T1.item FROM items AS T1 JOIN receipts AS T2 ON T1.receipt  =  T2.ReceiptNumber WHERE T2.CustomerId  =  15
Database: bakery_1
Question: For each type of food, what are the average, maximum and minimum price?
SQL: SELECT food ,  avg(price) ,  max(price) ,  min(price) FROM goods GROUP BY food
Database: bakery_1
Question: What are the average, minimum and maximum prices for each food?
SQL: SELECT food ,  avg(price) ,  max(price) ,  min(price) FROM goods GROUP BY food
Database: bakery_1
Question: Find the receipt numbers where both Cake and Cookie were bought.
SQL: SELECT T1.receipt FROM items AS T1 JOIN goods AS T2 ON T1.item  =  T2.id WHERE T2.food  =  "Cake" INTERSECT SELECT T1.receipt FROM items AS T1 JOIN goods AS T2 ON T1.item  =  T2.id WHERE T2.food  =  "Cookie"
Database: bakery_1
Question: What are the receipt numbers for instances where both cakes and cookies were purchased?
SQL: SELECT T1.receipt FROM items AS T1 JOIN goods AS T2 ON T1.item  =  T2.id WHERE T2.food  =  "Cake" INTERSECT SELECT T1.receipt FROM items AS T1 JOIN goods AS T2 ON T1.item  =  T2.id WHERE T2.food  =  "Cookie"
Database: bakery_1
Question: Find all the receipt numbers in which customer with last name LOGAN purchased Croissant.
SQL: SELECT T1.ReceiptNumber FROM receipts AS T1 JOIN items AS T2 ON T1.ReceiptNumber  =  T2.receipt JOIN goods AS T3 ON T2.item  =  T3.id JOIN customers AS T4 ON T4.Id  =  T1.CustomerId WHERE T3.food  =  "Croissant" AND T4.LastName  =  'LOGAN'
Database: bakery_1
Question: What are the receipt numbers for a customer with the last name Logan who purchased a croissant?
SQL: SELECT T1.ReceiptNumber FROM receipts AS T1 JOIN items AS T2 ON T1.ReceiptNumber  =  T2.receipt JOIN goods AS T3 ON T2.item  =  T3.id JOIN customers AS T4 ON T4.Id  =  T1.CustomerId WHERE T3.food  =  "Croissant" AND T4.LastName  =  'LOGAN'
Database: bakery_1
Question: What is the receipt number and date of the receipt in which the most expensive item was bought?
SQL: SELECT T1.ReceiptNumber ,  T1.Date FROM receipts AS T1 JOIN items AS T2 ON T1.ReceiptNumber  =  T2.receipt JOIN goods AS T3 ON T2.item  =  T3.id ORDER BY T3.price DESC LIMIT 1
Database: bakery_1
Question: What is the receipt number and date corresponding to the receipt for which the most expensive item was purchased?
SQL: SELECT T1.ReceiptNumber ,  T1.Date FROM receipts AS T1 JOIN items AS T2 ON T1.ReceiptNumber  =  T2.receipt JOIN goods AS T3 ON T2.item  =  T3.id ORDER BY T3.price DESC LIMIT 1
Database: bakery_1
Question: What is the item that was bought the least number of times?
SQL: SELECT item FROM items GROUP BY item ORDER BY count(*) LIMIT 1
Database: bakery_1
Question: Which item was bought the fewest times?
SQL: SELECT item FROM items GROUP BY item ORDER BY count(*) LIMIT 1
Database: bakery_1
Question: How many goods are available for each food type?
SQL: SELECT count(*) ,  food FROM goods GROUP BY food
Database: bakery_1
Question: Count the number of goods for each food type.
SQL: SELECT count(*) ,  food FROM goods GROUP BY food
Database: bakery_1
Question: What is the average price for each food type?
SQL: SELECT avg(price) ,  food FROM goods GROUP BY food
Database: bakery_1
Question: Give the average price for each food type.
SQL: SELECT avg(price) ,  food FROM goods GROUP BY food
Database: bakery_1
Question: What are ids of the goods that have Apricot flavor and are cheaper than 5 dollars?
SQL: SELECT id FROM goods WHERE flavor  =  "Apricot" AND price  <  5
Database: bakery_1
Question: Give the ids for goods that have Apricot flavor and have a price lower than 5 dollars.
SQL: SELECT id FROM goods WHERE flavor  =  "Apricot" AND price  <  5
Database: bakery_1
Question: Find flavor of cakes that cost more than 10 dollars.
SQL: SELECT flavor FROM goods WHERE food  =  "Cake" AND price  >  10
Database: bakery_1
Question: What are the flavors of cakes that cost more than 10 dollars?
SQL: SELECT flavor FROM goods WHERE food  =  "Cake" AND price  >  10
Database: bakery_1
Question: Give me the distinct id and price for all goods whose price is below the average of all goods?
SQL: SELECT DISTINCT id ,  price FROM goods WHERE price  <  (SELECT avg(price) FROM goods)
Database: bakery_1
Question: What are the distinct ids and prices for goods that cost less than the average good?
SQL: SELECT DISTINCT id ,  price FROM goods WHERE price  <  (SELECT avg(price) FROM goods)
Database: bakery_1
Question: What are the distinct ids of all goods that are cheaper than some goods of type Tart?
SQL: SELECT DISTINCT id FROM goods WHERE price  <  (SELECT max(price) FROM goods WHERE food  =  "Tart")
Database: bakery_1
Question: Give the distinct ids for goods that cost less than any Tart.
SQL: SELECT DISTINCT id FROM goods WHERE price  <  (SELECT max(price) FROM goods WHERE food  =  "Tart")
Database: bakery_1
Question: List distinct receipt numbers for which someone bought a good that costs more than 13 dollars.
SQL: SELECT DISTINCT T1.ReceiptNumber FROM receipts AS T1 JOIN items AS T2 ON T1.ReceiptNumber  =  T2.receipt JOIN goods AS T3 ON T2.item  =  T3.id WHERE T3.price  >  13
Database: bakery_1
Question: What distinct receipt numbers correspond to someone who bought a good that costs more than 13 dollars?
SQL: SELECT DISTINCT T1.ReceiptNumber FROM receipts AS T1 JOIN items AS T2 ON T1.ReceiptNumber  =  T2.receipt JOIN goods AS T3 ON T2.item  =  T3.id WHERE T3.price  >  13
Database: bakery_1
Question: On which date did some customer buy a good that costs more than 15 dollars?
SQL: SELECT DISTINCT T1.date FROM receipts AS T1 JOIN items AS T2 ON T1.ReceiptNumber  =  T2.receipt JOIN goods AS T3 ON T2.item  =  T3.id WHERE T3.price  >  15
Database: bakery_1
Question: Which date corresponds to when a customer purchased a good costing over 15 dollars?
SQL: SELECT DISTINCT T1.date FROM receipts AS T1 JOIN items AS T2 ON T1.ReceiptNumber  =  T2.receipt JOIN goods AS T3 ON T2.item  =  T3.id WHERE T3.price  >  15
Database: bakery_1
Question: Give me the list of ids of all goods whose id has "APP".
SQL: SELECT id FROM goods WHERE id LIKE "%APP%"
Database: bakery_1
Question: What are all the ids of goods with an id which contains "APP"?
SQL: SELECT id FROM goods WHERE id LIKE "%APP%"
Database: bakery_1
Question: Which good has "70" in its id? And what is its price?
SQL: SELECT id ,  price FROM goods WHERE id LIKE "%70%"
Database: bakery_1
Question: What are the id and price for the good with "70" in its id?
SQL: SELECT id ,  price FROM goods WHERE id LIKE "%70%"
Database: bakery_1
Question: List the last names of all customers in an alphabetical order.
SQL: SELECT DISTINCT LastName FROM customers ORDER BY LastName
Database: bakery_1
Question: What are the last names of the customers in alphabetical order?
SQL: SELECT DISTINCT LastName FROM customers ORDER BY LastName
Database: bakery_1
Question: Return the ordered list of all good ids.
SQL: SELECT DISTINCT id FROM goods ORDER BY id
Database: bakery_1
Question: Order the distinct good ids.
SQL: SELECT DISTINCT id FROM goods ORDER BY id
Database: bakery_1
Question: Find all receipts in which either apple flavor pie was bought or customer id 12 shopped.
SQL: SELECT T1.receipt FROM items AS T1 JOIN goods AS T2 ON T1.item  =  T2.id WHERE T2.flavor  =  "Apple" AND T2.food  =  "Pie" UNION SELECT ReceiptNumber FROM receipts WHERE CustomerId  =  12
Database: bakery_1
Question: What are the receipt numbers for which either an apple flavor pie was purchased or the customer with id 12 shopped?
SQL: SELECT T1.receipt FROM items AS T1 JOIN goods AS T2 ON T1.item  =  T2.id WHERE T2.flavor  =  "Apple" AND T2.food  =  "Pie" UNION SELECT ReceiptNumber FROM receipts WHERE CustomerId  =  12
Database: bakery_1
Question: Find all receipts which has the latest date. Also tell me that date.
SQL: SELECT ReceiptNumber ,  date FROM receipts WHERE date  =  (SELECT date FROM receipts ORDER BY date DESC LIMIT 1)
Database: bakery_1
Question: What is the receipt number with the latest date, and what is that date?
SQL: SELECT ReceiptNumber ,  date FROM receipts WHERE date  =  (SELECT date FROM receipts ORDER BY date DESC LIMIT 1)
Database: bakery_1
Question: Find all receipts which either has the earliest date or has a good with price above 10.
SQL: SELECT T1.Receipt FROM items AS T1 JOIN goods AS T2 ON T1.item  =  T2.id WHERE T2.price  >  10 UNION SELECT ReceiptNumber FROM receipts WHERE date  =  (SELECT date FROM receipts ORDER BY date LIMIT 1)
Database: bakery_1
Question: What are all the receipt numbers that have a good with a price above 10 or have the earliest date?
SQL: SELECT T1.Receipt FROM items AS T1 JOIN goods AS T2 ON T1.item  =  T2.id WHERE T2.price  >  10 UNION SELECT ReceiptNumber FROM receipts WHERE date  =  (SELECT date FROM receipts ORDER BY date LIMIT 1)
Database: bakery_1
Question: What are the ids of Cookie and Cake that cost between 3 and 7 dollars.
SQL: SELECT id FROM goods WHERE food  =  "Cookie" OR food  =  "Cake" AND price BETWEEN 3 AND 7
Database: bakery_1
Question: Give the ids of Cookies or Cakes that cost between 3 and 7 dollars.
SQL: SELECT id FROM goods WHERE food  =  "Cookie" OR food  =  "Cake" AND price BETWEEN 3 AND 7
Database: bakery_1
Question: Find the first name and last name of a customer who visited on the earliest date.
SQL: SELECT T1.FirstName ,  T1.LastName FROM customers AS T1 JOIN receipts AS T2 ON T1.id  =  T2.CustomerId ORDER BY T2.date LIMIT 1
Database: bakery_1
Question: What is the full name of the customer who visited on the earliest date?
SQL: SELECT T1.FirstName ,  T1.LastName FROM customers AS T1 JOIN receipts AS T2 ON T1.id  =  T2.CustomerId ORDER BY T2.date LIMIT 1
Database: bakery_1
Question: What is average price of goods whose flavor is blackberry or blueberry?
SQL: SELECT avg(price) FROM goods WHERE flavor  =  "Blackberry" OR flavor  =  "Blueberry"
Database: bakery_1
Question: What are the average prices of goods with blackberry or blueberry flavor?
SQL: SELECT avg(price) FROM goods WHERE flavor  =  "Blackberry" OR flavor  =  "Blueberry"
Database: bakery_1
Question: Return the cheapest price for goods with cheese flavor.
SQL: SELECT min(price) FROM goods WHERE flavor  =  "Cheese"
Database: bakery_1
Question: What is the cheapest good with cheese flavor?
SQL: SELECT min(price) FROM goods WHERE flavor  =  "Cheese"
Database: bakery_1
Question: What are highest, lowest, and average prices of goods, grouped and ordered by flavor?
SQL: SELECT max(price) ,  min(price) ,  avg(price) ,  flavor FROM goods GROUP BY flavor ORDER BY flavor
Database: bakery_1
Question: What are the maximum, minimum, and average prices of goods of each flavor, ordered by flavor?
SQL: SELECT max(price) ,  min(price) ,  avg(price) ,  flavor FROM goods GROUP BY flavor ORDER BY flavor
Database: bakery_1
Question: Return the lowest and highest prices of goods grouped and ordered by food type.
SQL: SELECT min(price) ,  max(price) ,  food FROM goods GROUP BY food ORDER BY food
Database: bakery_1
Question: What are the minimum and maximum prices of food goods, ordered by food?
SQL: SELECT min(price) ,  max(price) ,  food FROM goods GROUP BY food ORDER BY food
Database: bakery_1
Question: Find the top three dates with the most receipts.
SQL: SELECT date FROM receipts GROUP BY date ORDER BY count(*) DESC LIMIT 3
Database: bakery_1
Question: What are the three dates for which the most receipts were given?
SQL: SELECT date FROM receipts GROUP BY date ORDER BY count(*) DESC LIMIT 3
Database: bakery_1
Question: Which customer shopped most often? How many times?
SQL: SELECT CustomerId ,  count(*) FROM receipts GROUP BY CustomerId ORDER BY count(*) DESC LIMIT 1
Database: bakery_1
Question: Give the customer id of the customer that made the most purchases, as well as the number of purchases made.
SQL: SELECT CustomerId ,  count(*) FROM receipts GROUP BY CustomerId ORDER BY count(*) DESC LIMIT 1
Database: bakery_1
Question: For each date, return how many distinct customers visited on that day.
SQL: SELECT date ,  COUNT (DISTINCT CustomerId) FROM receipts GROUP BY date
Database: bakery_1
Question: How many cusomters visited on each date?
SQL: SELECT date ,  COUNT (DISTINCT CustomerId) FROM receipts GROUP BY date
Database: bakery_1
Question: Give me the first name and last name of customers who have bought apple flavor Tart.
SQL: SELECT DISTINCT T4.FirstName ,  T4.LastName FROM goods AS T1 JOIN items AS T2 ON T1.id  =  T2.item JOIN receipts AS T3 ON T2.receipt  =  T3.ReceiptNumber JOIN customers AS T4 ON T3.CustomerId  =  T4.id WHERE T1.flavor  =  "Apple" AND T1.food  =  "Tart"
Database: bakery_1
Question: What are the full names of customers who bought apple flavored Tarts?
SQL: SELECT DISTINCT T4.FirstName ,  T4.LastName FROM goods AS T1 JOIN items AS T2 ON T1.id  =  T2.item JOIN receipts AS T3 ON T2.receipt  =  T3.ReceiptNumber JOIN customers AS T4 ON T3.CustomerId  =  T4.id WHERE T1.flavor  =  "Apple" AND T1.food  =  "Tart"
Database: bakery_1
Question: What are the ids of Cookies whose price is lower than any Croissant?
SQL: SELECT id FROM goods WHERE food  =  "Cookie" AND price  <  (SELECT min(price) FROM goods WHERE food  =  'Croissant')
Database: bakery_1
Question: Give the ids of cookes that are cheaper than any croissant.
SQL: SELECT id FROM goods WHERE food  =  "Cookie" AND price  <  (SELECT min(price) FROM goods WHERE food  =  'Croissant')
Database: bakery_1
Question: Give me the ids of Cakes whose price is at least as much as the average price of Tart?
SQL: SELECT id FROM goods WHERE food  =  "Cake" AND price  >=  (SELECT avg(price) FROM goods WHERE food  =  "Tart")
Database: bakery_1
Question: What are the ids of cakes that are at least as expensive as the average Tart?
SQL: SELECT id FROM goods WHERE food  =  "Cake" AND price  >=  (SELECT avg(price) FROM goods WHERE food  =  "Tart")
Database: bakery_1
Question: What are the ids of goods whose price is above twice the average price of all goods?
SQL: SELECT id FROM goods WHERE price  >  (SELECT avg(price) FROM goods)
Database: bakery_1
Question: Give the ids of goods that are more than twice as expensive as the average good.
SQL: SELECT id FROM goods WHERE price  >  (SELECT avg(price) FROM goods)
Database: bakery_1
Question: List the id, flavor and type of food of goods ordered by price.
SQL: SELECT id ,  flavor ,  food FROM goods ORDER BY price
Database: bakery_1
Question: What are the ids, flavors, and food types of goods, ordered by price?
SQL: SELECT id ,  flavor ,  food FROM goods ORDER BY price
Database: bakery_1
Question: Return a list of the id and flavor for Cakes ordered by flavor.
SQL: SELECT id ,  flavor FROM goods WHERE food  =  "Cake" ORDER BY flavor
Database: bakery_1
Question: What are the ids and flavors of cakes, ordered by flavor?
SQL: SELECT id ,  flavor FROM goods WHERE food  =  "Cake" ORDER BY flavor
Database: bakery_1
Question: Find all the items that have chocolate flavor but were not bought more than 10 times.
SQL: SELECT DISTINCT T1.item FROM items AS T1 JOIN goods AS T2 ON T1.item  =  T2.id WHERE T2.flavor  =  "Chocolate" GROUP BY item HAVING count(*)  <=  10
Database: bakery_1
Question: What are the items with chocolate flavor that were purchased at most 10 times.
SQL: SELECT DISTINCT T1.item FROM items AS T1 JOIN goods AS T2 ON T1.item  =  T2.id WHERE T2.flavor  =  "Chocolate" GROUP BY item HAVING count(*)  <=  10
Database: bakery_1
Question: What are the flavors available for Cake but not for Tart?
SQL: SELECT DISTINCT flavor FROM goods WHERE food  =  "Cake" EXCEPT SELECT DISTINCT flavor FROM goods WHERE food  =  "Tart"
Database: bakery_1
Question: Give the flavors of Cakes that are not available for Tart.
SQL: SELECT DISTINCT flavor FROM goods WHERE food  =  "Cake" EXCEPT SELECT DISTINCT flavor FROM goods WHERE food  =  "Tart"
Database: bakery_1
Question: What is the three most popular goods in this bakery?
SQL: SELECT item FROM items GROUP BY item ORDER BY COUNT (*) DESC LIMIT 3
Database: bakery_1
Question: Give the three most purchased items at this bakery.
SQL: SELECT item FROM items GROUP BY item ORDER BY COUNT (*) DESC LIMIT 3
Database: bakery_1
Question: Find the ids of customers who have spent more than 150 dollars in total.
SQL: SELECT T3.CustomerId FROM goods AS T1 JOIN items AS T2 ON T1.id  =  T2.item JOIN receipts AS T3 ON T2.receipt  =  T3.ReceiptNumber GROUP BY T3.CustomerId HAVING sum(T1.price)  >  150
Database: bakery_1
Question: What are the ids of customers who have spent over 150 dollars in total?
SQL: SELECT T3.CustomerId FROM goods AS T1 JOIN items AS T2 ON T1.id  =  T2.item JOIN receipts AS T3 ON T2.receipt  =  T3.ReceiptNumber GROUP BY T3.CustomerId HAVING sum(T1.price)  >  150
Database: bakery_1
Question: Find the ids of customers whose average spending for each good is above 5.
SQL: SELECT T3.CustomerId FROM goods AS T1 JOIN items AS T2 ON T1.id  =  T2.item JOIN receipts AS T3 ON T2.receipt  =  T3.ReceiptNumber GROUP BY T3.CustomerId HAVING avg(T1.price)  >  5
Database: bakery_1
Question: What are the ids of customers who spend more than 5 on average for each good?
SQL: SELECT T3.CustomerId FROM goods AS T1 JOIN items AS T2 ON T1.id  =  T2.item JOIN receipts AS T3 ON T2.receipt  =  T3.ReceiptNumber GROUP BY T3.CustomerId HAVING avg(T1.price)  >  5
Database: bakery_1
Question: On which day did the bakery sell more than 100 dollars in total.
SQL: SELECT T3.date FROM goods AS T1 JOIN items AS T2 ON T1.id  =  T2.item JOIN receipts AS T3 ON T2.receipt  =  T3.ReceiptNumber GROUP BY T3.date HAVING sum(T1.price)  >  100
Database: bakery_1
Question: On what dates did the bakery sell more than 100 dollars worth of goods in total?
SQL: SELECT T3.date FROM goods AS T1 JOIN items AS T2 ON T1.id  =  T2.item JOIN receipts AS T3 ON T2.receipt  =  T3.ReceiptNumber GROUP BY T3.date HAVING sum(T1.price)  >  100
Database: car_racing
Question: How many drivers are there?
SQL: SELECT count(*) FROM driver
Database: car_racing
Question: Find the total number of drivers.
SQL: SELECT count(*) FROM driver
Database: car_racing
Question: Find the number of drivers whose points are greater than 150 for each make.
SQL: SELECT make ,  count(*) FROM driver WHERE points  >  150 GROUP BY make
Database: car_racing
Question: How many drivers receive points greater than 150 for each make? Show the make and the count.
SQL: SELECT make ,  count(*) FROM driver WHERE points  >  150 GROUP BY make
Database: car_racing
Question: Find the average age of drivers for each make.
SQL: SELECT avg(age) ,  Make FROM driver GROUP BY make
Database: car_racing
Question: What is the average age of drivers for each make? Return the average age and make.
SQL: SELECT avg(age) ,  Make FROM driver GROUP BY make
Database: car_racing
Question: What are the average laps of all the drivers who are younger than 20?
SQL: SELECT avg(Laps) FROM driver WHERE age  <  20
Database: car_racing
Question: Compute the average laps of drivers under the age of 20.
SQL: SELECT avg(Laps) FROM driver WHERE age  <  20
Database: car_racing
Question: What are the managers and sponsors of teams? Sort the results by Car Owners.
SQL: SELECT Manager ,  Sponsor FROM team ORDER BY Car_Owner
Database: car_racing
Question: Find the manager and sponsor for each team and order them by the car owner.
SQL: SELECT Manager ,  Sponsor FROM team ORDER BY Car_Owner
Database: car_racing
Question: Find the make that has more than one team.
SQL: SELECT make FROM team GROUP BY team HAVING count(*)  >  1
Database: car_racing
Question: Which make has more than one team?
SQL: SELECT make FROM team GROUP BY team HAVING count(*)  >  1
Database: car_racing
Question: What are the makes of the teams with car owner "Buddy Arrington"?
SQL: SELECT Make FROM team WHERE Car_Owner  =  "Buddy Arrington"
Database: car_racing
Question: Find the make of the team whose car owner is "Buddy Arrington".
SQL: SELECT Make FROM team WHERE Car_Owner  =  "Buddy Arrington"
Database: car_racing
Question: What are the maximum and minimum points of drivers.
SQL: SELECT max(Points) ,  min(Points) FROM driver
Database: car_racing
Question: Find the highest and lowest points of drivers.
SQL: SELECT max(Points) ,  min(Points) FROM driver
Database: car_racing
Question: How many drivers have points smaller than 150?
SQL: SELECT count(*) FROM driver WHERE Points  <  150
Database: car_racing
Question: Count the number of drivers whose points are below 150.
SQL: SELECT count(*) FROM driver WHERE Points  <  150
Database: car_racing
Question: List all the driver names in ascending order of age.
SQL: SELECT Driver FROM driver ORDER BY Age ASC
Database: car_racing
Question: Sort the driver names by age in ascending order.
SQL: SELECT Driver FROM driver ORDER BY Age ASC
Database: car_racing
Question: List all the driver names in descending order of points.
SQL: SELECT Driver FROM driver ORDER BY Points DESC
Database: car_racing
Question: What is the list of drivers ordered by points in descending order?
SQL: SELECT Driver FROM driver ORDER BY Points DESC
Database: car_racing
Question: Please show the names of drivers, and countries they are from.
SQL: SELECT T2.Driver ,  T1.Country FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID  =  T2.Country
Database: car_racing
Question: For each driver, return his or her name and country.
SQL: SELECT T2.Driver ,  T1.Country FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID  =  T2.Country
Database: car_racing
Question: Show the maximum points of the drivers from countries with capital "Dublin"
SQL: SELECT max(T2.Points) FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID  =  T2.Country WHERE T1.Capital  =  "Dublin"
Database: car_racing
Question: What is the maximum points of the drivers from a country whose capital is "Dublin"?
SQL: SELECT max(T2.Points) FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID  =  T2.Country WHERE T1.Capital  =  "Dublin"
Database: car_racing
Question: What is the average age of drivers from countries with official native language "English"
SQL: SELECT avg(T2.age) FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID  =  T2.Country WHERE T1.Official_native_language  =  "English"
Database: car_racing
Question: Find the average age of the drivers from the countries that use "English" as official native language.
SQL: SELECT avg(T2.age) FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID  =  T2.Country WHERE T1.Official_native_language  =  "English"
Database: car_racing
Question: What are the countries that have drivers with points larger than 150?
SQL: SELECT T1.Country FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID  =  T2.Country WHERE T2.Points  >  150
Database: car_racing
Question: Find all the countries where some drivers have points above 150.
SQL: SELECT T1.Country FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID  =  T2.Country WHERE T2.Points  >  150
Database: car_racing
Question: What is the capital of the country where the driver with the most points is from?
SQL: SELECT T1.Capital FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID  =  T2.Country ORDER BY T2.Points DESC LIMIT 1
Database: car_racing
Question: Which country is the driver with the highest points from? Give me the capital of the country.
SQL: SELECT T1.Capital FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID  =  T2.Country ORDER BY T2.Points DESC LIMIT 1
Database: car_racing
Question: List each make with the number of drivers with that make.
SQL: SELECT Make ,  COUNT(*) FROM driver GROUP BY Make
Database: car_racing
Question: For each make, return the make and the count of drivers with that make.
SQL: SELECT Make ,  COUNT(*) FROM driver GROUP BY Make
Database: car_racing
Question: List the make that are associated with most drivers.
SQL: SELECT Make FROM driver GROUP BY Make ORDER BY COUNT(*) DESC LIMIT 1
Database: car_racing
Question: Which make does the most drivers have?
SQL: SELECT Make FROM driver GROUP BY Make ORDER BY COUNT(*) DESC LIMIT 1
Database: car_racing
Question: List the driver makes that are associated with at least three drivers.
SQL: SELECT Make FROM driver GROUP BY Make HAVING COUNT(*)  >=  3
Database: car_racing
Question: Which make is associated with 3 or more drivers?
SQL: SELECT Make FROM driver GROUP BY Make HAVING COUNT(*)  >=  3
Database: car_racing
Question: List the names of teams that do not have any drivers.
SQL: SELECT Team FROM team WHERE Team_ID NOT IN (SELECT Team_ID FROM team_driver)
Database: car_racing
Question: Which team does not have drivers?
SQL: SELECT Team FROM team WHERE Team_ID NOT IN (SELECT Team_ID FROM team_driver)
Database: car_racing
Question: Which country has both drivers with make "Dodge" and drivers with make "Chevrolet"?
SQL: SELECT t2.country FROM driver AS t1 JOIN country AS t2 ON t1.country  =  t2.country_id WHERE t1.Make  =  "Dodge" INTERSECT SELECT t2.country FROM driver AS t1 JOIN country AS t2 ON t1.country  =  t2.country_id WHERE t1.Make  =  "Chevrolet"
Database: car_racing
Question: Find the countries in which there are both drivers with make "Dodge" and drivers with make "Chevrolet".
SQL: SELECT t2.country FROM driver AS t1 JOIN country AS t2 ON t1.country  =  t2.country_id WHERE t1.Make  =  "Dodge" INTERSECT SELECT t2.country FROM driver AS t1 JOIN country AS t2 ON t1.country  =  t2.country_id WHERE t1.Make  =  "Chevrolet"
Database: car_racing
Question: Show total and average points of all drivers.
SQL: SELECT sum(Points) ,  avg(Points) FROM driver
Database: car_racing
Question: What are the total and average points of drivers?
SQL: SELECT sum(Points) ,  avg(Points) FROM driver
Database: car_racing
Question: Find the countries where no driver come from.
SQL: SELECT country FROM country WHERE country_id NOT IN (SELECT country FROM driver)
Database: car_racing
Question: Which countries do not have any drivers?
SQL: SELECT country FROM country WHERE country_id NOT IN (SELECT country FROM driver)
Database: car_racing
Question: What are the manager and sponsor of the team that has the most drivers?
SQL: SELECT t1.manager ,  t1.sponsor FROM team AS t1 JOIN team_driver AS t2 ON t1.team_id  =  t2.team_id GROUP BY t2.team_id ORDER BY count(*) DESC LIMIT 1
Database: car_racing
Question: Find the manager and sponsor of the team that has the most drivers.
SQL: SELECT t1.manager ,  t1.sponsor FROM team AS t1 JOIN team_driver AS t2 ON t1.team_id  =  t2.team_id GROUP BY t2.team_id ORDER BY count(*) DESC LIMIT 1
Database: car_racing
Question: What are the manager and car owner of the team that has at least 2 drivers?
SQL: SELECT t1.manager ,  t1.car_owner FROM team AS t1 JOIN team_driver AS t2 ON t1.team_id  =  t2.team_id GROUP BY t2.team_id HAVING count(*)  >=  2
Database: car_racing
Question: Find the team with two or more drivers and return the the manager and car owner of the team.
SQL: SELECT t1.manager ,  t1.car_owner FROM team AS t1 JOIN team_driver AS t2 ON t1.team_id  =  t2.team_id GROUP BY t2.team_id HAVING count(*)  >=  2
Database: institution_sports
Question: How many institutions are there?
SQL: SELECT count(*) FROM institution
Database: institution_sports
Question: Count the number of institutions.
SQL: SELECT count(*) FROM institution
Database: institution_sports
Question: List the names of institutions in ascending alphabetical order.
SQL: SELECT Name FROM institution ORDER BY Name ASC
Database: institution_sports
Question: What are the names of institutions, ordered alphabetically?
SQL: SELECT Name FROM institution ORDER BY Name ASC
Database: institution_sports
Question: List the names of institutions in ascending order of founded year.
SQL: SELECT Name FROM institution ORDER BY Founded ASC
Database: institution_sports
Question: What are the names of institutions, ordered by the years in which they were founded?
SQL: SELECT Name FROM institution ORDER BY Founded ASC
Database: institution_sports
Question: What are the cities and provinces of institutions?
SQL: SELECT City ,  Province FROM institution
Database: institution_sports
Question: Return the cities and provinces of institutions.
SQL: SELECT City ,  Province FROM institution
Database: institution_sports
Question: What are the maximum and minimum enrollment of all institutions?
SQL: SELECT max(Enrollment) ,  min(Enrollment) FROM institution
Database: institution_sports
Question: Return the maximum and minimum enrollment across all institutions.
SQL: SELECT max(Enrollment) ,  min(Enrollment) FROM institution
Database: institution_sports
Question: What are the affiliations of institutions that are not in city "Vancouver"?
SQL: SELECT Affiliation FROM institution WHERE City != "Vancouver"
Database: institution_sports
Question: Return the affiliations of instituions that are not in the city of Vancouver.
SQL: SELECT Affiliation FROM institution WHERE City != "Vancouver"
Database: institution_sports
Question: What are the stadiums of institutions in descending order of the capacity.
SQL: SELECT Stadium FROM institution ORDER BY Capacity DESC
Database: institution_sports
Question: Return the stadiums of institutions, ordered by capacity descending.
SQL: SELECT Stadium FROM institution ORDER BY Capacity DESC
Database: institution_sports
Question: What is the stadium of the institution with the largest enrollment?
SQL: SELECT Stadium FROM institution ORDER BY Enrollment DESC LIMIT 1
Database: institution_sports
Question: Give the stadium of the institution which is the greatest enrollment.
SQL: SELECT Stadium FROM institution ORDER BY Enrollment DESC LIMIT 1
Database: institution_sports
Question: What are the names and nicknames of institutions?
SQL: SELECT T2.Name ,  T1.Nickname FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID  =  T2.Institution_ID
Database: institution_sports
Question: Return the names of institutions, as well as their nicknames.
SQL: SELECT T2.Name ,  T1.Nickname FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID  =  T2.Institution_ID
Database: institution_sports
Question: What is the nickname of the institution with the smallest enrollment?
SQL: SELECT T1.Nickname FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID  =  T2.Institution_ID ORDER BY T2.Enrollment ASC LIMIT 1
Database: institution_sports
Question: Return the nickname of the institution with the lowest enrollment.
SQL: SELECT T1.Nickname FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID  =  T2.Institution_ID ORDER BY T2.Enrollment ASC LIMIT 1
Database: institution_sports
Question: List the names of institutions in descending order of the number of championships.
SQL: SELECT T2.Name FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID  =  T2.Institution_ID ORDER BY T1.Number_of_Championships DESC
Database: institution_sports
Question: What are the names of institutions, ordered descending by their number of championships?
SQL: SELECT T2.Name FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID  =  T2.Institution_ID ORDER BY T1.Number_of_Championships DESC
Database: institution_sports
Question: List the names of institutions with at least one championship.
SQL: SELECT T2.Name FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID  =  T2.Institution_ID WHERE T1.Number_of_Championships  >=  1
Database: institution_sports
Question: What are the names of institutions that have 1 or more championships?
SQL: SELECT T2.Name FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID  =  T2.Institution_ID WHERE T1.Number_of_Championships  >=  1
Database: institution_sports
Question: What is the total number of championship of institution with public affiliation?
SQL: SELECT sum(T1.Number_of_Championships) FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID  =  T2.Institution_ID WHERE T2.Affiliation  =  "Public"
Database: institution_sports
Question: Return the total number of championships of institutions that have a Public affiliation.
SQL: SELECT sum(T1.Number_of_Championships) FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID  =  T2.Institution_ID WHERE T2.Affiliation  =  "Public"
Database: institution_sports
Question: What are different types of affiliations of institutions and the corresponding number of institutions?
SQL: SELECT Affiliation ,  COUNT(*) FROM institution GROUP BY Affiliation
Database: institution_sports
Question: How many institutions are there for each type of affiliation?
SQL: SELECT Affiliation ,  COUNT(*) FROM institution GROUP BY Affiliation
Database: institution_sports
Question: What is the most common type of affiliation for institutions?
SQL: SELECT Affiliation FROM institution GROUP BY Affiliation ORDER BY COUNT(*) DESC LIMIT 1
Database: institution_sports
Question: Return the most common type of affiliation across all institutions.
SQL: SELECT Affiliation FROM institution GROUP BY Affiliation ORDER BY COUNT(*) DESC LIMIT 1
Database: institution_sports
Question: In which years were more than one institution founded?
SQL: SELECT Founded ,  COUNT(*) FROM institution GROUP BY Founded HAVING COUNT(*)  >  1
Database: institution_sports
Question: Return the years in which more than 1 institution was founded, as well as the number of institutions founded in each of those.
SQL: SELECT Founded ,  COUNT(*) FROM institution GROUP BY Founded HAVING COUNT(*)  >  1
Database: institution_sports
Question: List the nicknames of institutions in descending order of capacity.
SQL: SELECT T1.Nickname FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID  =  T2.Institution_ID ORDER BY T2.Capacity DESC
Database: institution_sports
Question: What are the nicknames of institutions, ordered descending by their capacities?
SQL: SELECT T1.Nickname FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID  =  T2.Institution_ID ORDER BY T2.Capacity DESC
Database: institution_sports
Question: What are the total enrollment of institutions in city `` Vancouver '' or `` Calgary '' ?
SQL: select sum(enrollment) from institution where city  =  "vancouver" or city  =  "calgary"
Database: institution_sports
Question: Return all the enrollments of institutions in either the city of Vancouver or the city of Calgary .
SQL: select sum(enrollment) from institution where city  =  "vancouver" or city  =  "calgary"
Database: institution_sports
Question: Show the provinces that have both institutions founded before 1920 and institutions founded after 1950.
SQL: SELECT Province FROM institution WHERE Founded  <  1920 INTERSECT SELECT Province FROM institution WHERE Founded  >  1950
Database: institution_sports
Question: What are the provinces that have not only institutions founded before 1920, but also institutions founded after 1950?
SQL: SELECT Province FROM institution WHERE Founded  <  1920 INTERSECT SELECT Province FROM institution WHERE Founded  >  1950
Database: institution_sports
Question: How many distinct provinces are the institutions in?
SQL: SELECT count(DISTINCT Province) FROM institution
Database: institution_sports
Question: Count the number of different provinces that have institutions.
SQL: SELECT count(DISTINCT Province) FROM institution
Database: warehouse_1
Question: Select all details of all warehouses.
SQL: SELECT * FROM warehouses
Database: warehouse_1
Question: What is all the information about the warehouses?
SQL: SELECT * FROM warehouses
Database: warehouse_1
Question: Find all different contents stored in New York.
SQL: SELECT DISTINCT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE LOCATION  =  'New York'
Database: warehouse_1
Question: What are all the different contents stored in boxes in New York?
SQL: SELECT DISTINCT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE LOCATION  =  'New York'
Database: warehouse_1
Question: Select contents of all boxes with a value larger than $150.
SQL: SELECT CONTENTS FROM boxes WHERE Value  >  150
Database: warehouse_1
Question: What are the contents of boxes with value greater than 150?
SQL: SELECT CONTENTS FROM boxes WHERE Value  >  150
Database: warehouse_1
Question: Select the warehouse code and the average value of the boxes in each warehouse.
SQL: SELECT warehouse ,  avg(value) FROM boxes GROUP BY warehouse
Database: warehouse_1
Question: What is the average value of boxes for each warehouse?
SQL: SELECT warehouse ,  avg(value) FROM boxes GROUP BY warehouse
Database: warehouse_1
Question: Find the average and total values of all boxes.
SQL: SELECT avg(value) ,  sum(value) FROM boxes
Database: warehouse_1
Question: What are the average and total values across all boxes?
SQL: SELECT avg(value) ,  sum(value) FROM boxes
Database: warehouse_1
Question: Find the average and total capacity of all warehouses.
SQL: SELECT avg(capacity) ,  sum(capacity) FROM warehouses
Database: warehouse_1
Question: What are the average and total capacities across all warehouses?
SQL: SELECT avg(capacity) ,  sum(capacity) FROM warehouses
Database: warehouse_1
Question: Find the average and maximum value for each different content.
SQL: SELECT avg(value) ,  max(value) ,  CONTENTS FROM boxes GROUP BY CONTENTS
Database: warehouse_1
Question: What are the average and maximum values for each type of content in boxes?
SQL: SELECT avg(value) ,  max(value) ,  CONTENTS FROM boxes GROUP BY CONTENTS
Database: warehouse_1
Question: Find the content that has the highest total values in all boxes.
SQL: SELECT CONTENTS FROM boxes ORDER BY value DESC LIMIT 1
Database: warehouse_1
Question: What is the content with the greatest value across all boxes?
SQL: SELECT CONTENTS FROM boxes ORDER BY value DESC LIMIT 1
Database: warehouse_1
Question: Select the average value of all the boxes.
SQL: SELECT avg(value) FROM boxes
Database: warehouse_1
Question: What is the average value of boxes?
SQL: SELECT avg(value) FROM boxes
Database: warehouse_1
Question: Select all distinct contents in all the boxes.
SQL: SELECT DISTINCT CONTENTS FROM boxes
Database: warehouse_1
Question: What are the different contents in boxes?
SQL: SELECT DISTINCT CONTENTS FROM boxes
Database: warehouse_1
Question: Find the number of all distinct contents in all the boxes.
SQL: SELECT count(DISTINCT CONTENTS) FROM boxes
Database: warehouse_1
Question: How many different contents are stored in boxes?
SQL: SELECT count(DISTINCT CONTENTS) FROM boxes
Database: warehouse_1
Question: Find all distinct locations of warehouses.
SQL: SELECT count(DISTINCT LOCATION) FROM warehouses
Database: warehouse_1
Question: What are the different locations of warehouses?
SQL: SELECT count(DISTINCT LOCATION) FROM warehouses
Database: warehouse_1
Question: Find the code of boxes that are stored at the warehouses located at Chicago or New York.
SQL: SELECT T1.code FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location  =  'Chicago' OR T2.location  =  'New York'
Database: warehouse_1
Question: What are the codes of boxes stored in warehouses in either Chicago or New York?
SQL: SELECT T1.code FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location  =  'Chicago' OR T2.location  =  'New York'
Database: warehouse_1
Question: Find the total value of boxes in the warehouses located at Chicago or New York.
SQL: SELECT sum(T1.value) FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location  =  'Chicago' OR T2.location  =  'New York'
Database: warehouse_1
Question: What is the total value of boxes located in Chicago or New York?
SQL: SELECT sum(T1.value) FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location  =  'Chicago' OR T2.location  =  'New York'
Database: warehouse_1
Question: Find all contents present in warehouses located in Chicago and those located in New York.
SQL: SELECT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location  =  'Chicago' INTERSECT SELECT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location  =  'New York'
Database: warehouse_1
Question: Find the contents that are stored in both Chicago and New York.
SQL: SELECT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location  =  'Chicago' INTERSECT SELECT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location  =  'New York'
Database: warehouse_1
Question: Find the type of contents that are not in the warehouses located at New York.
SQL: SELECT CONTENTS FROM boxes EXCEPT SELECT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location  =  'New York'
Database: warehouse_1
Question: What types of contents cannot be found in warehouses in New York?
SQL: SELECT CONTENTS FROM boxes EXCEPT SELECT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location  =  'New York'
Database: warehouse_1
Question: Find the location of the warehouses which have contents Rocks but not Scissors.
SQL: SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T1.contents  =  'Rocks' EXCEPT SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T1.contents  =  'Scissors'
Database: warehouse_1
Question: What are the locations of warehouses that have boxes containing Rocks but not Scissors?
SQL: SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T1.contents  =  'Rocks' EXCEPT SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T1.contents  =  'Scissors'
Database: warehouse_1
Question: Find the warehouses which store contents Rocks or Scissors.
SQL: SELECT DISTINCT warehouse FROM boxes WHERE CONTENTS  =  'Rocks' OR CONTENTS  =  'Scissors'
Database: warehouse_1
Question: What are the distinct warehouses that have boxes with Rocks or Scissors as contents?
SQL: SELECT DISTINCT warehouse FROM boxes WHERE CONTENTS  =  'Rocks' OR CONTENTS  =  'Scissors'
Database: warehouse_1
Question: Find the location of the warehouses which store contents Rocks and Scissors.
SQL: SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T1.contents  =  'Rocks' INTERSECT SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T1.contents  =  'Scissors'
Database: warehouse_1
Question: What are the locations of warehouses in which boxes that contain Rocks and Scissors are kept?
SQL: SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T1.contents  =  'Rocks' INTERSECT SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T1.contents  =  'Scissors'
Database: warehouse_1
Question: List the code and contents of all boxes sorted by their values.
SQL: SELECT code ,  CONTENTS FROM boxes ORDER BY value
Database: warehouse_1
Question: What are the codes and corresponding contents of all the boxes, ordered by their values?
SQL: SELECT code ,  CONTENTS FROM boxes ORDER BY value
Database: warehouse_1
Question: Find the code and contents of the box with the lowest value.
SQL: SELECT code ,  CONTENTS FROM boxes ORDER BY value LIMIT 1
Database: warehouse_1
Question: What is the code and contents for the box that has the smallest value?
SQL: SELECT code ,  CONTENTS FROM boxes ORDER BY value LIMIT 1
Database: warehouse_1
Question: Find the unique contents of all boxes whose value is higher than the average value of all boxes.
SQL: SELECT DISTINCT CONTENTS FROM boxes WHERE value  >  (SELECT avg(value) FROM boxes)
Database: warehouse_1
Question: What are the different contents of boxes for which the value is higher than the average value across all boxes?
SQL: SELECT DISTINCT CONTENTS FROM boxes WHERE value  >  (SELECT avg(value) FROM boxes)
Database: warehouse_1
Question: List all different types of contents ordered by contents.
SQL: SELECT DISTINCT CONTENTS FROM boxes ORDER BY CONTENTS
Database: warehouse_1
Question: What are the different contents of boxes, ordered alphabetically?
SQL: SELECT DISTINCT CONTENTS FROM boxes ORDER BY CONTENTS
Database: warehouse_1
Question: Find the code of all boxes whose value is higher than the value of any boxes with Rocks as content.
SQL: SELECT code FROM boxes WHERE value  >  (SELECT min(value) FROM boxes WHERE CONTENTS  =  'Rocks')
Database: warehouse_1
Question: What are the codes of boxes for which the value is greater than the value of any box that contains Rocks?
SQL: SELECT code FROM boxes WHERE value  >  (SELECT min(value) FROM boxes WHERE CONTENTS  =  'Rocks')
Database: warehouse_1
Question: Find the code and content of all boxes whose value is higher than the value of all boxes with Scissors as content.
SQL: SELECT code ,  CONTENTS FROM boxes WHERE value  >  (SELECT max(value) FROM boxes WHERE CONTENTS  =  'Scissors')
Database: warehouse_1
Question: What are the codes and corresponding contents of boxes for which their value is higher than the values of all boxes containing Scissors?
SQL: SELECT code ,  CONTENTS FROM boxes WHERE value  >  (SELECT max(value) FROM boxes WHERE CONTENTS  =  'Scissors')
Database: warehouse_1
Question: Find the total value of boxes stored in the warehouse with the largest capacity.
SQL: SELECT sum(T1.value) FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code ORDER BY T2.capacity DESC LIMIT 1
Database: warehouse_1
Question: What is the total value of boxes kept in the warehouse with the greatest capacity?
SQL: SELECT sum(T1.value) FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code ORDER BY T2.capacity DESC LIMIT 1
Database: warehouse_1
Question: Select the warehouse code and the average value of the boxes only for those warehouses where the average value of the boxes is greater than 150.
SQL: SELECT warehouse ,  avg(value) FROM boxes GROUP BY warehouse HAVING avg(value)  >  150
Database: warehouse_1
Question: What are the average values of boxes for each warehouse than has an average value greater than 150?
SQL: SELECT warehouse ,  avg(value) FROM boxes GROUP BY warehouse HAVING avg(value)  >  150
Database: warehouse_1
Question: Find the total value and number of boxes for each content type.
SQL: SELECT sum(value) ,  count(*) ,  CONTENTS FROM boxes GROUP BY CONTENTS
Database: warehouse_1
Question: For each content, what is the total value and number of boxes?
SQL: SELECT sum(value) ,  count(*) ,  CONTENTS FROM boxes GROUP BY CONTENTS
Database: warehouse_1
Question: Find the total, average, and maximum capacity for different locations.
SQL: SELECT sum(capacity) ,  avg(capacity) ,  max(capacity) ,  LOCATION FROM warehouses GROUP BY LOCATION
Database: warehouse_1
Question: For each location, what are the total, average, and maximum capacities of warehouses?
SQL: SELECT sum(capacity) ,  avg(capacity) ,  max(capacity) ,  LOCATION FROM warehouses GROUP BY LOCATION
Database: warehouse_1
Question: Find the total capacity of all warehouse locations.
SQL: SELECT sum(capacity) FROM warehouses