Database: public_review_platform
Question: How many of the businesses are in Surprise?
Evidence: Surprise is a city
SQL: SELECT COUNT(business_id) FROM Business WHERE city = 'Surprise'

Database: shipping
Question: Where was shipment no. 1002 headed?
Evidence: shipment no. 1002 refers to ship_id = 1002; where shipment was headed refers to city_name
SQL: SELECT T2.city_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1002'

Database: regional_sales
Question: Indicate the name of the customers who have placed an order of 3 units in February 2018.
Evidence: name of customer refers to Customer Names; order of 3 unit refers to Order Quantity = 3; in February 2018 refers to OrderDate LIKE '2/%/18'
SQL: SELECT T FROM ( SELECT DISTINCT CASE  WHEN T2.`Order Quantity` = 3 AND T2.OrderDate LIKE '2/%/18' THEN T1.`Customer Names` END AS T FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID ) WHERE T IS NOT NULL

Database: retail_world
Question: Calculate the average price of products shipped to the UK.
Evidence: average price = divide(sum(UnitPrice) , count(ProductID)); the UK refers to Country = 'UK'
SQL: SELECT AVG(UnitPrice) AS avg FROM Invoices WHERE Country = 'UK'

Database: movie_3
Question: Write down any five film names under the documentary category.
Evidence: "Documentary" is the name of category; film name refers to title
SQL: SELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Documentary' LIMIT 5

Database: student_loan
Question: How many unemployed and bankrupt students that have payment dues?
Evidence: have payment dues refers to bool = 'pos'
SQL: SELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.name = T2.name INNER JOIN no_payment_due AS T3 ON T2.name = T3.name WHERE T3.bool = 'pos'

Database: sales_in_weather
Question: What is the total number of units of item no.5 sold in store no.3 in 2012 on days when the temperature was below the 30-year normal?
Evidence: item no.5 refers to item_nbr = 5; store no. 3 refers to store_nbr = 3; when the temperature was below the 30-year normal refers to depart < 0; in 2012 refers to SUBSTR(date, 1, 4) = '2012'; total number of units refers to Sum(units)
SQL: SELECT SUM(CASE WHEN T3.depart < 0 THEN units ELSE 0 END) AS sum FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND SUBSTR(T1.`date`, 1, 4) = '2012' AND T1.item_nbr = 5

Database: restaurant
Question: List by its ID number all restaurants on 11th Street in Oakland.
Evidence: 11th Street refers to street_name = '11th street'; Oakland refers to city = 'oakland'; ID number of restaurant refers to id_restaurant


SQL: SELECT id_restaurant FROM location WHERE city = 'oakland' AND street_name = '11th street'

Database: donor
Question: What is the average amount of resources from projects that have received donations per honoree?
Evidence: donations per honoree refers to for_honoree = 't'; average refers to DIVIDE(sum(item_quantity), count(donationid))
SQL: SELECT AVG(T1.item_quantity) FROM resources AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.for_honoree = 't'

Database: movie_3
Question: List all the animation titles.
Evidence: 'animation' is a name of a category
SQL: SELECT T3.title AS per FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.name = 'Animation'

Database: disney
Question: Who is the director of the adventure movie which was released on 2007/3/30?
Evidence: released on 2007/3/30 refers to release_date = 'Mar 30, 2007'; adventure movie refers to genre = 'Adventure' ;
SQL: SELECT T1.director FROM director AS T1 INNER JOIN movies_total_gross AS T2 ON T2.movie_title = T1.name WHERE T2.genre = 'Adventure' AND T2.release_date = 'Mar 30, 2007'

Database: simpson_episodes
Question: Write down the summary of episode whereby it has crew members that are not included in the credit list.
Evidence: are not included in the credit list refers to credited = ''
SQL: SELECT T1.summary FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.credited = 'false';

Database: regional_sales
Question: Which product has the highest net profit in 2019?
Evidence: net profit can be computed as SUBTRACT(Unit Price, Unit Cost); the highest net profit in 2019 refers to MAX(Net Profit) where OrderDate LIKE '%/19'; product refers to Product Name;
SQL: SELECT T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T1.OrderDate LIKE '%/%/19' ORDER BY REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') DESC LIMIT 1

Database: donor
Question: What is the name of the vendors serving material for projects for grades 9-12?
Evidence: for grades 9-12 refers to grade_level = 'Grades 9-12'
SQL: SELECT DISTINCT T1.vendor_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.grade_level = 'Grades 9-12'

Database: language_corpus
Question: How many words have repetitions greater than 2000 and lower than 5000?
Evidence: repetitions greater than 2000 and lower than 5000 refer to occurrences between 2000 and 5000;
SQL: SELECT COUNT(wid) FROM langs_words WHERE occurrences BETWEEN '2000' AND '5000'

Database: donor
Question: In which cities are Los Angeles County Suburban Metro Schools located?
Evidence: Los Angeles County refers to school_county = 'Los Angeles'
SQL: SELECT school_city FROM projects WHERE school_metro = 'suburban' AND school_county = 'Los Angeles'

Database: retail_complains
Question: How many clients with the last name Alvarado are from Maryland?
Evidence: The abbreviation of Maryland is 'MD';
SQL: SELECT COUNT(T2.client_id) FROM district AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T1.state_abbrev = T3.StateCode WHERE T2.last = 'Alvarado' AND T2.state = 'MD'

Database: address
Question: What is the highest gender ratio of the residential areas in Arecibo county?
Evidence: "ARECIBO" is the county; highest gender ration refers to Max(Divide (male_population, female_population))
SQL: SELECT CAST(T1.male_population AS REAL) / T1.female_population FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'ARECIBO' AND T1.female_population <> 0 ORDER BY 1 DESC LIMIT 1

Database: retails
Question: Please list the order keys of all the orders made by a customer whose account is in debt.
Evidence: account is in debt if c_acctbal < 0;
SQL: SELECT T1.o_orderkey FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_acctbal < 0

Database: college_completion
Question: How many students graduated from Central Alabama Community College in 2011 in total?
Evidence: Central Alabama Community College refers to chronname = 'Central Alabama Community College'; in 2011 refers to year = 2011;
SQL: SELECT T2.grad_cohort FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T1.chronname = 'Central Alabama Community College' AND T2.year = 2011

Database: movie_3
Question: How many times is the number of films Gina DeGeneres acted in than Penelope Guinness?
Evidence: "Gina DeGeneres" and "Penelope Guinness" are both full name of actor; times number of film = Divide (Count (film_id where first_name = 'GINA' and last_name = 'DEGENERES'), Count(film_id where first_name = 'PENELOPE' and last_name = 'GUINESS'))
SQL: SELECT CAST(SUM(IIF(T2.first_name = 'GINA' AND T2.last_name = 'DEGENERES', 1, 0)) AS REAL) * 100 / SUM(IIF(T2.first_name = 'PENELOPE' AND T2.last_name = 'GUINESS', 1, 0)) FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id