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

Database: address
Question: Compare the numbers of postal points under Smith Adrian and Heck Joe.
Evidence: COUNT(zip_code where first_name = 'Smith' and last_name = 'Adrian') > COUNT(zip_code where first_name = 'Heck' and last_name = 'Joe');
SQL: SELECT CASE WHEN COUNT(CASE WHEN T1.first_name = 'Smith' AND T1.last_name = 'Adrian' THEN T2.zip_code ELSE NULL END) > COUNT(CASE WHEN T1.first_name = 'Heck' AND T1.last_name = 'Joe' THEN T2.zip_code ELSE NULL END) THEN 'Smith Adrian>Heck Joe' ELSE 'Smith Adrian<=Heck Joe' END AS COMPARE FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district

Database: beer_factory
Question: Calculate the percentage of sales done at Sac State American River Courtyard.
Evidence: percentage =   MULTIPLY(DIVIDE(SUM(LocationName = 'Sac State American River Courtyard'), COUNT(LocationID)), 1.0); Sac State American River Courtyard refers to LocationName = 'Sac State American River Courtyard';
SQL: SELECT CAST(COUNT(CASE WHEN T2.LocationName = 'Sac State American River Courtyard' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.TransactionID) FROM `transaction` AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID

Database: car_retails
Question: What is the total price of the order made by Cruz & Sons Co. on 2003/3/3?
Evidence: SUM(MULTIPLY(quantityOrdered, priceEach)) where orderDate = '2003-03-03'; customerName = 'Cruz & Sons Co.'
SQL: SELECT SUM(t1.priceEach * t1.quantityOrdered) FROM orderdetails AS t1 INNER JOIN orders AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN customers AS t3 ON t2.customerNumber = t3.customerNumber WHERE t3.customerName = 'Cruz & Sons Co.' AND t2.orderDate = '2003-03-03'

Database: retail_complains
Question: Which complaint is more urgent, complaint ID CR2400594 or ID CR2405641?
Evidence: more urgent refers to MAX(priority);
SQL: SELECT CASE WHEN SUM(CASE WHEN `Complaint ID` = 'CR2400594' THEN priority END) > SUM(CASE WHEN `Complaint ID` = 'CR2405641' THEN priority END) THEN 'CR2400594' ELSE 'CR2405641' END FROM callcenterlogs

Database: retails
Question: What is the total number of suppliers from Germany?
Evidence: suppliers refer to s_suppkey; Germany is the name of the nation which refers to n_name = 'GERMANY';
SQL: SELECT COUNT(T1.s_suppkey) FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T2.n_name = 'GERMANY'

Database: professional_basketball
Question: In the year 1998, how many home wins did the team which had the 1st round, 12th pick have that year?
Evidence: in 1998 refers to year = 1998; 1st round refers to draftRound = 1; 12th pick refers to draftSelection = 12; home win refers to homeWon
SQL: SELECT T2.homeWon FROM draft AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.draftYear = T2.year WHERE T1.draftRound = 1 AND T1.draftSelection = 12 AND T1.draftYear = 1998

Database: public_review_platform
Question: How many hours does the Yelp business No. "5734" open on Saturday?
Evidence: how many hours = SUBTRACT(closing_time, opening_time); business No. refers to business_id; open on Saturday refers to day_of_week = 'Saturday';
SQL: SELECT T1.closing_time - T1.opening_time AS "hour" FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id WHERE T2.day_of_week LIKE 'Saturday' AND T1.business_id = 5734

Database: legislator
Question: What is the google entity ID of current legislator Sherrod Brown?
Evidence: Sherrod Brown is an official_full_name
SQL: SELECT google_entity_id_id FROM current WHERE official_full_name = 'Sherrod Brown'

Database: airline
Question: What is the description of the airline code 19049?
SQL: SELECT Description FROM `Air Carriers` WHERE Code = 19049

Database: image_and_language
Question: How many images have "picture" as their attribute class?
Evidence: images have "picture" as their attribute class refer to IMG_ID where ATT_CLASS = 'picture';
SQL: SELECT COUNT(T2.IMG_ID) FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.ATT_CLASS = 'picture'

Database: image_and_language
Question: Please list the IDs of all the images with more than 2 pairs of object samples with the relation "parked on".
Evidence: IDs of all the images refers to IMG_ID; relation "parked on" refers to PRED_CLASS = 'parked on'; more than 2 pairs refers to count(IMG_ID) where OBJ1_SAMPLE_ID ! = OBJ2_SAMPLE_ID
SQL: SELECT T2.IMG_ID FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.PRED_CLASS = 'parked on' AND T2.OBJ1_SAMPLE_ID != T2.OBJ2_SAMPLE_ID GROUP BY T2.IMG_ID HAVING COUNT(T2.IMG_ID) > 2

Database: ice_hockey_draft
Question: List out the name of players who weight 190 lbs.
Evidence: name of players refers to PlayerName; weight 190 lbs refers to weight_in_lbs = 190;
SQL: SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_lbs = 190

Database: car_retails
Question: Of the clients whose businesses are located in the city of Boston, calculate which of them has a higher average amount of payment.
Evidence: average amount payment = AVG(amount);
SQL: SELECT T1.customerNumber FROM customers AS T1 INNER JOIN payments AS T2 ON T1.customerNumber = T2.customerNumber WHERE T1.city = 'Boston' GROUP BY T1.customerNumber ORDER BY SUM(T2.amount) / COUNT(T2.paymentDate) DESC LIMIT 1

Database: legislator
Question: Calculate the percentage of famous_legislatorss.
Evidence: percentage = MULTIPLY(DIVIDE(SUM(wikipedia_id is not null), (bioguide_id)), 100.0); famous legislators refers to wikipedia_id is not null;
SQL: SELECT CAST(SUM(CASE WHEN wikipedia_id IS NOT NULL THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(bioguide_id) FROM historical

Database: public_review_platform
Question: For the business with great experience existed in Sun Lakes city, provide the user ID who gave review on it and user followers.
Evidence: with great experience refers to stars = 5
SQL: SELECT T3.user_id, T3.user_fans FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id INNER JOIN Users AS T3 ON T2.user_id = T3.user_id WHERE T1.city = 'Sun Lakes' AND T1.stars = 5

Database: retail_world
Question: Identify the name of the most popular dairy product in terms of reorder quantity.
Evidence: 'dairy product' refers to CategoryName; most popular reorder quantity refers to MAX(ReorderLevel)
SQL: SELECT T2.ProductName FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.CategoryName = 'Dairy Products' AND T2.ReorderLevel = ( SELECT MAX(ReorderLevel) FROM Products )

Database: human_resources
Question: In which city's office does Sandy Adams work at?
Evidence: Sandy Adams is the fullname of an employee; full name = firstname, lastname; city refers to locationcity
SQL: SELECT T2.locationcity FROM employee AS T1  INNER JOIN location AS T2  ON T1.locationID = T2.locationID WHERE T1.lastname = 'Adams' AND T1.firstname = 'Sandy'

Database: trains
Question: Among the trains running east, how many trains have at least 4 cars?
Evidence: east is a direction; at least 4 cars refers to carsNum > = 4
SQL: SELECT SUM(CASE WHEN T1.direction = 'east' THEN 1 ELSE 0 END)as count FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS carsNum FROM cars GROUP BY train_id ) AS T2 ON T1.id = T2.train_id WHERE T2.carsNum >= 4

Database: soccer_2016
Question: Which is the country of the city named "Rajkot"?
Evidence: city named "Rajkot" refers to city_name = 'Rajkot';
SQL: SELECT T1.Country_Name FROM Country AS T1 INNER JOIN city AS T2 ON T1.Country_Id = T2.Country_Id WHERE city_name = 'Rajkot'