Database: talkingdata
Question: How many events in total have happened on the devices in 2016?
Evidence: in 2016 refers to `timestamp` LIKE '2016%';
SQL: SELECT COUNT(event_id) FROM `events` WHERE SUBSTR(`timestamp`, 1, 4) = '2016'

Database: authors
Question: Where was the 'A context-based navigation paradigm for accessing Web data' paper published? State the name of the conference.
Evidence: A context-based navigation paradigm for accessing Web data' is the title of paper; name of conference refer to FullName

SQL: SELECT T2.FullName FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Title = 'A context-based navigation paradigm for accessing Web data'

Database: regional_sales
Question: What is the customer names of orders which have unit cost greater than 4000USD?
Evidence: unit cost greater than 4000USD refers to Unit Cost > 4000;
SQL: SELECT T FROM ( SELECT DISTINCT CASE  WHEN T2.`Unit Cost` > 4000 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: retails
Question: Among all the customers in Brazil, how many of them have an account balance of less than 1000?
Evidence: customers refer to c_custkey; Brazil is the name of the nation which refers to n_name = 'BRAZIL'; account balance of less than 1000 refers to c_acctbal < 1000;
SQL: SELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'BRAZIL' AND T1.c_acctbal < 1000

Database: sales
Question: How many "Mountain-500 Black 42" were sold in total?
Evidence: Mountain-500 Black 42' is name of product; sold in total = SUM(Quantity);
SQL: SELECT SUM(T2.Quantity) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Mountain-500 Black, 42'

Database: olympics
Question: When John Aalberg took part in the 1994 Winter Olympic Game, how old was he?
Evidence: how old was he refers to age; 1994 Winter refers to games_name = '1994 Winter';
SQL: SELECT T2.age FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'John Aalberg' AND T1.games_name = '1994 Winter'

Database: sales_in_weather
Question: How many more units of item no.16 were sold on the day with the highest max temperature in 2012 in store no.5 than in store no.10?
Evidence: store no. 5 refers to store_nbr = 5; store no. 10 refers to store_nbr = 10; item no.16 refers to item_nbr = 16; in 2012 refers to SUBSTR(date, 1, 4) = '2012'; highest max temperature refers to Max(tmax); more units sold refers to Subtract ( Sum(units where store_nbr = 5), Sum(units where store_nbr = 10))
SQL: SELECT ( SELECT SUM(units) 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 T1.item_nbr = 16 AND T1.`date` LIKE '%2012%' AND T1.store_nbr = 5 GROUP BY tmax ORDER BY T3.tmax DESC LIMIT 1 ) - ( SELECT SUM(units) 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 T1.item_nbr = 16 AND T1.`date` LIKE '%2012%' AND T1.store_nbr = 6 GROUP BY tmax ORDER BY T3.tmax DESC LIMIT 1 )

Database: retail_world
Question: How many orders have asked for the product Tofu?
Evidence: product refers to ProductName;
SQL: SELECT COUNT(T2.OrderID) FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductName = 'Tofu'

Database: restaurant
Question: List restaurant ids located in Danville city.
SQL: SELECT id_restaurant FROM location WHERE city = 'Danville'

Database: computer_student
Question: How many professional or master/graduate courses are there?
Evidence: professional or master/graduate courses refers to courseLevel = 'Level_500'
SQL: SELECT COUNT(*) FROM course WHERE courseLevel = 'Level_500'

Database: professional_basketball
Question: Among the players born in Whitestone, how many of them have won the MVP?
Evidence: "Whitestone" is the birthCity of the player; won the MVP refers to award = 'Most Valuable Player'
SQL: SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Most Valuable Player' AND T1.birthCity = 'Houston'

Database: food_inspection_2
Question: Out of all the short form complaint inspections done by David Hodges, how many businesses passed?
Evidence: short form complaint inspection refers to inspection_type = 'Short Form Complaint'; pass refers to results = 'Pass'
SQL: SELECT COUNT(DISTINCT T2.license_no) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T1.first_name = 'David' AND T1.last_name = 'Hodges' AND T1.employee_id = 153225 AND T2.inspection_type = 'Short Form Complaint' AND T2.results = 'Pass'

Database: books
Question: How many orders were delivered in December 2019?
Evidence: delivered refers to status_value = 'Delivered'; in December 2019 refers to status_date LIKE '2019-12%'
SQL: SELECT COUNT(*) FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE T1.status_value = 'Delivered' AND STRFTIME('%Y', T2.status_date) = '2019'

Database: retail_complains
Question: Among the female clients, how many of them have a complaint with a priority of 1?
Evidence: female refers to sex = 'Female'
SQL: SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.sex = 'Female' AND T2.priority = 1

Database: talkingdata
Question: How many male users of the "Galaxy S5" device model?
Evidence: male refers to gender = 'M';
SQL: SELECT COUNT(T1.device_id) FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id WHERE T1.device_model = 'Galaxy S5' AND T2.gender = 'M'

Database: olympics
Question: How many persons participated in the Sapporo Olympics?
Evidence: the Sapporo Olympics refer to games_id where city_name = 'Sapporo';
SQL: SELECT COUNT(T1.person_id) FROM games_competitor AS T1 INNER JOIN games_city AS T2 ON T1.games_id = T2.games_id INNER JOIN city AS T3 ON T2.city_id = T3.id WHERE T3.city_name = 'Sapporo'

Database: retails
Question: What are the total quantities of the items ordered by customer 101660 on 10/5/1995?
Evidence: total quantity refers to sum(l_quantity); customer 101660 refers to o_custkey = 101660; on 10/5/1995 refers to o_orderdate = '1995-10-05'
SQL: SELECT SUM(T2.l_quantity) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_orderdate = '1995-10-05' AND T1.o_custkey = 101660

Database: books
Question: What are the city addresses of the customers located in the United States of America?
Evidence: "United States of America" is the country_name
SQL: SELECT DISTINCT T2.city FROM country AS T1 INNER JOIN address AS T2 ON T1.country_id = T2.country_id WHERE T1.country_name = 'United States of America'

Database: soccer_2016
Question: Who is the winning team in a match held on April 26, 2009 with a winning margin of 6 points?
Evidence: winning margin of 6 points refers to Win_Margin = 6; held on April 26, 2009 refers to Match_Date = '2009-04-26'
SQL: SELECT T1.Team_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner WHERE T2.Win_Margin = 6 AND T2.Match_Date = '2009-04-26'

Database: disney
Question: Who is the voice actor of the hero in Lion King?
Evidence: Lion King refers to movie_title = 'Lion King';
SQL: SELECT T1.`voice-actor` FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title WHERE T2.movie_title = 'Lion King' AND T1.character = 'Lion King'