Database: law_episode
Question: What is the percentage of people who gave the "True North" episode a 1-star rating?
Evidence: the "True North" episode refers to title = 'True North'; 1-star refers to stars = 1; percentage = divide(count(episode_id where stars = 1), count(episode_id)) * 100% where title = 'True North'
SQL: SELECT CAST(SUM(CASE WHEN T2.stars = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'True North' AND T1.episode_id = 'tt0629477'

Database: movie_3
Question: Among the active customers, how many of them have Nina as their first name?
Evidence: active refers to active = 1
SQL: SELECT COUNT(customer_id) FROM customer WHERE first_name = 'Nina' AND active = 1

Database: retail_world
Question: Please list all the territories in the Eastern Region.
Evidence: territories refers to TerritoryDescription; Eastern Region refers to RegionDescription = 'Eastern';
SQL: SELECT DISTINCT T1.TerritoryDescription FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Eastern'

Database: language_corpus
Question: What are the occurance of word "del" in title "Any anomalÃ­stic"?
Evidence: This is not
SQL: SELECT T2.occurrences FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T1.word = 'del' AND T3.title = 'Any anomalÃ­stic'

Database: movie_3
Question: List all the cities that belong to United Arab Emirates.
Evidence: United Arab Emirates refers to country = 'United Arab Emirates'
SQL: SELECT T1.city FROM city AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE country = 'United Arab Emirates'

Database: retail_world
Question: Among the products under grains/cereals category, provide the contact person and title of the supplier with one digit ID.
Evidence: grains/cereals category refers to CategoryName = 'Grains/Cereals'; supplier with one digit ID refers to SupplierID between 1 and 10;
SQL: SELECT DISTINCT T1.ContactName, T1.ContactTitle FROM Suppliers AS T1 INNER JOIN Products AS T2 ON T1.SupplierID = T2.SupplierID INNER JOIN Categories AS T3 ON T2.CategoryID = T3.CategoryID WHERE T3.CategoryName = 'Grains/Cereals' AND T1.SupplierID BETWEEN 1 AND 10 LIMIT 1

Database: college_completion
Question: Give the name of the 4-year public school in "ID" with the lowest graduation 100 value.
Evidence: name of the school refers to chronname; 4-year refers to level = '4-year'; public refers to control = 'Public'; ID refers to state_abbr = 'ID'; lowest graduation 100 value refers to MIN(grad_100_value);
SQL: SELECT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'ID' AND T1.level = '4-year' AND T1.control = 'Public' GROUP BY T1.chronname ORDER BY SUM(T1.grad_100_value) ASC LIMIT 1

Database: books
Question: Which country does Žirovnica city belong to?
Evidence: "Žirovnica" is the city; country refers to country_name
SQL: SELECT T1.country_name FROM country AS T1 INNER JOIN address AS T2 ON T1.country_id = T2.country_id WHERE T2.city = 'Žirovnica'

Database: video_games
Question: What is the percentage of games that were released on PS4 in 2014 among all platforms?
Evidence: percentage - MULTIPLY(DIVIDE(SUM(platform_name = 'PS4'), COUNT(game_id)), 100); in 2014 refers to release_year = 2014;
SQL: SELECT CAST(COUNT(CASE WHEN T2.platform_name = 'PS4' THEN T3.game_id ELSE NULL END) AS REAL) * 100 / COUNT(T3.game_id) FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id INNER JOIN game_publisher AS T3 ON T1.game_publisher_id = T3.id WHERE T1.release_year = 2014

Database: public_review_platform
Question: Please state any three business numbers in AZ state that have received the "Great experience" review stars.
Evidence: business numbers refers to business_id; great experience review stars refers to review_stars = 5;
SQL: SELECT DISTINCT T2.business_id FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T2.state LIKE 'AZ' AND T1.review_stars = 5 LIMIT 3

Database: movielens
Question: Please list down ID of movies acted by top 5 actors based on actor rating.
SQL: SELECT T2.movieid FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid GROUP BY T2.actorid ORDER BY AVG(T1.a_quality) DESC LIMIT 5

Database: regional_sales
Question: Name of customers who have ordered Cocktail Glasses by online sales channel.
Evidence: "Cocktail Glasses" is the Product Name; customer refers to Customer Names
SQL: SELECT T FROM ( SELECT DISTINCT CASE  WHEN T3.`Product Name` = 'Cocktail Glasses' AND T2.`Sales Channel` = 'Online' THEN T1.`Customer Names` END AS T FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID INNER JOIN Products T3 ON T3.ProductID = T2._ProductID ) WHERE T IS NOT NULL

Database: synthea
Question: List out full name of patients who have "Diabetic diet" in the description of the care plan.
Evidence: full name = first, last; Diabetic diet refers to careplans.DESCRIPTION = 'Diabetic diet';
SQL: SELECT DISTINCT T2.first, T2.last FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Diabetic diet'

Database: menu
Question: Among the menu pages of "Ritz Carlton", how many of them have a width of over 1000?
Evidence: Ritz Carlton is a name of menu; width of over 2490 refers to full_width > 1000;
SQL: SELECT SUM(CASE WHEN T1.name = 'Ritz Carlton' THEN 1 ELSE 0 END) FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T2.full_width > 1000

Database: movie_3
Question: How much is the total rental payment for the first 10 rentals?
Evidence: first 10 rental refers to rental id between 1 and 10; total rental payment refers to sum(amount)
SQL: SELECT SUM(amount) FROM payment WHERE rental_id BETWEEN 1 AND 10

Database: movie_platform
Question: What's the number of users gave the movie "Downfall" a rating of "4"?
Evidence: movie "Downfall" refers to movie_title = 'Downfall'; rating of "4" refers to rating_score = 4
SQL: SELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'Downfall' AND T1.rating_score = 4

Database: student_loan
Question: Count the number of female students who belong to marines organization.
Evidence: female students refers to enlist.name who are NOT in male.name; organization refers to organ; organ = 'marines';
SQL: SELECT COUNT(*) FROM person AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name LEFT JOIN male AS T3 ON T1.name = T3.name WHERE T2.organ = 'marines' AND T3.name IS NULL

Database: restaurant
Question: What are the most popular restaurants in San Francisco among diners?
Evidence: the most popular refers to max(review); restaurant refers to label; San Francisco refers to city = 'San Francisco'
SQL: SELECT id_restaurant, label FROM generalinfo WHERE city = 'San Francisco' AND review = ( SELECT MAX(review) FROM generalinfo WHERE city = 'San Francisco' )

Database: citeseer
Question: What is the class label of paper ID 'chakrabarti01integrating'. How many words were cited by this paper ID?
SQL: SELECT DISTINCT T1.class_label, COUNT(T2.word_cited_id) FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.paper_id = 'chakrabarti01integrating' GROUP BY T1.class_label

Database: social_media
Question: What gender of users posted the most tweets in `en`?
Evidence: "en" is the language and refers to Lang = 'en'; most tweet in 'en' refers to Max(Count(text where Lang = 'en'))
SQL: SELECT T.Gender FROM ( SELECT T2.Gender, COUNT( text) AS num FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.Lang = 'en' GROUP BY T2.Gender ) T ORDER BY T.num DESC LIMIT 1