Database: retail_world
Question: What proportion of orders are taken by the Sales Representative?
Evidence: DIVIDE(COUNT(OrderID where Title = 'Sales Representative'), COUNT(OrderID)) as percentage;
SQL: SELECT CAST(COUNT(CASE WHEN T1.Title = 'Sales Representative' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.OrderID) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID

Database: cs_semester
Question: What is the name of the course with the highest satisfaction from students?
Evidence: sat refers to student's satisfaction degree with the course where sat = 5 stands for the highest satisfaction;
SQL: SELECT DISTINCT T2.name FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.sat = 5

Database: chicago_crime
Question: What is the fax number for the district with the most number of crimes in January, 2018?
Evidence: fax number refers to fax; the most number of crimes refers to max(count(case_number)); in January 2018 refers to date like '%1/2018%'
SQL: SELECT T1.fax FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T2.date LIKE '%1/2018%' GROUP BY T2.district_no ORDER BY COUNT(case_number) DESC LIMIT 1

Database: ice_hockey_draft
Question: What is the average height in centimeters of all the players in the position of defense?
Evidence: average = AVG(height_in_cm); players refers to PlayerName; position of defense refers to position_info = 'D' ;
SQL: SELECT CAST(SUM(T2.height_in_cm) AS REAL) / COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T1.position_info = 'D'

Database: university
Question: What is the average score of all universities in 2012?
Evidence: average score refers to avg(score); in 2012 refers to year = 2012
SQL: SELECT AVG(score) FROM university_ranking_year WHERE year = 2012

Database: public_review_platform
Question: What city does the business came from where they received a high volume of check-ins from 12 am to 1 am on Saturday.
Evidence: 12 am refers to opening_time = '12AM'; 1 am refers to closing_time = '1AM'; on Saturday refers to day_of_week = 'Saturday'
SQL: SELECT T1.city FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T2.closing_time = '1AM' AND T2.opening_time = '12AM' AND T3.day_of_week = 'Saturday'

Database: retails
Question: What is the order priority of the order with the highest total price?
Evidence: order with the highest total price refers to MAX(o_totalprice);
SQL: SELECT o_orderpriority FROM orders WHERE o_totalprice = ( SELECT MAX(o_totalprice) FROM orders )

Database: food_inspection
Question: Which business had the most number of high risk violations? Give the name of the business.
Evidence: the most number of high risk violations refers to MAX(COUNT(business_id)) where risk_category = 'High';
SQL: SELECT T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' GROUP BY T2.name ORDER BY COUNT(T2.name) DESC LIMIT 1

Database: music_platform_2
Question: What are the titles and categories of all the podcasts with a review that has "Absolutely fantastic" in it?
Evidence: review refers to content; 'Absolutely fantastic' in it refers to content like '%Absolutely fantastic%'
SQL: SELECT T2.title, T1.category FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T3.content LIKE '%Absolutely fantastic%'

Database: trains
Question: How many cars on train no.1 have the roof open?
Evidence: train no. 1 refers to train_id = 1; roof open refers to roof = 'none'
SQL: SELECT COUNT(id) FROM cars WHERE train_id = 1 AND roof = 'none'

Database: ice_hockey_draft
Question: How many players, who were drafted by Anaheim Ducks in 2008, have played for U.S. National U18 Team?
Evidence: drafted by Anaheim Ducks refers to overallby = 'Anaheim Ducks'; in 2008 refers to draftyear = 2008; played for U.S. National U18 Team refers to TEAM = 'U.S. National U18 Team';
SQL: SELECT COUNT(DISTINCT T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.overallby = 'Anaheim Ducks' AND T1.draftyear = 2008 AND T2.TEAM = 'U.S. National U18 Team'

Database: simpson_episodes
Question: What is the average number of stars assigned to The simpson 20s: S20-E12? What is the said episode all about?
Evidence: average number of stars refers to AVG(stars); simpson 20s: S20-E12 refers to episode_id = 'S20-E12'; episode all about refers to summary
SQL: SELECT AVG(T2.stars), T1.summary FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.episode_id = 'S20-E12';

Database: car_retails
Question: Of all the classic cars, with a product scale of 1:18, which product is the most ordered product by customers?
Evidence: classic car is a product line; most ordered product refers to MAX(quantityOrdered);
SQL: SELECT T1.productName FROM products AS T1 INNER JOIN orderdetails AS T2 ON T1.productCode = T2.productCode WHERE T1.productScale = '1:18' AND T1.productLine = 'Classic Cars' GROUP BY T1.productName ORDER BY SUM(T2.quantityOrdered) DESC LIMIT 1

Database: world
Question: How many cities are there in the country with the surface area of 652090?
SQL: SELECT T2.Name, COUNT(T1.Name) FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.SurfaceArea = 652090 GROUP BY T2.Name

Database: car_retails
Question: List out full name of employees who are working in Boston?
Evidence: full name = contactFirstName, contactLastName; Boston is a city;
SQL: SELECT T1.firstName, T1.lastName FROM employees AS T1 INNER JOIN offices AS T2 ON T1.officeCode = T2.officeCode WHERE T2.city = 'Boston'

Database: software_company
Question: List down the number of inhabitants of customers with a divorced marital status and older than 50 years old.
Evidence: number of inhabitants refers to INHABITANTS_K; older than 50 years old refers to age < 50; MARITAL_STATUS = 'Divorced;
SQL: SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.MARITAL_STATUS = 'Divorced' AND T1.age < 50

Database: video_games
Question: How many games did Electronic Arts publish?
Evidence: Electronic Arts refers to publisher_name = 'Electronic Arts'
SQL: SELECT COUNT(DISTINCT T2.game_id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id WHERE T1.publisher_name = 'Electronic Arts'

Database: food_inspection
Question: Tell the Id number of the business with the most number of violations.
Evidence: Id number for that business refers to business_id; the most number of violations refers to MAX(COUNT(business_id));
SQL: SELECT business_id FROM violations GROUP BY business_id ORDER BY COUNT(business_id) DESC LIMIT 1

Database: movielens
Question: Which directors with the best quality directed the most films?
Evidence: d_quality = 5 refers to direct the best
SQL: SELECT T1.directorid FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid WHERE T1.d_quality = 5 GROUP BY T1.directorid ORDER BY COUNT(T2.movieid) DESC LIMIT 1

Database: retails
Question: What are the clerks of orders with line items shipped by mail?
Evidence: clerk refers to o_clerk; shipped by mail refers to l_shipmode = 'MAIL'
SQL: SELECT T1.o_clerk FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T2.l_shipmode = 'MAIL'

Database: disney
Question: What are the characters in the PG movies?
Evidence: PG is an abbreviation for parental guidance and refers to MPAA_rating = 'PG';
SQL: SELECT DISTINCT T2.character FROM movies_total_gross AS T1 INNER JOIN `voice-actors` AS T2 ON T1.movie_title = T2.movie WHERE T1.MPAA_rating = 'PG'