Database: image_and_language
Question: How many images have less than 15 object samples?
Evidence: images refer to IMG_ID; less than 15 object samples refer to COUNT(OBJ_SAMPLE_ID) < 15;
SQL: SELECT COUNT(IMG_ID) FROM IMG_OBJ WHERE OBJ_SAMPLE_ID < 15

Database: movie_3
Question: What is the description and film title of ID 996?
Evidence: ID 996 refers to film_id = 996
SQL: SELECT description, title FROM film_text WHERE film_id = 996

Database: regional_sales
Question: Please calculate the total number of orders by each city in 2019.
Evidence: total number of orders refers to COUNT(OrderNumber); 2019 refers to OrderDate between 01-01-2019 and 31-12-2019; city refers to City Name;
SQL: SELECT COUNT(T1.OrderNumber) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T1.OrderDate LIKE '%/%/19' GROUP BY T2.`City Name` HAVING COUNT(T1.OrderNumber)

Database: movielens
Question: List down 5 non English adventure movies from UK?
Evidence: not English refers to isEnglish = 'F'; UK is a country
SQL: SELECT T1.movieid FROM movies2directors AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'UK' AND T1.genre = 'Adventure' AND T2.isEnglish = 'F' LIMIT 5

Database: talkingdata
Question: Please list any three devices that are owned by female users.
Evidence: female refers to gender = 'F';
SQL: SELECT device_id FROM gender_age WHERE gender = 'F' LIMIT 3

Database: food_inspection
Question: Among the top 5 owners with highest number of establishments, which owner has the highest number of high risk violations? Give the name of the owner.
Evidence: 5 owners with highest number of establishments refer to owner_name where MAX(COUNT(business_id)) LIMIT 5; the highest number of high risk violations refers to MAX(COUNT(risk_category = 'High Risk'));
SQL: SELECT T4.owner_name FROM violations AS T3 INNER JOIN businesses AS T4 ON T3.business_id = T4.business_id INNER JOIN ( SELECT T2.owner_name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id GROUP BY T2.owner_name ORDER BY COUNT(T1.business_id) DESC LIMIT 5 ) AS T5 ON T4.owner_name = T5.owner_name WHERE T3.risk_category = 'High Risk' GROUP BY T4.owner_name ORDER BY COUNT(T3.risk_category) DESC LIMIT 1

Database: trains
Question: How many eastbound trains have rectangular-shaped head cars?
Evidence: eastbound refers to direction = 'east'; head cars refers to position = 1
SQL: SELECT COUNT(T.train_id) FROM (SELECT T1.train_id FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 1 AND T2.direction = 'east' AND T1.shape = 'rectangle' GROUP BY T1.train_id)as T

Database: movie_platform
Question: Which movie has the highest average score in Mubi?
Evidence: Highest average score refers to Max(Avg(rating_score));
SQL: SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id GROUP BY T2.movie_title ORDER BY SUM(T1.rating_score) / COUNT(T1.rating_id) DESC LIMIT 1

Database: retails
Question: Which country has the most number of suppliers whose account is in debt?
Evidence: country refers to n_name; the most number of suppliers whose account is in debt refers to MAX(SUM(s_acctbal < 0));
SQL: SELECT T.n_name FROM ( SELECT T2.n_name, SUM(T1.s_acctbal) AS num FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0 GROUP BY T2.n_name ) AS T ORDER BY T.num LIMIT 1

Database: food_inspection_2
Question: What is the average number of inspections carried out in the year 2010 by a sanitarian whose salary is over 70000?
Evidence: in the year 2010 refers to inspection_date like '2010%'; salary is over 70000 refers to salary > 70000; average number = divide(sum(inspection where inspection_date like '2010%'), sum(employee_id where salary > 70000))
SQL: SELECT CAST(SUM(CASE WHEN T2.inspection_date LIKE '2010%' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.salary > 70000 THEN 1 ELSE 0 END) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id

Database: movielens
Question: Movies with rating 3 are viewed by audiences in which distinct age group?
Evidence: The audience and users are the same meaning
SQL: SELECT DISTINCT T2.age FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating = 3

Database: cs_semester
Question: What is the average number of students who registered for the courses with a difficulty of 4?
Evidence: diff refers to difficulty; DIVIDE(COUNT(student_id where diff = 4), COUNT(course_id where diff = 4));
SQL: SELECT CAST(COUNT(T1.student_id) AS REAL) / COUNT(DISTINCT T2.course_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.diff = 4

Database: world_development_indicators
Question: What's the lastest household survey in Angola and when did it take place?
Evidence: in Angola refers to ShortName = 'Angola'; when refers to PppSurveyYear
SQL: SELECT LatestHouseholdSurvey, PppSurveyYear FROM Country WHERE ShortName = 'Angola'

Database: movielens
Question: For the male users no older than 18, how many times have they given the highest rating?
Evidence: Male users refers to u_gender = 'M'
SQL: SELECT COUNT(T1.movieid) FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating = 5 AND T2.age < 18 AND T2.u_gender = 'M'

Database: retail_complains
Question: What are the issues of the complains of male clients and products from age 25 and below?
Evidence: male refers to sex = 'Male'; age 25 and below refers to age < 25
SQL: SELECT DISTINCT T2.Issue FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.sex = 'Male' AND T1.age < 25

Database: legislator
Question: How many Catholic legislators do not have an account on ballotpedia.org?
Evidence: Catholic refers to religion_bio = 'Catholic'; do not have an account on ballotpedia.org refers to ballotpedia_id is null;
SQL: SELECT COUNT(bioguide_id) FROM historical WHERE religion_bio = 'Catholic' AND ballotpedia_id IS NULL

Database: menu
Question: What are the names of the dishes in the menu sponsored by The Society of Cumberland that was created for the 19th reunion at Grand Pacific Hotel in Chicago, Illinois?
Evidence: sponsored by The Society of Cumberland refers to sponsor = 'THE SOCIETY OF THE CUMBERLAND'; created for the 19th reunion refers to event = '19NTH REUNION'; Grand Pacific Hotel in Chicago, Illinois refers to place = 'GRAND PACIFIC HOTEL, CHICAGO, ILL';
SQL: SELECT T4.name FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id INNER JOIN MenuItem AS T3 ON T2.id = T3.menu_page_id INNER JOIN Dish AS T4 ON T3.dish_id = T4.id WHERE T1.sponsor = 'THE SOCIETY OF THE CUMBERLAND' AND T1.event = '19NTH REUNION' AND T1.place = 'GRAND PACIFIC HOTEL,CHICAGO,ILL'

Database: food_inspection
Question: Which establishment has the highest number of inspections done? Give the name of the establishment and calculate for its average score per inspection.
Evidence: establishment refers to business_id; the highest number of inspections refers to MAX(COUNT(business_id)); avg(score);
SQL: SELECT T2.name, AVG(T1.score) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id GROUP BY T2.name ORDER BY COUNT(T2.business_id) DESC LIMIT 1

Database: movie_3
Question: What are the addresses of the inactive customers?
Evidence: inactive customers refers to active = 0;
SQL: SELECT T2.address FROM customer AS T1 INNER JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.active = 0