Database: beer_factory
Question: Tally the email addresses and phone numbers of customers from Sacramento who gave a star rating of more than 3 in 2014.
Evidence: email addresses refers to Email; Sacramento refers to City = 'Sacramento'; star rating of more than 3 refers to StarRating > 3; in 2014 refers to ReviewDate LIKE '2014%';
SQL: SELECT DISTINCT T1.Email, T1.PhoneNumber FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.StarRating > 3 AND T1.City = 'Sacramento' AND T2.ReviewDate BETWEEN '2014-01-01' AND '2014-12-31'

Database: shipping
Question: In total, how many shipments were transported to Olympic Camper Sales Inc?
Evidence: "Olympic Camper Sales Inc" is the cust_name
SQL: SELECT COUNT(T2.ship_id) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_name = 'Olympic Camper Sales Inc'

Database: retail_complains
Question: Write the complaint ID, call ID, and final phone number of complaints through AVIDAN server from 1/1/2014 to 12/30/2014.
Evidence: final phone number refers to phonefinal; from 1/1/2014 to 12/30/2014 refers to Date received between '2014-01-01' and '2014-12-30'
SQL: SELECT `Complaint ID`, call_id, phonefinal FROM callcenterlogs WHERE strftime('%Y', `Date received`) = '2014' AND server = 'AVIDAN'

Database: app_store
Question: For the Akinator app, how many reviews have sentiment subjectivity of no more than 0.5 and what is its current version?
Evidence: Sentiment_Subjectivity<0.5; current version refers to Current Ver;
SQL: SELECT COUNT(T2.Sentiment_Subjectivity), T1."Current Ver" FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Akinator' AND T2.Sentiment_Subjectivity < 0.5

Database: talkingdata
Question: Which gender owned more of the Galaxy Note 2 device model?
Evidence: gender that owned more = SUBTRACT(IF(SUM(gender = 'M'), SUM(gender = 'F'),'M','F'));
SQL: SELECT IIF(SUM(IIF(T1.gender = 'M', 1, 0)) - SUM(IIF(T1.gender = 'F', 1, 0)) > 0, 'M', 'F') AS gender FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Galaxy Note 2'

Database: soccer_2016
Question: How many players were born in the 90s?
Evidence: born in the 90s refers to DOB > = '1990-01-01' AND DOB < = '1999-12-31'
SQL: SELECT COUNT(Player_Id) AS cnt FROM Player WHERE DOB BETWEEN '1990-01-01' AND '1999-12-31'

Database: student_loan
Question: List the longest duration of absense for a student enlisted in the fire department.
Evidence: longest duration of absence refers to MAX(month); department refers to organ; organ = 'fire_department';
SQL: SELECT T1.month FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'fire_department' ORDER BY T1.month DESC LIMIT 1

Database: retail_world
Question: How many employees in total are in charge of the sales in the Eastern Region?
Evidence: Eastern Region refers to RegionDescription = 'Eastern';
SQL: SELECT COUNT(T.EmployeeID) FROM ( SELECT T3.EmployeeID FROM Region AS T1 INNER JOIN Territories AS T2 ON T1.RegionID = T2.RegionID INNER JOIN EmployeeTerritories AS T3 ON T2.TerritoryID = T3.TerritoryID WHERE T1.RegionDescription = 'Eastern' GROUP BY T3.EmployeeID ) T

Database: authors
Question: How many papers were published in 2005. Calculate the difference between the number of paper published in 2005 and the number of paper published in the previous year.
Evidence: published in 2005 refer to Year = 2005; Difference refer to SUBTRACT(SUM(Year = 2005). SUM(Year = 2004))
SQL: SELECT SUM(CASE WHEN Year = 2005 THEN 1 ELSE 0 END) , SUM(CASE WHEN year = 2005 THEN 1 ELSE 0 END) - SUM(CASE WHEN year = 2004 THEN 1 ELSE 0 END) AS diff FROM Paper

Database: social_media
Question: What is the gender of the user who posted a tweet with ID tw-682714583044243456?
Evidence: "tw-682714583044243456" is the TweetID
SQL: SELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.TweetID = 'tw-682714583044243456'

Database: books
Question: Who wrote "The Prophet"?
Evidence: "The Prophet" is the title of the book: who wrote refers to author_name
SQL: SELECT T3.author_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T1.title = 'The Prophet'

Database: chicago_crime
Question: What is the beat and location description of the case JB112212?
Evidence: case JB112212 refers to case_number = 'JB112212'
SQL: SELECT beat, location_description FROM Crime WHERE case_number = 'JB112212'

Database: world_development_indicators
Question: How much is the total urban population of middle income countries in 1960?
Evidence: IncomeGroup = 'Middle income'; Year = 1960; urban population refers to IndicatorName;
SQL: SELECT SUM(T2.Value) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IncomeGroup LIKE '%middle income' AND T2.Year = 1960 AND T2.IndicatorName = 'Urban population'

Database: professional_basketball
Question: List the first name, last name, height and weight of the players who has all free throw attempted successfully made.
Evidence: all free throw attempted successfully made refers to ftAttempted > 0 and ftAttempted = ftMade
SQL: SELECT DISTINCT T1.firstName, T1.lastName, T1.height, T1.weight FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.ft_attempted > 0 AND ft_attempted = ft_made

Database: soccer_2016
Question: How many matches were played by the player with player ID 2?
Evidence: player ID 2 refers to Player_Id = 2
SQL: SELECT SUM(CASE WHEN Player_Id = 2 THEN 1 ELSE 0 END) FROM Player_Match

Database: student_loan
Question: List down the enrolled schools and duration of student214.
Evidence: enrolled schools refers to school; duration refers to month; student214 is a name of student;
SQL: SELECT school, month FROM enrolled WHERE name = 'student214'

Database: cookbook
Question: What kind of preparation is needed for apple juice to make a raspberry-pear couscous cake?
Evidence: apple juice is a name of an ingredient; raspberry-pear couscous cake refers to title
SQL: SELECT T2.preparation FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Raspberry-Pear Couscous Cake' AND T3.name = 'apple juice'

Database: retail_complains
Question: For how long did the complaint filed on 2017/3/27 by Rachel Hicks last?
Evidence: how long did the complaint filed last refers to ser_time; on 2017/3/27 refers to "Date received" = '2017-03-27';
SQL: SELECT T2.ser_time FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.first = 'Rachel' AND T1.last = 'Hicks' AND T2.`Date received` = '2017-03-27'

Database: public_review_platform
Question: When does Yelp_Business no.1 open on Tuesdays?
Evidence: Yelp_Business no.1 refers to business_id = 1; open on refers to opening_time; Tuesdays refers to day_of_week = 'Tuesday'
SQL: SELECT T1.opening_time FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id WHERE T2.day_of_week LIKE 'Tuesday' AND T1.business_id = 1

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

Database: public_review_platform
Question: Which city has more Yelp_Business that's more appealing to users, Scottsdale or Anthem?
Evidence: more appealing to users refers to MAX(review_count);
SQL: SELECT city FROM Business ORDER BY review_count DESC LIMIT 1