Question:
List the names and phone numbers of all the distinct suppliers who supply red jeans.
Additional table information: table: department_store

Answer: SELECT DISTINCT T1.supplier_name, T1.supplier_phone FROM suppliers AS T1 JOIN product_suppliers AS T2 ON T1.supplier_id = T2.supplier_id JOIN products AS T3 ON T2.product_id = T3.product_id WHERE T3.product_name = 'red jeans'


Question:
What are the distinct names and phone numbers for suppliers who have red jeans?
Additional table information: table: department_store

Answer: SELECT DISTINCT T1.supplier_name, T1.supplier_phone FROM suppliers AS T1 JOIN product_suppliers AS T2 ON T1.supplier_id = T2.supplier_id JOIN products AS T3 ON T2.product_id = T3.product_id WHERE T3.product_name = 'red jeans'


Question:
What are the highest and lowest prices of products, grouped by and alphabetically ordered by product type?
Additional table information: table: department_store

Answer: SELECT MAX(product_price), MIN(product_price), product_type_code FROM products GROUP BY product_type_code ORDER BY product_type_code NULLS FIRST


Question:
Give the maximum and minimum product prices for each product type, grouped and ordered by product type.
Additional table information: table: department_store

Answer: SELECT MAX(product_price), MIN(product_price), product_type_code FROM products GROUP BY product_type_code ORDER BY product_type_code NULLS FIRST


Question:
List the order id, customer id for orders in Cancelled status, ordered by their order dates.
Additional table information: table: department_store

Answer: SELECT order_id, customer_id FROM customer_orders WHERE order_status_code = 'Cancelled' ORDER BY order_date NULLS FIRST


Question:
What are the order ids and customer ids for orders that have been Cancelled, sorted by their order dates?
Additional table information: table: department_store

Answer: SELECT order_id, customer_id FROM customer_orders WHERE order_status_code = 'Cancelled' ORDER BY order_date NULLS FIRST


Question:
Find the names of products that were bought by at least two distinct customers.
Additional table information: table: department_store

Answer: SELECT DISTINCT T3.product_name FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id JOIN products AS T3 ON T2.product_id = T3.product_id GROUP BY T3.product_id HAVING COUNT(DISTINCT T1.customer_id) >= 2


Question:
What are the distinct names of products purchased by at least two different customers?
Additional table information: table: department_store

Answer: SELECT DISTINCT T3.product_name FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id JOIN products AS T3 ON T2.product_id = T3.product_id GROUP BY T3.product_id HAVING COUNT(DISTINCT T1.customer_id) >= 2


Question:
Find the names of customers who have bought by at least three distinct products.
Additional table information: table: department_store

Answer: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id GROUP BY T1.customer_id HAVING COUNT(DISTINCT T3.product_id) >= 3


Question:
What are the distinct names of customers who have purchased at least three different products?
Additional table information: table: department_store

Answer: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id GROUP BY T1.customer_id HAVING COUNT(DISTINCT T3.product_id) >= 3


Question:
Find the name and gender of the staff who has been assigned the job of Sales Person but never Clerical Staff.
Additional table information: table: department_store

Answer: SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = 'Sales Person' EXCEPT SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = 'Clerical Staff'


Question:
What are the names and genders of staff who have held the title Sales Person, but never Clerical Staff?
Additional table information: table: department_store

Answer: SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = 'Sales Person' EXCEPT SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = 'Clerical Staff'


Question:
Find the id and name of customers whose address contains WY state and do not use credit card for payment.
Additional table information: table: department_store

Answer: SELECT customer_id, customer_name FROM customers WHERE customer_address LIKE '%WY%' AND payment_method_code <> 'Credit Card'


Question:
What are the ids and names of customers with addressed that contain WY and who do not use a credit card for payment?
Additional table information: table: department_store

Answer: SELECT customer_id, customer_name FROM customers WHERE customer_address LIKE '%WY%' AND payment_method_code <> 'Credit Card'


Question:
Find the average price of all product clothes.
Additional table information: table: department_store

Answer: SELECT AVG(product_price) FROM products WHERE product_type_code = 'Clothes'


Question:
What is the average price of clothes?
Additional table information: table: department_store

Answer: SELECT AVG(product_price) FROM products WHERE product_type_code = 'Clothes'


Question:
Find the name of the most expensive hardware product.
Additional table information: table: department_store

Answer: SELECT product_name FROM products WHERE product_type_code = 'Hardware' ORDER BY product_price DESC LIMIT 1


Question:
What is the name of the hardware product with the greatest price?
Additional table information: table: department_store

Answer: SELECT product_name FROM products WHERE product_type_code = 'Hardware' ORDER BY product_price DESC LIMIT 1


Question:
How many aircrafts are there?
Additional table information: table: aircraft

Answer: SELECT COUNT(*) FROM aircraft


Question:
What is the number of aircraft?
Additional table information: table: aircraft

Answer: SELECT COUNT(*) FROM aircraft


Question:
List the description of all aircrafts.
Additional table information: table: aircraft

Answer: SELECT Description FROM aircraft


Question:
What are the descriptions for the aircrafts?
Additional table information: table: aircraft

Answer: SELECT Description FROM aircraft


Question:
What is the average number of international passengers of all airports?
Additional table information: table: aircraft

Answer: SELECT AVG(International_Passengers) FROM airport


Question:
What is the average number of international passengers for an airport?
Additional table information: table: aircraft

Answer: SELECT AVG(International_Passengers) FROM airport


Question:
What are the number of international and domestic passengers of the airport named London 'Heathrow'?
Additional table information: table: aircraft

Answer: SELECT International_Passengers, Domestic_Passengers FROM airport WHERE Airport_Name = 'London Heathrow'


Question:
How many international and domestic passengers are there in the airport London Heathrow?
Additional table information: table: aircraft

Answer: SELECT International_Passengers, Domestic_Passengers FROM airport WHERE Airport_Name = 'London Heathrow'


Question:
What are the total number of Domestic Passengers of airports that contain the word 'London'.
Additional table information: table: aircraft

Answer: SELECT SUM(Domestic_Passengers) FROM airport WHERE Airport_Name LIKE '%London%'


Question:
What are the total number of domestic passengers at all London airports?
Additional table information: table: aircraft

Answer: SELECT SUM(Domestic_Passengers) FROM airport WHERE Airport_Name LIKE '%London%'


Question:
What are the maximum and minimum number of transit passengers of all aiports.
Additional table information: table: aircraft

Answer: SELECT MAX(Transit_Passengers), MIN(Transit_Passengers) FROM airport


Question:
What is the maximum and mininum number of transit passengers for all airports?
Additional table information: table: aircraft

Answer: SELECT MAX(Transit_Passengers), MIN(Transit_Passengers) FROM airport


Question:
What are the name of pilots aged 25 or older?
Additional table information: table: aircraft

Answer: SELECT Name FROM pilot WHERE Age >= 25


Question:
what is the name of every pilot who is at least 25 years old?
Additional table information: table: aircraft

Answer: SELECT Name FROM pilot WHERE Age >= 25


Question:
List all pilot names in ascending alphabetical order.
Additional table information: table: aircraft

Answer: SELECT Name FROM pilot ORDER BY Name ASC NULLS FIRST


Question:
What are the names of the pilots in alphabetical order?
Additional table information: table: aircraft

Answer: SELECT Name FROM pilot ORDER BY Name ASC NULLS FIRST


Question:
List names of all pilot aged 30 or younger in descending alphabetical order.
Additional table information: table: aircraft

Answer: SELECT Name FROM pilot WHERE Age <= 30 ORDER BY Name DESC


Question:
What are the names of all pilots 30 years old or young in descending alphabetical order?
Additional table information: table: aircraft

Answer: SELECT Name FROM pilot WHERE Age <= 30 ORDER BY Name DESC


Question:
Please show the names of aircrafts associated with airport with name 'London Gatwick'.
Additional table information: table: aircraft

Answer: SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = 'London Gatwick'


Question:
What are the names of all the aircrafts associated with London Gatwick airport?
Additional table information: table: aircraft

Answer: SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = 'London Gatwick'


Question:
Please show the names and descriptions of aircrafts associated with airports that have a total number of passengers bigger than 10000000.
Additional table information: table: aircraft

Answer: SELECT T1.Aircraft, T1.Description FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Total_Passengers > 10000000


Question:
What are the names and descriptions of aircrafts associated with an airport that has more total passengers than 10000000?
Additional table information: table: aircraft

Answer: SELECT T1.Aircraft, T1.Description FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Total_Passengers > 10000000


Question:
What is the average total number of passengers of airports that are associated with aircraft 'Robinson R-22'?
Additional table information: table: aircraft

Answer: SELECT AVG(T3.Total_Passengers) FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T1.Aircraft = 'Robinson R-22'


Question:
What is the average total number of passengers for all airports that the aircraft 'Robinson R-22' visits?
Additional table information: table: aircraft

Answer: SELECT AVG(T3.Total_Passengers) FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T1.Aircraft = 'Robinson R-22'


Question:
Please list the location and the winning aircraft name.
Additional table information: table: aircraft

Answer: SELECT T2.Location, T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft


Question:
What is the location and name of the winning aircraft?
Additional table information: table: aircraft

Answer: SELECT T2.Location, T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft


Question:
List the name of the aircraft that has been named winning aircraft the most number of times.
Additional table information: table: aircraft

Answer: SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the name of the aircraft that has won an award the most?
Additional table information: table: aircraft

Answer: SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY COUNT(*) DESC LIMIT 1


Question:
List the names of aircrafts and the number of times it won matches.
Additional table information: table: aircraft

Answer: SELECT T1.Aircraft, COUNT(*) FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft


Question:
For each aircraft that has won an award, what is its name and how many time has it won?
Additional table information: table: aircraft

Answer: SELECT T1.Aircraft, COUNT(*) FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft


Question:
List names of all pilot in descending order of age.
Additional table information: table: aircraft

Answer: SELECT Name FROM pilot ORDER BY Age DESC


Question:
What are the names of all pilots listed by descending age?
Additional table information: table: aircraft

Answer: SELECT Name FROM pilot ORDER BY Age DESC


Question:
List the names of aircrafts and that won matches at least twice.
Additional table information: table: aircraft

Answer: SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft HAVING COUNT(*) >= 2


Question:
What are the names of all aircrafts that have won a match at least twice?
Additional table information: table: aircraft

Answer: SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft HAVING COUNT(*) >= 2


Question:
List the names of aircrafts and that did not win any match.
Additional table information: table: aircraft

Answer: SELECT Aircraft FROM aircraft WHERE NOT Aircraft_ID IN (SELECT Winning_Aircraft FROM MATCH)


Question:
What are the names of all aicrafts that have never won any match?
Additional table information: table: aircraft

Answer: SELECT Aircraft FROM aircraft WHERE NOT Aircraft_ID IN (SELECT Winning_Aircraft FROM MATCH)


Question:
Show the names of aircrafts that are associated with both an airport named 'London Heathrow' and an airport named 'London Gatwick'
Additional table information: table: aircraft

Answer: SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = 'London Heathrow' INTERSECT SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = 'London Gatwick'


Question:
What are the names of all aircrafts that are associated with both London Heathrow and Gatwick airports?
Additional table information: table: aircraft

Answer: SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = 'London Heathrow' INTERSECT SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = 'London Gatwick'


Question:
Show all information on the airport that has the largest number of international passengers.
Additional table information: table: aircraft

Answer: SELECT * FROM airport ORDER BY International_Passengers DESC LIMIT 1


Question:
What is all the information on the airport with the largest number of international passengers?
Additional table information: table: aircraft

Answer: SELECT * FROM airport ORDER BY International_Passengers DESC LIMIT 1


Question:
find the name and age of the pilot who has won the most number of times among the pilots who are younger than 30.
Additional table information: table: aircraft

Answer: SELECT t1.name, t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot WHERE t1.age < 30 GROUP BY t2.winning_pilot ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the name and age of the pilot younger than 30 who has won the most number of times?
Additional table information: table: aircraft

Answer: SELECT t1.name, t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot WHERE t1.age < 30 GROUP BY t2.winning_pilot ORDER BY COUNT(*) DESC LIMIT 1


Question:
what is the name and age of the youngest winning pilot?
Additional table information: table: aircraft

Answer: SELECT t1.name, t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot ORDER BY t1.age NULLS FIRST LIMIT 1


Question:
How old is the youngest winning pilot and what is their name?
Additional table information: table: aircraft

Answer: SELECT t1.name, t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot ORDER BY t1.age NULLS FIRST LIMIT 1


Question:
find the name of pilots who did not win the matches held in the country of Australia.
Additional table information: table: aircraft

Answer: SELECT name FROM pilot WHERE NOT pilot_id IN (SELECT Winning_Pilot FROM MATCH WHERE country = 'Australia')


Question:
What are the names of the pilots that have not won any matches in Australia?
Additional table information: table: aircraft

Answer: SELECT name FROM pilot WHERE NOT pilot_id IN (SELECT Winning_Pilot FROM MATCH WHERE country = 'Australia')


Question:
How many residents does each property have? List property id and resident count.
Additional table information: table: local_govt_and_lot

Answer: SELECT T1.property_id, COUNT(*) FROM properties AS T1 JOIN residents AS T2 ON T1.property_id = T2.property_id GROUP BY T1.property_id


Question:
What is the distinct service types that are provided by the organization which has detail 'Denesik and Sons Party'?
Additional table information: table: local_govt_and_lot

Answer: SELECT DISTINCT T1.service_type_code FROM services AS T1 JOIN organizations AS T2 ON T1.organization_id = T2.organization_id WHERE T2.organization_details = 'Denesik and Sons Party'


Question:
How many services has each resident requested? List the resident id, details, and the count in descending order of the count.
Additional table information: table: local_govt_and_lot

Answer: SELECT T1.resident_id, T1.other_details, COUNT(*) FROM Residents AS T1 JOIN Residents_Services AS T2 ON T1.resident_id = T2.resident_id GROUP BY T1.resident_id ORDER BY COUNT(*) DESC


Question:
What is the maximum number that a certain service is provided? List the service id, details and number.
Additional table information: table: local_govt_and_lot

Answer: SELECT T1.service_id, T1.service_details, COUNT(*) FROM Services AS T1 JOIN Residents_Services AS T2 ON T1.service_id = T2.service_id GROUP BY T1.service_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
List the id and type of each thing, and the details of the organization that owns it.
Additional table information: table: local_govt_and_lot

Answer: SELECT T1.thing_id, T1.type_of_Thing_Code, T2.organization_details FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id


Question:
What are the id and details of the customers who have at least 3 events?
Additional table information: table: local_govt_and_lot

Answer: SELECT T1.customer_id, T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 3


Question:
What is each customer's move in date, and the corresponding customer id and details?
Additional table information: table: local_govt_and_lot

Answer: SELECT T2.date_moved_in, T1.customer_id, T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id


Question:
Which events have the number of notes between one and three? List the event id and the property id.
Additional table information: table: local_govt_and_lot

Answer: SELECT T1.Customer_Event_ID, T1.property_id FROM Customer_Events AS T1 JOIN Customer_Event_Notes AS T2 ON T1.Customer_Event_ID = T2.Customer_Event_ID GROUP BY T1.customer_event_id HAVING COUNT(*) BETWEEN 1 AND 3


Question:
What are the distinct id and type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21'
Additional table information: table: local_govt_and_lot

Answer: SELECT DISTINCT T2.thing_id, T2.Type_of_Thing_Code FROM Timed_Status_of_Things AS T1 JOIN Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.Status_of_Thing_Code = 'Close' OR T1.Date_and_Date < '2017-06-19 02:59:21'


Question:
How many distinct locations have the things with service detail 'Unsatisfied' been located in?
Additional table information: table: local_govt_and_lot

Answer: SELECT COUNT(DISTINCT T2.Location_Code) FROM Things AS T1 JOIN Timed_Locations_of_Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.service_details = 'Unsatisfied'


Question:
How many different status codes of things are there?
Additional table information: table: local_govt_and_lot

Answer: SELECT COUNT(DISTINCT Status_of_Thing_Code) FROM Timed_Status_of_Things


Question:
Which organizations are not a parent organization of others? List the organization id.
Additional table information: table: local_govt_and_lot

Answer: SELECT organization_id FROM organizations EXCEPT SELECT parent_organization_id FROM organizations


Question:
When is the last day any resident moved in?
Additional table information: table: local_govt_and_lot

Answer: SELECT MAX(date_moved_in) FROM Residents


Question:
What are the resident details containing the substring 'Miss'?
Additional table information: table: local_govt_and_lot

Answer: SELECT other_details FROM Residents WHERE other_details LIKE '%Miss%'


Question:
List the customer event id and the corresponding move in date and property id.
Additional table information: table: local_govt_and_lot

Answer: SELECT customer_event_id, date_moved_in, property_id FROM customer_events


Question:
How many customers did not have any event?
Additional table information: table: local_govt_and_lot

Answer: SELECT COUNT(*) FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM customer_events)


Question:
What are the distinct move in dates of the residents?
Additional table information: table: local_govt_and_lot

Answer: SELECT DISTINCT date_moved_in FROM residents


Question:
How many schools are there?
Additional table information: table: school_player

Answer: SELECT COUNT(*) FROM school


Question:
Count the number of schools.
Additional table information: table: school_player

Answer: SELECT COUNT(*) FROM school


Question:
List the locations of schools in ascending order of enrollment.
Additional table information: table: school_player

Answer: SELECT LOCATION FROM school ORDER BY Enrollment ASC NULLS FIRST


Question:
What is the list of school locations sorted in ascending order of school enrollment?
Additional table information: table: school_player

Answer: SELECT LOCATION FROM school ORDER BY Enrollment ASC NULLS FIRST


Question:
List the locations of schools in descending order of founded year.
Additional table information: table: school_player

Answer: SELECT LOCATION FROM school ORDER BY Founded DESC


Question:
What is the list of school locations sorted in descending order of school foundation year?
Additional table information: table: school_player

Answer: SELECT LOCATION FROM school ORDER BY Founded DESC


Question:
What are the enrollments of schools whose denomination is not 'Catholic'?
Additional table information: table: school_player

Answer: SELECT Enrollment FROM school WHERE Denomination <> 'Catholic'


Question:
List the enrollment for each school that does not have 'Catholic' as denomination.
Additional table information: table: school_player

Answer: SELECT Enrollment FROM school WHERE Denomination <> 'Catholic'


Question:
What is the average enrollment of schools?
Additional table information: table: school_player

Answer: SELECT AVG(Enrollment) FROM school


Question:
Take the average of the school enrollment.
Additional table information: table: school_player

Answer: SELECT AVG(Enrollment) FROM school


Question:
What are the teams of the players, sorted in ascending alphabetical order?
Additional table information: table: school_player

Answer: SELECT Team FROM player ORDER BY Team ASC NULLS FIRST


Question:
Find the team of each player and sort them in ascending alphabetical order.
Additional table information: table: school_player

Answer: SELECT Team FROM player ORDER BY Team ASC NULLS FIRST


Question:
How many different positions of players are there?
Additional table information: table: school_player

Answer: SELECT COUNT(DISTINCT POSITION) FROM player


Question:
Count the number of distinct player positions.
Additional table information: table: school_player

Answer: SELECT COUNT(DISTINCT POSITION) FROM player


Question:
Find the team of the player of the highest age.
Additional table information: table: school_player

Answer: SELECT Team FROM player ORDER BY Age DESC LIMIT 1


Question:
Which team has the oldest player?
Additional table information: table: school_player

Answer: SELECT Team FROM player ORDER BY Age DESC LIMIT 1


Question:
List the teams of the players with the top 5 largest ages.
Additional table information: table: school_player

Answer: SELECT Team FROM player ORDER BY Age DESC LIMIT 5


Question:
What are the teams that have the 5 oldest players?
Additional table information: table: school_player

Answer: SELECT Team FROM player ORDER BY Age DESC LIMIT 5


Question:
For each player, show the team and the location of school they belong to.
Additional table information: table: school_player

Answer: SELECT T1.Team, T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID


Question:
What are the team and the location of school each player belongs to?
Additional table information: table: school_player

Answer: SELECT T1.Team, T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID


Question:
Show the locations of schools that have more than 1 player.
Additional table information: table: school_player

Answer: SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*) > 1


Question:
Which schools have more than 1 player? Give me the school locations.
Additional table information: table: school_player

Answer: SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*) > 1


Question:
Show the denomination of the school that has the most players.
Additional table information: table: school_player

Answer: SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the denomination of the school the most players belong to?
Additional table information: table: school_player

Answer: SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show locations and nicknames of schools.
Additional table information: table: school_player

Answer: SELECT T1.Location, T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID = T2.School_ID


Question:
What are the location and nickname of each school?
Additional table information: table: school_player

Answer: SELECT T1.Location, T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID = T2.School_ID


Question:
Please show different denominations and the corresponding number of schools.
Additional table information: table: school_player

Answer: SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination


Question:
For each denomination, return the denomination and the count of schools with that denomination.
Additional table information: table: school_player

Answer: SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination


Question:
Please show different denominations and the corresponding number of schools in descending order.
Additional table information: table: school_player

Answer: SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC


Question:
Order denominations in descending order of the count of schools with the denomination. Return each denomination with the count of schools.
Additional table information: table: school_player

Answer: SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC


Question:
List the school color of the school that has the largest enrollment.
Additional table information: table: school_player

Answer: SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1


Question:
What is the school color of the school with the largest enrollment?
Additional table information: table: school_player

Answer: SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1


Question:
List the locations of schools that do not have any player.
Additional table information: table: school_player

Answer: SELECT LOCATION FROM school WHERE NOT School_ID IN (SELECT School_ID FROM Player)


Question:
Which schools do not have any player? Give me the school locations.
Additional table information: table: school_player

Answer: SELECT LOCATION FROM school WHERE NOT School_ID IN (SELECT School_ID FROM Player)


Question:
Show the denomination shared by schools founded before 1890 and schools founded after 1900
Additional table information: table: school_player

Answer: SELECT Denomination FROM school WHERE Founded < 1890 INTERSECT SELECT Denomination FROM school WHERE Founded > 1900


Question:
What are the denominations used by both schools founded before 1890 and schools founded  after 1900?
Additional table information: table: school_player

Answer: SELECT Denomination FROM school WHERE Founded < 1890 INTERSECT SELECT Denomination FROM school WHERE Founded > 1900


Question:
Show the nicknames of schools that are not in division 1.
Additional table information: table: school_player

Answer: SELECT Nickname FROM school_details WHERE Division <> 'Division 1'


Question:
What are the nicknames of schools whose division is not 1?
Additional table information: table: school_player

Answer: SELECT Nickname FROM school_details WHERE Division <> 'Division 1'


Question:
Show the denomination shared by more than one school.
Additional table information: table: school_player

Answer: SELECT Denomination FROM school GROUP BY Denomination HAVING COUNT(*) > 1


Question:
What are the denomination more than one school have?
Additional table information: table: school_player

Answer: SELECT Denomination FROM school GROUP BY Denomination HAVING COUNT(*) > 1


Question:
Find all the distinct district names ordered by city area in descending.
Additional table information: table: store_product

Answer: SELECT DISTINCT District_name FROM district ORDER BY city_area DESC


Question:
What are the different district names in order of descending city area?
Additional table information: table: store_product

Answer: SELECT DISTINCT District_name FROM district ORDER BY city_area DESC


Question:
Find the list of page size which have more than 3 product listed
Additional table information: table: store_product

Answer: SELECT max_page_size FROM product GROUP BY max_page_size HAVING COUNT(*) > 3


Question:
What is the maximum page size for everything that has more than 3 products listed?
Additional table information: table: store_product

Answer: SELECT max_page_size FROM product GROUP BY max_page_size HAVING COUNT(*) > 3


Question:
Find the name and population of district with population between 200000 and 2000000
Additional table information: table: store_product

Answer: SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000


Question:
What are the district names and city populations for all districts that between 200,000 and 2,000,000 residents?
Additional table information: table: store_product

Answer: SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000


Question:
Find the name all districts with city area greater than 10 or population larger than 100000
Additional table information: table: store_product

Answer: SELECT district_name FROM district WHERE city_area > 10 OR City_Population > 100000


Question:
What are the names of all districts with a city area greater than 10 or have more than 100000 people living there?
Additional table information: table: store_product

Answer: SELECT district_name FROM district WHERE city_area > 10 OR City_Population > 100000


Question:
Which district has the largest population?
Additional table information: table: store_product

Answer: SELECT district_name FROM district ORDER BY city_population DESC LIMIT 1


Question:
What is the name of the district with the most residents?
Additional table information: table: store_product

Answer: SELECT district_name FROM district ORDER BY city_population DESC LIMIT 1


Question:
Which district has the least area?
Additional table information: table: store_product

Answer: SELECT district_name FROM district ORDER BY city_area ASC NULLS FIRST LIMIT 1


Question:
What is the name of the district with the smallest area?
Additional table information: table: store_product

Answer: SELECT district_name FROM district ORDER BY city_area ASC NULLS FIRST LIMIT 1


Question:
Find the total population of the top 3 districts with the largest area.
Additional table information: table: store_product

Answer: SELECT SUM(city_population) FROM district ORDER BY city_area DESC LIMIT 3


Question:
What is the total number of residents for the districts with the 3 largest areas?
Additional table information: table: store_product

Answer: SELECT SUM(city_population) FROM district ORDER BY city_area DESC LIMIT 3


Question:
Find all types of store and number of them.
Additional table information: table: store_product

Answer: SELECT TYPE, COUNT(*) FROM store GROUP BY TYPE


Question:
For each type of store, how many of them are there?
Additional table information: table: store_product

Answer: SELECT TYPE, COUNT(*) FROM store GROUP BY TYPE


Question:
Find the names of all stores in Khanewal District.
Additional table information: table: store_product

Answer: SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t3.district_name = 'Khanewal District'


Question:
What are the names of all the stores located in Khanewal District?
Additional table information: table: store_product

Answer: SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t3.district_name = 'Khanewal District'


Question:
Find all the stores in the district with the most population.
Additional table information: table: store_product

Answer: SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id WHERE district_id = (SELECT district_id FROM district ORDER BY city_population DESC LIMIT 1)


Question:
What are the names of all the stores in the largest district by population?
Additional table information: table: store_product

Answer: SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id WHERE district_id = (SELECT district_id FROM district ORDER BY city_population DESC LIMIT 1)


Question:
Which city is the headquarter of the store named 'Blackville' in?
Additional table information: table: store_product

Answer: SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.store_name = 'Blackville'


Question:
What city is the headquarter of the store Blackville?
Additional table information: table: store_product

Answer: SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.store_name = 'Blackville'


Question:
Find the number of stores in each city.
Additional table information: table: store_product

Answer: SELECT t3.headquartered_city, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city


Question:
How many stores are headquarted in each city?
Additional table information: table: store_product

Answer: SELECT t3.headquartered_city, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city


Question:
Find the city with the most number of stores.
Additional table information: table: store_product

Answer: SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the city with the most number of flagship stores?
Additional table information: table: store_product

Answer: SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the average pages per minute color?
Additional table information: table: store_product

Answer: SELECT AVG(pages_per_minute_color) FROM product


Question:
What is the average number of pages per minute color?
Additional table information: table: store_product

Answer: SELECT AVG(pages_per_minute_color) FROM product


Question:
What products are available at store named 'Miramichi'?
Additional table information: table: store_product

Answer: SELECT t1.product FROM product AS t1 JOIN store_product AS t2 ON t1.product_id = t2.product_id JOIN store AS t3 ON t2.store_id = t3.store_id WHERE t3.store_name = 'Miramichi'


Question:
What products are sold at the store named Miramichi?
Additional table information: table: store_product

Answer: SELECT t1.product FROM product AS t1 JOIN store_product AS t2 ON t1.product_id = t2.product_id JOIN store AS t3 ON t2.store_id = t3.store_id WHERE t3.store_name = 'Miramichi'


Question:
Find products with max page size as 'A4' and pages per minute color smaller than 5.
Additional table information: table: store_product

Answer: SELECT product FROM product WHERE max_page_size = 'A4' AND pages_per_minute_color < 5


Question:
What are the products with the maximum page size A4 that also have a pages per minute color smaller than 5?
Additional table information: table: store_product

Answer: SELECT product FROM product WHERE max_page_size = 'A4' AND pages_per_minute_color < 5


Question:
Find products with max page size as 'A4' or pages per minute color smaller than 5.
Additional table information: table: store_product

Answer: SELECT product FROM product WHERE max_page_size = 'A4' OR pages_per_minute_color < 5


Question:
What are the products with the maximum page size eqal to A4 or a pages per minute color less than 5?
Additional table information: table: store_product

Answer: SELECT product FROM product WHERE max_page_size = 'A4' OR pages_per_minute_color < 5


Question:
Find all the product whose name contains the word 'Scanner'.
Additional table information: table: store_product

Answer: SELECT product FROM product WHERE product LIKE '%Scanner%'


Question:
What are all of the products whose name includes the substring 'Scanner'?
Additional table information: table: store_product

Answer: SELECT product FROM product WHERE product LIKE '%Scanner%'


Question:
Find the most prominent max page size among all the products.
Additional table information: table: store_product

Answer: SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the most common maximum page size?
Additional table information: table: store_product

Answer: SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the name of the products that are not using the most frequently-used max page size.
Additional table information: table: store_product

Answer: SELECT product FROM product WHERE product <> (SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY COUNT(*) DESC LIMIT 1)


Question:
What are the names of all products that are not the most frequently-used maximum page size?
Additional table information: table: store_product

Answer: SELECT product FROM product WHERE product <> (SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY COUNT(*) DESC LIMIT 1)


Question:
Find the total population of the districts where the area is bigger than the average city area.
Additional table information: table: store_product

Answer: SELECT SUM(city_population) FROM district WHERE city_area > (SELECT AVG(city_area) FROM district)


Question:
What is the total population for all the districts that have an area larger tahn the average city area?
Additional table information: table: store_product

Answer: SELECT SUM(city_population) FROM district WHERE city_area > (SELECT AVG(city_area) FROM district)


Question:
Find the names of districts where have both city mall and village store type stores.
Additional table information: table: store_product

Answer: SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = 'City Mall' INTERSECT SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = 'Village Store'


Question:
What are the names of the districts that have both mall and village store style shops?
Additional table information: table: store_product

Answer: SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = 'City Mall' INTERSECT SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = 'Village Store'


Question:
What is the total enrollment number of all colleges?
Additional table information: table: soccer_2

Answer: SELECT SUM(enr) FROM College


Question:
How many students are enrolled in college?
Additional table information: table: soccer_2

Answer: SELECT SUM(enr) FROM College


Question:
What is the average enrollment number?
Additional table information: table: soccer_2

Answer: SELECT AVG(enr) FROM College


Question:
How many students, on average, does each college have enrolled?
Additional table information: table: soccer_2

Answer: SELECT AVG(enr) FROM College


Question:
How many colleges in total?
Additional table information: table: soccer_2

Answer: SELECT COUNT(*) FROM College


Question:
How many different colleges are there?
Additional table information: table: soccer_2

Answer: SELECT COUNT(*) FROM College


Question:
How many players have more than 1000 hours of training?
Additional table information: table: soccer_2

Answer: SELECT COUNT(*) FROM Player WHERE HS > 1000


Question:
How many different players trained for more than 1000 hours?
Additional table information: table: soccer_2

Answer: SELECT COUNT(*) FROM Player WHERE HS > 1000


Question:
How many colleges has more than 15000 students?
Additional table information: table: soccer_2

Answer: SELECT COUNT(*) FROM College WHERE enr > 15000


Question:
What is the number of colleges with a student population greater than 15000?
Additional table information: table: soccer_2

Answer: SELECT COUNT(*) FROM College WHERE enr > 15000


Question:
What is the average training hours of all players?
Additional table information: table: soccer_2

Answer: SELECT AVG(HS) FROM Player


Question:
How many hours do the players train on average?
Additional table information: table: soccer_2

Answer: SELECT AVG(HS) FROM Player


Question:
Find the name and training hours of players whose hours are below 1500.
Additional table information: table: soccer_2

Answer: SELECT pName, HS FROM Player WHERE HS < 1500


Question:
What are the names and number of hours spent training for each player who trains for less than 1500 hours?
Additional table information: table: soccer_2

Answer: SELECT pName, HS FROM Player WHERE HS < 1500


Question:
How many different colleges do attend the tryout test?
Additional table information: table: soccer_2

Answer: SELECT COUNT(DISTINCT cName) FROM tryout


Question:
How many different colleges were represented at tryouts?
Additional table information: table: soccer_2

Answer: SELECT COUNT(DISTINCT cName) FROM tryout


Question:
What are the unique types of player positions in the tryout?
Additional table information: table: soccer_2

Answer: SELECT COUNT(DISTINCT pPos) FROM tryout


Question:
What are the different types of player positions?
Additional table information: table: soccer_2

Answer: SELECT COUNT(DISTINCT pPos) FROM tryout


Question:
How many students got accepted after the tryout?
Additional table information: table: soccer_2

Answer: SELECT COUNT(*) FROM tryout WHERE decision = 'yes'


Question:
How many students received a yes from tryouts?
Additional table information: table: soccer_2

Answer: SELECT COUNT(*) FROM tryout WHERE decision = 'yes'


Question:
How many students whose are playing the role of goalie?
Additional table information: table: soccer_2

Answer: SELECT COUNT(*) FROM tryout WHERE pPos = 'goalie'


Question:
What is the number of students playing as a goalie?
Additional table information: table: soccer_2

Answer: SELECT COUNT(*) FROM tryout WHERE pPos = 'goalie'


Question:
Find the max, average and min training hours of all players.
Additional table information: table: soccer_2

Answer: SELECT AVG(HS), MAX(HS), MIN(HS) FROM Player


Question:
What is the average, maximum, and minimum for the number of hours spent training?
Additional table information: table: soccer_2

Answer: SELECT AVG(HS), MAX(HS), MIN(HS) FROM Player


Question:
What is average enrollment of colleges in the state FL?
Additional table information: table: soccer_2

Answer: SELECT AVG(enr) FROM College WHERE state = 'FL'


Question:
What is average number of students enrolled in Florida colleges?
Additional table information: table: soccer_2

Answer: SELECT AVG(enr) FROM College WHERE state = 'FL'


Question:
What are the names of players whose training hours is between 500 and 1500?
Additional table information: table: soccer_2

Answer: SELECT pName FROM Player WHERE HS BETWEEN 500 AND 1500


Question:
What are the names of players who train between 500 and 1500 hours?
Additional table information: table: soccer_2

Answer: SELECT pName FROM Player WHERE HS BETWEEN 500 AND 1500


Question:
Find the players whose names contain letter 'a'.
Additional table information: table: soccer_2

Answer: SELECT DISTINCT pName FROM Player WHERE pName LIKE '%a%'


Question:
Who are the players that have names containing the letter a?
Additional table information: table: soccer_2

Answer: SELECT DISTINCT pName FROM Player WHERE pName LIKE '%a%'


Question:
Find the name, enrollment of the colleges whose size is bigger than 10000 and location is in state LA.
Additional table information: table: soccer_2

Answer: SELECT cName, enr FROM College WHERE enr > 10000 AND state = 'LA'


Question:
What are the names and enrollment numbers for colleges that have more than 10000 enrolled and are located in Louisiana?
Additional table information: table: soccer_2

Answer: SELECT cName, enr FROM College WHERE enr > 10000 AND state = 'LA'


Question:
List all information about college sorted by enrollment number in the ascending order.
Additional table information: table: soccer_2

Answer: SELECT * FROM College ORDER BY enr NULLS FIRST


Question:
What information do you have on colleges sorted by increasing enrollment numbers?
Additional table information: table: soccer_2

Answer: SELECT * FROM College ORDER BY enr NULLS FIRST


Question:
List the name of the colleges whose enrollment is greater 18000 sorted by the college's name.
Additional table information: table: soccer_2

Answer: SELECT cName FROM College WHERE enr > 18000 ORDER BY cName NULLS FIRST


Question:
What is the name of every college in alphabetical order that has more than 18000 students enrolled?
Additional table information: table: soccer_2

Answer: SELECT cName FROM College WHERE enr > 18000 ORDER BY cName NULLS FIRST


Question:
Find the name of players whose card is yes in the descending order of training hours.
Additional table information: table: soccer_2

Answer: SELECT pName FROM Player WHERE yCard = 'yes' ORDER BY HS DESC


Question:
What are the name of the players who received a card in descending order of the hours of training?
Additional table information: table: soccer_2

Answer: SELECT pName FROM Player WHERE yCard = 'yes' ORDER BY HS DESC


Question:
Find the name of different colleges involved in the tryout in alphabetical order.
Additional table information: table: soccer_2

Answer: SELECT DISTINCT cName FROM tryout ORDER BY cName NULLS FIRST


Question:
What are the different names of the colleges involved in the tryout in alphabetical order?
Additional table information: table: soccer_2

Answer: SELECT DISTINCT cName FROM tryout ORDER BY cName NULLS FIRST


Question:
Which position is most popular among players in the tryout?
Additional table information: table: soccer_2

Answer: SELECT pPos FROM tryout GROUP BY pPos ORDER BY COUNT(*) DESC LIMIT 1


Question:
What was the most popular position at tryouts?
Additional table information: table: soccer_2

Answer: SELECT pPos FROM tryout GROUP BY pPos ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the number of students who participate in the tryout for each college ordered by descending count.
Additional table information: table: soccer_2

Answer: SELECT COUNT(*), cName FROM tryout GROUP BY cName ORDER BY COUNT(*) DESC


Question:
How many students participated in tryouts for each college by descennding count?
Additional table information: table: soccer_2

Answer: SELECT COUNT(*), cName FROM tryout GROUP BY cName ORDER BY COUNT(*) DESC


Question:
What is minimum hours of the students playing in different position?
Additional table information: table: soccer_2

Answer: SELECT MIN(T2.HS), T1.pPos FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID GROUP BY T1.pPos


Question:
For each position, what is the minimum time students spent practicing?
Additional table information: table: soccer_2

Answer: SELECT MIN(T2.HS), T1.pPos FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID GROUP BY T1.pPos


Question:
What are the names of schools with the top 3 largest size?
Additional table information: table: soccer_2

Answer: SELECT cName FROM college ORDER BY enr DESC LIMIT 3


Question:
What are the names of the schools with the top 3 largest class sizes?
Additional table information: table: soccer_2

Answer: SELECT cName FROM college ORDER BY enr DESC LIMIT 3


Question:
What is the name of school that has the smallest enrollment in each state?
Additional table information: table: soccer_2

Answer: SELECT cName, state, MIN(enr) FROM college GROUP BY state


Question:
What is the name of the school with smallest enrollment size per state?
Additional table information: table: soccer_2

Answer: SELECT cName, state, MIN(enr) FROM college GROUP BY state


Question:
Find the states where have some college students in tryout.
Additional table information: table: soccer_2

Answer: SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName


Question:
What are the different states that have students trying out?
Additional table information: table: soccer_2

Answer: SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName


Question:
Find the states where have some college students in tryout and their decisions are yes.
Additional table information: table: soccer_2

Answer: SELECT DISTINCT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'


Question:
What are the different states that had students successfully try out?
Additional table information: table: soccer_2

Answer: SELECT DISTINCT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'


Question:
Find the name and college of students whose decisions are yes in the tryout.
Additional table information: table: soccer_2

Answer: SELECT T1.pName, T2.cName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'


Question:
What are the names of all the players who received a yes during tryouts, and also what are the names of their colleges?
Additional table information: table: soccer_2

Answer: SELECT T1.pName, T2.cName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'


Question:
Find the name of all students who were in the tryout sorted in alphabetic order.
Additional table information: table: soccer_2

Answer: SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName NULLS FIRST


Question:
What are the names of all students who tried out in alphabetical order?
Additional table information: table: soccer_2

Answer: SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName NULLS FIRST


Question:
Find the name and hours of the students whose tryout decision is yes.
Additional table information: table: soccer_2

Answer: SELECT T1.pName, T1.HS FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'


Question:
What are the names and hours spent practicing of every student who received a yes at tryouts?
Additional table information: table: soccer_2

Answer: SELECT T1.pName, T1.HS FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'


Question:
Find the states of the colleges that have students in the tryout who played in striker position.
Additional table information: table: soccer_2

Answer: SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'striker'


Question:
What are the states of the colleges where students who tried out for the striker position attend?
Additional table information: table: soccer_2

Answer: SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'striker'


Question:
Find the names of the students who are in the position of striker and got a yes tryout decision.
Additional table information: table: soccer_2

Answer: SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' AND T2.pPos = 'striker'


Question:
What are the names of all students who successfully tried out for the position of striker?
Additional table information: table: soccer_2

Answer: SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' AND T2.pPos = 'striker'


Question:
Find the state of the college which player Charles is attending.
Additional table information: table: soccer_2

Answer: SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName JOIN player AS T3 ON T2.pID = T3.pID WHERE T3.pName = 'Charles'


Question:
In which state is the college that Charles attends?
Additional table information: table: soccer_2

Answer: SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName JOIN player AS T3 ON T2.pID = T3.pID WHERE T3.pName = 'Charles'


Question:
Find the average and maximum hours for the students whose tryout decision is yes.
Additional table information: table: soccer_2

Answer: SELECT AVG(T1.HS), MAX(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'


Question:
What is the average and maximum number of hours students who made the team practiced?
Additional table information: table: soccer_2

Answer: SELECT AVG(T1.HS), MAX(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'


Question:
Find the average hours for the students whose tryout decision is no.
Additional table information: table: soccer_2

Answer: SELECT AVG(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'no'


Question:
What is the average number of hours spent practicing for students who got rejected?
Additional table information: table: soccer_2

Answer: SELECT AVG(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'no'


Question:
What is the maximum training hours for the students whose training hours is greater than 1000 in different positions?
Additional table information: table: soccer_2

Answer: SELECT MAX(T1.HS), pPos FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T1.HS > 1000 GROUP BY T2.pPos


Question:
For each position, what is the maximum number of  hours for students who spent more than 1000 hours training?
Additional table information: table: soccer_2

Answer: SELECT MAX(T1.HS), pPos FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T1.HS > 1000 GROUP BY T2.pPos


Question:
Which colleges do the tryout players whose name starts with letter D go to?
Additional table information: table: soccer_2

Answer: SELECT T1.cName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T2.pName LIKE 'D%'


Question:
Which colleges does each player with a name that starts with the letter D  who tried out go to?
Additional table information: table: soccer_2

Answer: SELECT T1.cName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T2.pName LIKE 'D%'


Question:
Which college has any student who is a goalie and succeeded in the tryout.
Additional table information: table: soccer_2

Answer: SELECT cName FROM tryout WHERE decision = 'yes' AND pPos = 'goalie'


Question:
What college has a student who successfully made the team in the role of a goalie?
Additional table information: table: soccer_2

Answer: SELECT cName FROM tryout WHERE decision = 'yes' AND pPos = 'goalie'


Question:
Find the name of the tryout players who are from the college with largest size.
Additional table information: table: soccer_2

Answer: SELECT T2.pName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T1.cName = (SELECT cName FROM college ORDER BY enr DESC LIMIT 1)


Question:
What are the names of all tryout participants who are from the largest college?
Additional table information: table: soccer_2

Answer: SELECT T2.pName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T1.cName = (SELECT cName FROM college ORDER BY enr DESC LIMIT 1)


Question:
What is the state and enrollment of the colleges where have any students who got accepted in the tryout decision.
Additional table information: table: soccer_2

Answer: SELECT DISTINCT T1.state, T1.enr FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'


Question:
How many students are enrolled in colleges that have student accepted during tryouts, and in which states are those colleges?
Additional table information: table: soccer_2

Answer: SELECT DISTINCT T1.state, T1.enr FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'


Question:
Find the names of either colleges in LA with greater than 15000 size or in state AZ with less than 13000 enrollment.
Additional table information: table: soccer_2

Answer: SELECT cName FROM College WHERE enr < 13000 AND state = 'AZ' UNION SELECT cName FROM College WHERE enr > 15000 AND state = 'LA'


Question:
What are the names of colleges in LA that have more than 15,000 students and of colleges in AZ with less than 13,000 students?
Additional table information: table: soccer_2

Answer: SELECT cName FROM College WHERE enr < 13000 AND state = 'AZ' UNION SELECT cName FROM College WHERE enr > 15000 AND state = 'LA'


Question:
Find the names of schools that have some students playing in goalie and mid positions.
Additional table information: table: soccer_2

Answer: SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid'


Question:
What are the names of all schools that have students trying out for the position of goal and 'mid'-field.
Additional table information: table: soccer_2

Answer: SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid'


Question:
Find the names of states that have some college students playing in goalie and mid positions.
Additional table information: table: soccer_2

Answer: SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie' INTERSECT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid'


Question:
What are the names of the states that have some college students playing in the positions of goalie and mid-field?
Additional table information: table: soccer_2

Answer: SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie' INTERSECT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid'


Question:
How many schools have some students playing in goalie and mid positions.
Additional table information: table: soccer_2

Answer: SELECT COUNT(*) FROM (SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid')


Question:
How many schools have students playing in goalie and mid-field positions?
Additional table information: table: soccer_2

Answer: SELECT COUNT(*) FROM (SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid')


Question:
Find the names of schools that have some players in the mid position but not in the goalie position.
Additional table information: table: soccer_2

Answer: SELECT cName FROM tryout WHERE pPos = 'mid' EXCEPT SELECT cName FROM tryout WHERE pPos = 'goalie'


Question:
What are the names of the schools with some players in the mid position but no goalies?
Additional table information: table: soccer_2

Answer: SELECT cName FROM tryout WHERE pPos = 'mid' EXCEPT SELECT cName FROM tryout WHERE pPos = 'goalie'


Question:
Find the names of states that have some college students playing in the mid position but not in the goalie position.
Additional table information: table: soccer_2

Answer: SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie'


Question:
What are the names of all the states with college students playing in the mid position but no goalies?
Additional table information: table: soccer_2

Answer: SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie'


Question:
How many states that have some college students playing in the mid position but not in the goalie position.
Additional table information: table: soccer_2

Answer: SELECT COUNT(*) FROM (SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie')


Question:
What is the count of states with college students playing in the mid position but not as goalies?
Additional table information: table: soccer_2

Answer: SELECT COUNT(*) FROM (SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie')


Question:
Find the states where have the colleges whose enrollments are less than the largest size.
Additional table information: table: soccer_2

Answer: SELECT DISTINCT state FROM college WHERE enr < (SELECT MAX(enr) FROM college)


Question:
What are the states with colleges that have enrollments less than the some other college?
Additional table information: table: soccer_2

Answer: SELECT DISTINCT state FROM college WHERE enr < (SELECT MAX(enr) FROM college)


Question:
Find names of colleges with enrollment greater than that of some (at least one) college in the FL state.
Additional table information: table: soccer_2

Answer: SELECT DISTINCT cName FROM college WHERE enr > (SELECT MIN(enr) FROM college WHERE state = 'FL')


Question:
What are the names of the colleges that are larger than at least one college in Florida?
Additional table information: table: soccer_2

Answer: SELECT DISTINCT cName FROM college WHERE enr > (SELECT MIN(enr) FROM college WHERE state = 'FL')


Question:
Find names of all colleges whose enrollment is greater than that of all colleges in the FL state.
Additional table information: table: soccer_2

Answer: SELECT cName FROM college WHERE enr > (SELECT MAX(enr) FROM college WHERE state = 'FL')


Question:
What are the names of all colleges with a larger enrollment than the largest college in Florida?
Additional table information: table: soccer_2

Answer: SELECT cName FROM college WHERE enr > (SELECT MAX(enr) FROM college WHERE state = 'FL')


Question:
What is the total number of enrollment of schools that do not have any goalie player?
Additional table information: table: soccer_2

Answer: SELECT SUM(enr) FROM college WHERE NOT cName IN (SELECT cName FROM tryout WHERE pPos = 'goalie')


Question:
What is the total number of students enrolled in schools without any goalies?
Additional table information: table: soccer_2

Answer: SELECT SUM(enr) FROM college WHERE NOT cName IN (SELECT cName FROM tryout WHERE pPos = 'goalie')


Question:
What is the number of states that has some college whose enrollment is larger than the average enrollment?
Additional table information: table: soccer_2

Answer: SELECT COUNT(DISTINCT state) FROM college WHERE enr > (SELECT AVG(enr) FROM college)


Question:
How many states have a college with more students than average?
Additional table information: table: soccer_2

Answer: SELECT COUNT(DISTINCT state) FROM college WHERE enr > (SELECT AVG(enr) FROM college)


Question:
What is the number of states that has some colleges whose enrollment is smaller than the average enrollment?
Additional table information: table: soccer_2

Answer: SELECT COUNT(DISTINCT state) FROM college WHERE enr < (SELECT AVG(enr) FROM college)


Question:
How many states have smaller colleges than average?
Additional table information: table: soccer_2

Answer: SELECT COUNT(DISTINCT state) FROM college WHERE enr < (SELECT AVG(enr) FROM college)


Question:
How many devices are there?
Additional table information: table: device

Answer: SELECT COUNT(*) FROM device


Question:
Count the number of devices.
Additional table information: table: device

Answer: SELECT COUNT(*) FROM device


Question:
List the carriers of devices in ascending alphabetical order.
Additional table information: table: device

Answer: SELECT Carrier FROM device ORDER BY Carrier ASC NULLS FIRST


Question:
What are the different carriers for devices, listed in alphabetical order?
Additional table information: table: device

Answer: SELECT Carrier FROM device ORDER BY Carrier ASC NULLS FIRST


Question:
What are the carriers of devices whose software platforms are not 'Android'?
Additional table information: table: device

Answer: SELECT Carrier FROM device WHERE Software_Platform <> 'Android'


Question:
Return the device carriers that do not have Android as their software platform.
Additional table information: table: device

Answer: SELECT Carrier FROM device WHERE Software_Platform <> 'Android'


Question:
What are the names of shops in ascending order of open year?
Additional table information: table: device

Answer: SELECT Shop_Name FROM shop ORDER BY Open_Year ASC NULLS FIRST


Question:
Return the names of shops, ordered by year of opening ascending.
Additional table information: table: device

Answer: SELECT Shop_Name FROM shop ORDER BY Open_Year ASC NULLS FIRST


Question:
What is the average quantity of stocks?
Additional table information: table: device

Answer: SELECT AVG(Quantity) FROM stock


Question:
Give the average quantity of stocks.
Additional table information: table: device

Answer: SELECT AVG(Quantity) FROM stock


Question:
What are the names and location of the shops in ascending alphabetical order of name.
Additional table information: table: device

Answer: SELECT Shop_Name, LOCATION FROM shop ORDER BY Shop_Name ASC NULLS FIRST


Question:
Return the names and locations of shops, ordered by name in alphabetical order.
Additional table information: table: device

Answer: SELECT Shop_Name, LOCATION FROM shop ORDER BY Shop_Name ASC NULLS FIRST


Question:
How many different software platforms are there for devices?
Additional table information: table: device

Answer: SELECT COUNT(DISTINCT Software_Platform) FROM device


Question:
Count the number of different software platforms.
Additional table information: table: device

Answer: SELECT COUNT(DISTINCT Software_Platform) FROM device


Question:
List the open date of open year of the shop named 'Apple'.
Additional table information: table: device

Answer: SELECT Open_Date, Open_Year FROM shop WHERE Shop_Name = 'Apple'


Question:
What are the open dates and years for the shop named Apple?
Additional table information: table: device

Answer: SELECT Open_Date, Open_Year FROM shop WHERE Shop_Name = 'Apple'


Question:
List the name of the shop with the latest open year.
Additional table information: table: device

Answer: SELECT Shop_Name FROM shop ORDER BY Open_Year DESC LIMIT 1


Question:
What is the shop name corresponding to the shop that opened in the most recent year?
Additional table information: table: device

Answer: SELECT Shop_Name FROM shop ORDER BY Open_Year DESC LIMIT 1


Question:
Show names of shops and the carriers of devices they have in stock.
Additional table information: table: device

Answer: SELECT T3.Shop_Name, T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID


Question:
What are the names of device shops, and what are the carriers that they carry devices in stock for?
Additional table information: table: device

Answer: SELECT T3.Shop_Name, T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID


Question:
Show names of shops that have more than one kind of device in stock.
Additional table information: table: device

Answer: SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID HAVING COUNT(*) > 1


Question:
What are the names of shops that have more than a single kind of device in stock?
Additional table information: table: device

Answer: SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID HAVING COUNT(*) > 1


Question:
Show the name of the shop that has the most kind of devices in stock.
Additional table information: table: device

Answer: SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the name of the shop that has the most different kinds of devices in stock?
Additional table information: table: device

Answer: SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the name of the shop that have the largest quantity of devices in stock.
Additional table information: table: device

Answer: SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY SUM(T1.quantity) DESC LIMIT 1


Question:
What is the name of the shop that has the greatest quantity of devices in stock?
Additional table information: table: device

Answer: SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY SUM(T1.quantity) DESC LIMIT 1


Question:
Please show different software platforms and the corresponding number of devices using each.
Additional table information: table: device

Answer: SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform


Question:
What are the different software platforms for devices, and how many devices have each?
Additional table information: table: device

Answer: SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform


Question:
Please show the software platforms of devices in descending order of the count.
Additional table information: table: device

Answer: SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC


Question:
What are the different software platforms for devices, ordered by frequency descending?
Additional table information: table: device

Answer: SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC


Question:
List the software platform shared by the greatest number of devices.
Additional table information: table: device

Answer: SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the software platform that is most common amongst all devices?
Additional table information: table: device

Answer: SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1


Question:
List the names of shops that have no devices in stock.
Additional table information: table: device

Answer: SELECT Shop_Name FROM shop WHERE NOT Shop_ID IN (SELECT Shop_ID FROM stock)


Question:
What are the names of shops that do not have any devices in stock?
Additional table information: table: device

Answer: SELECT Shop_Name FROM shop WHERE NOT Shop_ID IN (SELECT Shop_ID FROM stock)


Question:
Show the locations shared by shops with open year later than 2012 and shops with open year before 2008.
Additional table information: table: device

Answer: SELECT LOCATION FROM shop WHERE Open_Year > 2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year < 2008


Question:
Which locations contains both shops that opened after the year 2012 and shops that opened before 2008?
Additional table information: table: device

Answer: SELECT LOCATION FROM shop WHERE Open_Year > 2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year < 2008


Question:
List the carriers of devices that have no devices in stock.
Additional table information: table: device

Answer: SELECT Carrier FROM device WHERE NOT Device_ID IN (SELECT Device_ID FROM stock)


Question:
What are the carriers of devices that are not in stock anywhere?
Additional table information: table: device

Answer: SELECT Carrier FROM device WHERE NOT Device_ID IN (SELECT Device_ID FROM stock)


Question:
Show the carriers of devices in stock at more than one shop.
Additional table information: table: device

Answer: SELECT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID GROUP BY T1.Device_ID HAVING COUNT(*) > 1


Question:
What are the carriers of devices that are in stock in more than a single shop?
Additional table information: table: device

Answer: SELECT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID GROUP BY T1.Device_ID HAVING COUNT(*) > 1


Question:
How many bookings do we have?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT COUNT(*) FROM BOOKINGS


Question:
Count the total number of bookings made.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT COUNT(*) FROM BOOKINGS


Question:
List the order dates of all the bookings.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Order_Date FROM BOOKINGS


Question:
What is the order date of each booking?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Order_Date FROM BOOKINGS


Question:
Show all the planned delivery dates and actual delivery dates of bookings.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Planned_Delivery_Date, Actual_Delivery_Date FROM BOOKINGS


Question:
What are the planned delivery date and actual delivery date for each booking?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Planned_Delivery_Date, Actual_Delivery_Date FROM BOOKINGS


Question:
How many customers do we have?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT COUNT(*) FROM CUSTOMERS


Question:
Count the number of customers recorded.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT COUNT(*) FROM CUSTOMERS


Question:
What are the phone and email for customer Harold?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Customer_Phone, Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name = 'Harold'


Question:
Find the phone number and email address of customer 'Harold'.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Customer_Phone, Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name = 'Harold'


Question:
Show all the Store_Name of drama workshop groups.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Store_Name FROM Drama_Workshop_Groups


Question:
What are the store names of drama workshop groups?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Store_Name FROM Drama_Workshop_Groups


Question:
Show the minimum, average, maximum order quantity of all invoices.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT MIN(Order_Quantity), AVG(Order_Quantity), MAX(Order_Quantity) FROM INVOICES


Question:
What are the minimum, average, and maximum quantities ordered? Check all the invoices.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT MIN(Order_Quantity), AVG(Order_Quantity), MAX(Order_Quantity) FROM INVOICES


Question:
What are the distinct payment method codes in all the invoices?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT DISTINCT payment_method_code FROM INVOICES


Question:
Show me the distinct payment method codes from the invoice record.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT DISTINCT payment_method_code FROM INVOICES


Question:
What is the description of the marketing region China?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name = 'China'


Question:
Find the marketing region description of China?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name = 'China'


Question:
Show all the distinct product names with price higher than the average.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price > (SELECT AVG(Product_Price) FROM PRODUCTS)


Question:
What are the distinct names of the products that cost more than the average?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price > (SELECT AVG(Product_Price) FROM PRODUCTS)


Question:
What is the name of the most expensive product?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1


Question:
Tell me the name of the most pricy product.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1


Question:
List all product names in ascending order of price.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Product_Name FROM Products ORDER BY Product_Price ASC NULLS FIRST


Question:
Sort the names of products in ascending order of their price.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Product_Name FROM Products ORDER BY Product_Price ASC NULLS FIRST


Question:
What is the phone number of the performer Ashley?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name = 'Ashley'


Question:
Find the phone number of performer 'Ashley'.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name = 'Ashley'


Question:
Show all payment method codes and the number of orders for each code.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT payment_method_code, COUNT(*) FROM INVOICES GROUP BY payment_method_code


Question:
List the distinct payment method codes with the number of orders made
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT payment_method_code, COUNT(*) FROM INVOICES GROUP BY payment_method_code


Question:
What is the payment method code used by the most orders?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the payment method that is used the most often in all the invoices. Give me its code.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which city is the address of the store named 'FJA Filming' located in?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.City_Town FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Store_Name = 'FJA Filming'


Question:
Find the city the store named 'FJA Filming' is in.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.City_Town FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Store_Name = 'FJA Filming'


Question:
What are the states or counties of the address of the stores with marketing region code 'CA'?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Marketing_Region_Code = 'CA'


Question:
Find the states or counties where the stores with marketing region code 'CA' are located.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Marketing_Region_Code = 'CA'


Question:
What is the name of the marketing region that the store Rob Dinning belongs to?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code = T2.Marketing_Region_Code WHERE T2.Store_Name = 'Rob Dinning'


Question:
Return the name of the marketing region the store Rob Dinning is located in.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code = T2.Marketing_Region_Code WHERE T2.Store_Name = 'Rob Dinning'


Question:
What are the descriptions of the service types with product price above 100?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100


Question:
Give me the descriptions of the service types that cost more than 100.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100


Question:
What is the description, code and the corresponding count of each service type?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Service_Type_Description, T2.Service_Type_Code, COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T2.Service_Type_Code


Question:
List the description, code and the number of services for each service type.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Service_Type_Description, T2.Service_Type_Code, COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T2.Service_Type_Code


Question:
What is the description and code of the type of service that is performed the most often?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Service_Type_Description, T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the description and code of the service type that is performed the most times.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Service_Type_Description, T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are the phones and emails of workshop groups in which services are performed?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID


Question:
Give me all the phone numbers and email addresses of the workshop groups where services are performed.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID


Question:
What are the names of workshop groups in which services with product name 'film' are performed?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T2.Product_Name = 'film'


Question:
Find the names of the workshop groups where services with product name 'film' are performed.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T2.Product_Name = 'film'


Question:
What are the different product names? What is the average product price for each of them?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Product_Name, AVG(Product_Price) FROM PRODUCTS GROUP BY Product_Name


Question:
For each distinct product name, show its average product price.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Product_Name, AVG(Product_Price) FROM PRODUCTS GROUP BY Product_Name


Question:
What are the product names with average product price smaller than 1000000?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING AVG(Product_Price) < 1000000


Question:
Find the product names whose average product price is below 1000000.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING AVG(Product_Price) < 1000000


Question:
What are the total order quantities of photo products?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT SUM(T1.Order_Quantity) FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_Name = 'photo'


Question:
Compute the total order quantities of the product 'photo'.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT SUM(T1.Order_Quantity) FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_Name = 'photo'


Question:
What are the order details of the products with price higher than 2000?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_price > 2000


Question:
Find the order detail for the products with price above 2000.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_price > 2000


Question:
What are the actual delivery dates of orders with quantity 1?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1


Question:
List the actual delivery date for all the orders with quantity 1
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1


Question:
What are the order dates of orders with price higher than 1000?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Order_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_price > 1000


Question:
Find the order dates of the orders with price above 1000.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Order_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_price > 1000


Question:
How many distinct currency codes are there for all drama workshop groups?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT COUNT(DISTINCT Currency_Code) FROM Drama_Workshop_Groups


Question:
Find the number of distinct currency codes used in drama workshop groups.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT COUNT(DISTINCT Currency_Code) FROM Drama_Workshop_Groups


Question:
What are the names of the drama workshop groups with address in Feliciaberg city?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.City_Town = 'Feliciaberg'


Question:
Return the the names of the drama workshop groups that are located in Feliciaberg city.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.City_Town = 'Feliciaberg'


Question:
What are the email addresses of the drama workshop groups with address in Alaska state?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T2.Store_Email_Address FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.State_County = 'Alaska'


Question:
List the email addresses of the drama workshop groups located in Alaska state.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T2.Store_Email_Address FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.State_County = 'Alaska'


Question:
Show all cities along with the number of drama workshop groups in each city.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town


Question:
How many drama workshop groups are there in each city? Return both the city and the count.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town


Question:
What is the marketing region code that has the most drama workshop groups?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Marketing_Region_Code FROM Drama_Workshop_Groups GROUP BY Marketing_Region_Code ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which marketing region has the most drama workshop groups? Give me the region code.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Marketing_Region_Code FROM Drama_Workshop_Groups GROUP BY Marketing_Region_Code ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show all cities where at least one customer lives in but no performer lives in.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID = T2.Address_ID EXCEPT SELECT T1.City_Town FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = T2.Address_ID


Question:
Which cities have at least one customer but no performer?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID = T2.Address_ID EXCEPT SELECT T1.City_Town FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = T2.Address_ID


Question:
What is the most frequent status of bookings?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which status code is the most common of all the bookings?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are the names of the workshop groups that have bookings with status code 'stop'?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = 'stop'


Question:
Which workshop groups have bookings with status code 'stop'? Give me the names.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = 'stop'


Question:
Show the names of all the clients with no booking.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Customer_Name FROM Clients EXCEPT SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID = T2.Client_ID


Question:
What are the names of the clients who do not have any booking?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Customer_Name FROM Clients EXCEPT SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID = T2.Client_ID


Question:
What is the average quantities ordered with payment method code 'MasterCard' on invoices?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT AVG(Order_Quantity) FROM Invoices WHERE payment_method_code = 'MasterCard'


Question:
Check the invoices record and compute the average quantities ordered with the payment method 'MasterCard'.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT AVG(Order_Quantity) FROM Invoices WHERE payment_method_code = 'MasterCard'


Question:
What is the product ID of the most frequently ordered item on invoices?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Product_ID FROM INVOICES GROUP BY Product_ID ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the id of the product ordered the most often on invoices.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Product_ID FROM INVOICES GROUP BY Product_ID ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the description of the service type which offers both the photo product and the film product?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'photo' INTERSECT SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'film'


Question:
Give me the description of the service type that offers not only the photo product but also the film product.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'photo' INTERSECT SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'film'


Question:
How many bands are there?
Additional table information: table: music_2

Answer: SELECT COUNT(*) FROM Band


Question:
Find the number of bands.
Additional table information: table: music_2

Answer: SELECT COUNT(*) FROM Band


Question:
What are all the labels?
Additional table information: table: music_2

Answer: SELECT DISTINCT label FROM Albums


Question:
What are the different album labels listed?
Additional table information: table: music_2

Answer: SELECT DISTINCT label FROM Albums


Question:
Find all the albums in 2012.
Additional table information: table: music_2

Answer: SELECT * FROM Albums WHERE YEAR = 2012


Question:
return all columns of the albums created in the year of 2012.
Additional table information: table: music_2

Answer: SELECT * FROM Albums WHERE YEAR = 2012


Question:
Find all the stage positions of the musicians with first name 'Solveig'
Additional table information: table: music_2

Answer: SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE Firstname = 'Solveig'