Database: public_review_platform
Question: How many businesses have the category named food? List those businesses and find the percentage of businesses with less than 2 stars.
Evidence: businesses have the category named food refer to business_id where category_name = 'Food'; DIVIDE(COUNT(business_id where category_name = 'Food' and stars < 2), COUNT(business_id where category_name = 'Food')) as percentage;
SQL: SELECT T3.business_id, CAST((( SELECT COUNT(business_id) FROM Business WHERE stars < 2 ) - ( SELECT COUNT(business_id) FROM Business WHERE stars > 2 )) AS REAL) * 100 / ( SELECT COUNT(stars) FROM Business ) FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id WHERE T2.category_name = 'Food'

Database: retail_complains
Question: What is the average age of clients whose complaint type is "TT"?
Evidence: average age = avg(age where type = 'TT')
SQL: SELECT AVG(T1.age) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.type = 'TT'

Database: talkingdata
Question: What is the category that the most app users belong to?
Evidence: most app users refers to MAX(COUNT(app_id));
SQL: SELECT T.category FROM ( SELECT T1.category, COUNT(T2.app_id) AS num FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id GROUP BY T1.label_id ) AS T ORDER BY T.num DESC LIMIT 1

Database: movies_4
Question: What percentage of films are made in the US?
Evidence: films' and 'movies' are synonyms; made in the US refers to country_iso_code = 'US'; percentage = divide(sum(country_id) when country_iso_code = 'US', count(country_id)) * 100 as percentage
SQL: SELECT CAST(COUNT(CASE WHEN T3.COUNTry_iso_code = 'US' THEN T1.movie_id ELSE NULL END) AS REAL) * 100 / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id

Database: talkingdata
Question: To which user group do most of the users who uses a vivo device belong?
Evidence: user group where most of the users belong refers to MAX(COUNT(group)); vivo device refers to phone_brand = 'vivo';
SQL: SELECT T.`group` FROM ( SELECT T2.`group`, COUNT(`group`) AS num FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T2.device_id = T1.device_id WHERE T1.phone_brand = 'vivo' GROUP BY T2.`group` ) AS T ORDER BY T.num DESC LIMIT 1

Database: mental_health_survey
Question: What is the average number of respondents per survey between 2014 and 2019?
Evidence: respondents and 'users' are synonyms; average number = avg(count(userID(SurveyID = 2014)), count(userID(SurveyID = 2019)))
SQL: SELECT CAST(COUNT(SurveyID) AS REAL) / 5 FROM Answer WHERE SurveyID BETWEEN 2014 AND 2019

Database: books
Question: Calculate the percentage of the International shipping orders on 2022/11/10.
Evidence: International shipping order refers to method_name = 'International'; orders on 2022/11/10 refers to order_date LIKE '2022-11-10%'; percentage = Divide (Sum(order_id  where method_name = 'International'), Count(order_id)) * 100
SQL: SELECT CAST(SUM(CASE WHEN T1.method_name = 'International' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM shipping_method AS T1 INNER JOIN cust_order AS T2 ON T1.method_id = T2.shipping_method_id WHERE T2.order_date LIKE '2022-11-10%'

Database: public_review_platform
Question: What is the opening time of the active businesses in Chandler that has a medium review count.
Evidence: active businesses refers to active = 'true'; in Chandler refers to city = 'Chandler'
SQL: SELECT DISTINCT T2.opening_time 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 T1.city LIKE 'Chandler' AND T1.active LIKE 'TRUE' AND T1.review_count LIKE 'Medium'

Database: car_retails
Question: When was the product with the highest unit price shipped?
Evidence: The highest unit price refers to MAX(priceEach); when shipped refers to shippedDate;
SQL: SELECT t1.shippedDate FROM orders AS t1 INNER JOIN orderdetails AS t2 ON t1.orderNumber = t2.orderNumber ORDER BY t2.priceEach DESC LIMIT 1

Database: address
Question: Tell the name of the county which is represented by Hartzler Vicky.
Evidence: name of county refers to county
SQL: SELECT T1.county FROM country AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T3.first_name = 'Hartzler' AND T3.last_name = 'Vicky' GROUP BY T1.county

Database: bike_share_1
Question: Which trip had the longest duration? State the start and end station.
Evidence: start station refers to start_station_name; end station refers to end_station_name;
SQL: SELECT start_station_name, end_station_name FROM trip WHERE duration = ( SELECT MAX(duration) FROM trip )

Database: beer_factory
Question: What is the full name of the customer who gave a 5-star rating and commented "The quintessential dessert root beer. No ice cream required" on his review?
Evidence: full name = First, Last; 5-star rating refers to StarRating = 5; commented "The quintessential dessert root beer. No ice cream required" refers to Review = 'The quintessential dessert root beer. No ice cream required.';
SQL: SELECT T1.First, T1.Last FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.StarRating = 5 AND T2.Review = 'The quintessential dessert root beer. No ice cream required.'

Database: video_games
Question: What is the genre of the game "Mario vs. Donkey Kong"?
Evidence: genre refers to genre_name; game "Mario vs. Donkey Kong" refers to game_name = 'Mario vs. Donkey Kong'
SQL: SELECT T1.genre_name FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T2.game_name = 'Mario vs. Donkey Kong'

Database: food_inspection_2
Question: Provide the categories and fines for the inspections done by Lisa Tillman in January 2014.
Evidence: in January 2014 refers to inspection_date like '2014-01%'
SQL: SELECT DISTINCT T4.category, T3.fine FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id INNER JOIN violation AS T3 ON T1.inspection_id = T3.inspection_id INNER JOIN inspection_point AS T4 ON T3.point_id = T4.point_id WHERE T2.first_name = 'Lisa' AND T2.last_name = 'Tillman' AND strftime('%Y-%m', T1.inspection_date) = '2014-01'

Database: legislator
Question: Give the official full names of legislators representing Virginia.
Evidence: Virginia refers to state = 'VA'
SQL: SELECT T1.official_full_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.state = 'VA' GROUP BY T1.official_full_name

Database: book_publishing_company
Question: Show me the employ id of the highest employee who doesn't have a middle name.
Evidence: highest employee refers to employee with the highest job level; MAX(job_lvl)
SQL: SELECT emp_id FROM employee WHERE minit = '' ORDER BY job_lvl DESC LIMIT 1

Database: restaurant
Question: Which county and region does the street E. El Camino Real belong to?
Evidence: street E. El Camino Real refers to street_name = 'E. El Camino Real'
SQL: SELECT DISTINCT T2.county, T2.region FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.street_name = 'E. El Camino Real'

Database: soccer_2016
Question: What are the names of players that have run scored less than 3?
Evidence: scored less than 3 refers to Runs_Scored < 3; name of player refers to Player_name;
SQL: SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Batsman_Scored AS T3 ON T2.Match_ID = T3.Match_ID WHERE T3.Runs_Scored < 3 GROUP BY T1.Player_Name