Database: sales_in_weather
Question: How many items were sold by store 9 during a snowy day?
Evidence: store 9 refers to store_nbr = 9; snowy day refers to snowfall < > 0 and snowfall is not null; item refers to item_nbr
SQL: SELECT COUNT(DISTINCT item_nbr) FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr INNER JOIN sales_in_weather AS T3 ON T2.store_nbr = T3.store_nbr WHERE T3.store_nbr = 9 AND T1.snowfall <> 0 AND T1.snowfall IS NOT NULL

Database: legislator
Question: Give the alphanumeric ID of the Catholic legislators in Nebraska.
Evidence: alphanumeric ID refers to bioguide; Catholic legislators refers to religion_bio = 'Catholic'; Nebraska refers to state = 'NE';
SQL: SELECT T1.bioguide FROM `current-terms` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.religion_bio = 'Catholic' AND T1.state = 'NE'

Database: professional_basketball
Question: Please list the top ten teams with the highest scores in 2000.
Evidence: in 2000 refers to year = 2000; team with highest score refers to Max(o_fgm)
SQL: SELECT tmID FROM players_teams WHERE year = 2000 GROUP BY tmID ORDER BY SUM(PostPoints) DESC LIMIT 10

Database: authors
Question: Sate the author name and published year for paper id 2?
Evidence: published year refers to year
SQL: SELECT T1.Name, T3.Year FROM Author AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.AuthorId INNER JOIN Paper AS T3 ON T2.PaperId = T3.Id WHERE T2.PaperId = 2

Database: airline
Question: Please list the departure airports of the flights on 2018/8/1 that were delayed.
Evidence: departure airports refers ORIGIN; on 2018/8/1 refers to FL_DATE = '2018/8/1'; delayed refers to DEP_DELAY > 0;
SQL: SELECT T1.Description FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE = '2018/8/1' AND T2.DEP_DELAY > 0 GROUP BY T1.Description

Database: airline
Question: How many flights on the 1st of August 2018 were coming from Allentown, Pennsylvania?
Evidence: 1st of August 2018 refers to FL_DATE = '2018/8/1'; coming from Allentown, Pennsylvania refers to ORIGIN = 'ABE';
SQL: SELECT COUNT(*) FROM Airlines WHERE FL_DATE = '2018/8/1' AND ORIGIN = 'ABE'

Database: talkingdata
Question: How many active users were there in the event id 2?
Evidence: active users refers to is_active = 1;
SQL: SELECT COUNT(is_active) FROM app_events WHERE event_id = 2 AND is_active = 1

Database: talkingdata
Question: Which phone brand and model was used for event ID "6701"?
Evidence: model refers to device_model;
SQL: SELECT T2.phone_brand, T2.device_model FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.event_id = 6701

Database: computer_student
Question: Describe the course level and list of person IDs who taught course ID of 147.
Evidence: person IDs refers to taughtBy.p_id; course ID of 147 refers to course.course_id = 147
SQL: SELECT T1.courseLevel, T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 141

Database: app_store
Question: Which 1,000,000,000+ intalls apps has the most no comment reviews?
Evidence: no comment refers to Translated_Review = 'nan'; most no comment reviews = (MAX(COUNT(Translated_Review = 'nan')));
SQL: SELECT T1.App FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Installs = '1,000,000+' AND T2.Translated_Review = 'nan' GROUP BY T1.App ORDER BY COUNT(T2.Translated_Review) DESC LIMIT 1

Database: beer_factory
Question: What did the customer say in his or her review of Bulldog root beer on 7/26/2013?
Evidence: Bulldog refers to BrandName = 'Bulldog'; on 7/26/2013 refers to ReviewDate = '2013-07-26';
SQL: SELECT T2.Review FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T1.BrandName = 'Bulldog' AND T2.ReviewDate = '2013-07-26'

Database: address
Question: Provide the average elevation of the cities with alias Amherst.
Evidence: AVG(elevation) where alias = 'Amherst';
SQL: SELECT AVG(T2.elevation) FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.alias = 'Amherst'

Database: car_retails
Question: How many distinct orders were there in 2003 when the quantity ordered was less than 30?
Evidence: year(orderDate) = '2003'; quantityOrdered < 30;
SQL: SELECT COUNT(DISTINCT T1.orderNumber) FROM orderdetails AS T1 INNER JOIN orders AS T2 ON T1.orderNumber = T2.orderNumber WHERE T1.quantityOrdered < 30 AND STRFTIME('%Y', T2.orderDate) = '2003'

Database: cars
Question: Calculate the percentage of American cars among all cars.
Evidence: American car refers to country = 'USA'; percentage = divide(count(ID where country = 'USA'), count(ID)) * 100%
SQL: SELECT CAST(SUM(CASE WHEN T3.country = 'USA' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country

Database: legislator
Question: How many males were members of the current legislators?
Evidence: male refers to gender_bio = 'M'
SQL: SELECT COUNT(*) FROM current WHERE gender_bio = 'M'

Database: professional_basketball
Question: Among the players from the ABA league, how many of them have the center position?
Evidence: "ABA" is the lgID; center position refers to pos =   'C' or pos = 'F-C'; players refers to playerID
SQL: SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.lgID = 'ABA' AND (T1.pos = 'C' OR T1.pos = 'F-C')

Database: beer_factory
Question: In the female customers, how many bought root beer that contains artificial sweetener?
Evidence: female refers to Gender = 'F'; contains artificial sweetener refers to ArtificialSweetener = 'TRUE';
SQL: SELECT COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeer AS T3 ON T2.RootBeerID = T3.RootBeerID INNER JOIN rootbeerbrand AS T4 ON T3.BrandID = T4.BrandID WHERE T1.Gender = 'F' AND T4.ArtificialSweetener = 'TRUE'

Database: chicago_crime
Question: Which district in Chicago has the most community areas?
Evidence: district refers to side; the most community areas refers to max(count(side))
SQL: SELECT side FROM Community_Area GROUP BY side ORDER BY COUNT(side) DESC LIMIT 1

Database: retail_world
Question: How many non-discontinued products are there in the dairy category?
Evidence: non-discontinued products in the dairy category refer to ProductID where Discontinued = 0 and CategoryName = 'Dairy Products';
SQL: SELECT COUNT(T1.CategoryID) FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.CategoryName = 'Dairy Products' AND T2.Discontinued = 0

Database: video_games
Question: Provide the name of game produced by 505 Games in 2006.
Evidence: name of game refers to game_name; 505 Games refers to publisher_name = '505 Games'; in 2006 refers to release_year = 2006;
SQL: SELECT T3.game_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN publisher AS T4 ON T2.publisher_id = T4.id WHERE T4.publisher_name = '505 Games' AND T1.release_year = 2006

Database: food_inspection
Question: What percentage of the violations for "Melody Lounge" are moderate risks?
Evidence: DIVIDE(COUNT(risk_category = 'Moderate Risk' where name = 'Melody Lounge'), COUNT(business_id where name = 'Melody Lounge')) as percentage;
SQL: SELECT CAST(SUM(CASE WHEN T2.risk_category = 'Moderate Risk' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.business_id) FROM businesses AS T1 INNER JOIN violations AS T2 ON T1.business_id = T2.business_id WHERE T1.name = 'Melody Lounge'

Database: movies_4
Question: List the movies released in 1945.
Evidence: List the movies refers to title; released in 1945 refers to release_date LIKE '1945%'
SQL: SELECT title FROM movie WHERE CAST(STRFTIME('%Y', release_date) AS INT) = 1945