db_id
stringclasses
69 values
question
stringlengths
24
321
evidence
stringlengths
0
673
SQL
stringlengths
30
743
question_id
int64
0
6.6k
difficulty
stringclasses
3 values
superstore
What is the ratio between customers who live in Texas and customers who live in Indiana?
live in Texas refers to State = 'Texas'; live in Indiana refers to State = 'Indiana'; Ratio = divide(sum(State = 'Texas'), sum(State = 'Indiana'))
SELECT CAST(SUM(CASE WHEN State = 'Texas' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN State = 'Indiana' THEN 1 ELSE 0 END) FROM people
300
simple
coinmarketcap
For all transactions for WRAP in August 2016, list the time to achieve highest price and the time to achieve the lowest price.
in May 2013 refers to month(date) = 5 AND year(date) = 2013; time to achieve the highest price refers to time_high; time to achieve the lowest price refers to time_low; WRAP refers to name = 'WARP'
SELECT T2.time_high, T2.time_low, T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'WARP' AND STRFTIME('%Y-%m', T2.date) = '2016-08'
301
moderate
movie_3
What is the average rental payment in Horror movies?
'Horror' is a name of a category; average rental payment refers to AVG(amount)
SELECT AVG(T5.amount) FROM category AS T1 INNER JOIN film_category AS T2 ON T1.category_id = T2.category_id INNER JOIN inventory AS T3 ON T2.film_id = T3.film_id INNER JOIN rental AS T4 ON T3.inventory_id = T4.inventory_id INNER JOIN payment AS T5 ON T4.rental_id = T5.rental_id WHERE T1.name = 'Horror'
302
simple
beer_factory
Of the 4 root beers that Frank-Paul Santangelo purchased on 2014/7/7, how many of them were in cans?
on 2014/7/7 refers to transactiondate = '2014-07-07'; in cans refers to containertype = 'Can';
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 WHERE T1.First = 'Frank-Paul' AND T1.Last = 'Santangelo' AND T2.TransactionDate = '2014-07-07' AND T3.ContainerType = 'Can'
303
moderate
books
How many orders were returned in the year 2020?
returned refers to status_value = 'Returned'; in the year 2020 refers to status_date LIKE '%2020%'
SELECT COUNT(*) FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE T1.status_value = 'Returned' AND STRFTIME('%Y', T2.status_date) = '2020'
304
simple
food_inspection_2
List down the dba name of restaurants that were inspected due to license.
inspected due to license refers to inspection_type = 'License'
SELECT T1.dba_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.inspection_type = 'License'
305
simple
movielens
Please give the ids of the oldest films that got the most ratings.
Films and movies share the same meaning; oldest film refers to the movie with year = 1
SELECT DISTINCT T1.movieid FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T1.rating = 5 AND T2.year = 1
306
simple
video_games
How many action games are there in total?
action game refers to genre_name = 'Action'
SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Action'
307
simple
airline
Among the flights with air carrier "Southwest Airlines Co.: WN", provide the tail number of flights with an actual elapsed time lower than the 80% of the average actual elapsed time of listed flights.
Southwest Airlines Co.: WN refers to Description = 'Southwest Airlines Co.: WN'; tail number refers to TAIL_NUM; actual elapsed time lower than the 80% of the average actual elapsed time refers to ACTUAL_ELAPSED_TIME < (MULTIPLY AVG(ACTUAL_ELAPSED_TIME), 0.8);
SELECT T2.TAIL_NUM FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description = 'Southwest Airlines Co.: WN' AND T2.ACTUAL_ELAPSED_TIME < ( SELECT AVG(ACTUAL_ELAPSED_TIME) * 0.8 FROM Airlines )
308
moderate
hockey
In the Stanley Cup finals history, how many games did player id "broadpu01" play in 1922?
the number of games refers to GP
SELECT GP FROM ScoringSC WHERE playerID = 'broadpu01' AND YEAR = 1922
309
simple
student_loan
How many disabled students have payment due?
have payment due refers to bool = 'pos';
SELECT COUNT(T1.name) FROM disabled AS T1 INNER JOIN no_payment_due AS T2 ON T2.name = T1.name WHERE T2.bool = 'pos'
310
simple
airline
List the air carrier's description with arrival time lower than the 40% of the average arrival time of flights that flew to Phoenix.
arrival time lower than the 40% of the average arrival time refers to ARR_TIME < MULTIPLY(AVG(ARR_TIME), 0.4); flew to Phoenix refers to DEST = 'PHX';
SELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T2.DEST = 'PHX' AND T2.ARR_TIME < ( SELECT AVG(ARR_TIME) * 0.4 FROM Airlines ) GROUP BY T1.Description
311
moderate
retail_complains
Please give the first name and phone number of the client whose complaint id is CR0922485.
first name refers to first
SELECT T1.first, T1.phone FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Complaint ID` = 'CR0922485'
312
simple
simpson_episodes
State the number of votes for episode with rating of 7 and above.
rating of 7 and above refers to rating > 7.0
SELECT votes FROM Episode WHERE rating > 7;
313
simple
shakespeare
What is the description of the chapter with the longest number of paragraphs?
chapter with the longest number of paragraphs refers to max(ParagraphNum)
SELECT T2.Description FROM paragraphs AS T1 INNER JOIN chapters AS T2 ON T1.chapter_id = T2.id ORDER BY T1.ParagraphNum DESC LIMIT 1
314
simple
mondial_geo
Provide the country with its full name which has the most ethnic group? List them all ethnic group together with its percentage.
SELECT T1.Name, T2.Name, T2.Percentage FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T1.Name = ( SELECT T1.Name FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country GROUP BY T1.Name ORDER BY COUNT(T2.Name) DESC LIMIT 1 ) GROUP BY T1.Name, T2.Name, T2.Percentage
315
challenging
public_review_platform
Between 2006 and 2007, which year ID had the greater number in elite user?
2006 and 2007 refers to BETWEEN 2006 AND 2007; greater number in elite user refers to count(user_id)
SELECT year_id FROM Elite WHERE year_id IN (2006, 2007) GROUP BY year_id ORDER BY COUNT(user_id) DESC LIMIT 1
316
simple
retail_complains
Which district did the review on 2018/9/11 come from? Give the name of the city.
on 2018/9/11 refers to Date = '2017-07-22';
SELECT T2.district_id, T2.city FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Date = '2018-09-11'
317
simple
works_cycles
What is the Crankarm product's net profit?
net profit = Subtract(LastReceiptCost, StandardPrice);
SELECT T2.LastReceiptCost - T2.StandardPrice FROM Product AS T1 INNER JOIN ProductVendor AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name LIKE '%Crankarm%'
318
simple
authors
What is the full name of the conference where paper number 5 was published?
paper number 5 refers to Id = 5
SELECT T2.FullName FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Id = 5
319
simple
simpson_episodes
Which episode has the most vote for 10 stars rating?
10 stars rating refers to stars = 10; most vote refers to Max(votes)
SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 10 ORDER BY T1.votes DESC LIMIT 1;
320
simple
world_development_indicators
What's the value of the indicator whose long definition is "Adolescent fertility rate is the number of births per 1,000 women ages 15-19." for the Arab World in 1960?
in 1960 refers to Year = 1960; for the Arab World refers to CountryName = 'Arab World'
SELECT T1.Value FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName INNER JOIN Country AS T3 ON T1.CountryCode = T3.CountryCode WHERE T2.LongDefinition = 'Adolescent fertility rate is the number of births per 1,000 women ages 15-19.' AND T3.ShortName = 'Arab World' AND T1.Year = 1960
321
moderate
retail_world
What are the highest salary earn by the the employee and what is his/her position in the company?
highest salary refers to max(salary); position refers to Title
SELECT Salary, Title FROM Employees WHERE Salary = ( SELECT MAX(Salary) FROM Employees )
322
simple
cs_semester
What is the percentage of Professor Ogdon Zywicki's research assistants are taught postgraduate students?
research assistant refers to the student who serves for research where the abbreviation is RA; taught postgraduate student refers to type = 'TPG'; DIVIDE(COUNT(student_id where type = 'TPG' and first_name = 'Ogdon', last_name = 'Zywicki'), COUNT(first_name = 'Ogdon', last_name = 'Zywicki')) as percentage;
SELECT CAST(SUM(CASE WHEN T3.type = 'TPG' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T1.student_id = T3.student_id WHERE T2.first_name = 'Ogdon' AND T2.last_name = 'Zywicki'
323
moderate
world_development_indicators
What are the indicator codes for the Republic of Albania in the year 1960?
the Republic of Albania refers to LongName = 'Republic of Albania'; in the year 1960 refers to Year = '1960'
SELECT DISTINCT T1.IndicatorCode FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Year = 1960 AND T2.LongName = 'Republic of Albania'
324
simple
movie_3
Among the films with a rental duration of 7 days, how many are comedies?
rental duration of 7 refers to rental_duration = 7; comedies refers to name = 'Comedy'
SELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T1.rental_duration = 7 AND T3.name = 'Comedy'
325
moderate
student_loan
What is the status of payment of student 124?
status of payment is mentioned in no_payment_due; bool = 'pos' means the student has payment due; bool = 'neg' means the student has no payment due; student124 is a name of student;
SELECT `bool` FROM no_payment_due WHERE name = 'student124'
326
simple
mondial_geo
What is the average area of Asian countries?
Asia is a continent
SELECT AVG(Area) FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country WHERE T2.Continent = 'Asia'
327
simple
airline
How many planes does Southwest Airlines Co. have?
planes refers to TAIL_NUM; Southwest Airlines Co. refers to Description = 'Southwest Airlines Co.: WN';
SELECT COUNT(T3.TAIL_NUM) FROM ( SELECT T1.TAIL_NUM FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T2.Description = 'Southwest Airlines Co.: WN' GROUP BY T1.TAIL_NUM ) T3
328
simple
movies_4
What is the iso code of "Kyrgyz Republic"?
iso code refers to country_iso_code; "Kyrgyz Republic" refers to country_name = 'Kyrgyz Republic'
SELECT COUNTry_iso_code FROM COUNTry WHERE COUNTry_name = 'Kyrgyz Republic'
329
simple
menu
Name the dishes that were on the menu page ID 174.
FALSE;
SELECT T2.name FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE T1.menu_page_id = 174
330
simple
movies_4
Please list the names of all the crew members of the movie "Pirates of the Caribbean: At World's End".
names refers to person_name; "Pirates of the Caribbean: At World's End" refers to title = 'Pirates of the Caribbean: At World''s End'
SELECT T3.person_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End'
331
moderate
authors
Among papers that were published in 2005, provide the author name of paper with key words of "LOAD; IDE; SNP; haplotype; asso- ciation studies".
in 2005 refers to Year = '2005'; key words of "LOAD; IDE; SNP; haplotype; asso- ciation studies" refers to Keyword = 'LOAD; IDE; SNP; haplotype; asso- ciation studies'
SELECT T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Year = 2005 AND T1.Keyword = 'KEY WORDS: LOAD IDE SNP haplotype asso- ciation studies'
332
moderate
european_football_1
For all the games ended up with 1-1, what percentage of them are from Liga NOS division?
1-1 is a score where FTHG = '1' and FTAG = '1'; Liga NOS is the name of division; DIVIDE(COUNT(Div where FTHG = '1', FTAG = '1', name = 'Liga NOS'), COUNT(Div where FTHG = '1' and FTAG = '1')) as percentage;
SELECT CAST(COUNT(CASE WHEN T2.name = 'Liga NOS' THEN T1.Div ELSE NULL END) AS REAL) * 100 / COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.FTHG = 1 AND FTAG = 1
333
moderate
legislator
How many legislators have an Instagram account?
have an Instagram account refers to instagram is NOT null and instagram <>''
SELECT COUNT(*) FROM `social-media` WHERE instagram IS NOT NULL AND instagram <> ''
334
simple
chicago_crime
How many community areas are there in Central Chicago?
Central Chicago refers to side = 'Central'
SELECT COUNT(*) FROM Community_Area WHERE side = 'Central'
335
simple
cs_semester
Give the grade score for Rik Unsworth in "Computer Network".
Academic grades awarded for participation in a course are A, B, C, D and F where Grade 'A' means excellent, Grade 'B' means good, Grade 'C' means fair, Grade 'D' means poorly pass, if grade is null or empty, it means that this student fails to pass this course in which grade = NULL;
SELECT CASE grade WHEN 'A' THEN 4 WHEN 'B' THEN 3 WHEN 'C' THEN 2 ELSE 1 END AS result FROM registration WHERE student_id IN ( SELECT student_id FROM student WHERE f_name = 'Rik' AND l_name = 'Unsworth' AND course_id IN ( SELECT course_id FROM course WHERE name = 'Computer Network' ) )
336
moderate
works_cycles
What is the shipping address for the sales order "43873"?
shipping address = AddressLine1+AddressLine2+City;
SELECT T1.ShipToAddressID FROM SalesOrderHeader AS T1 INNER JOIN Address AS T2 ON T1.BillToAddressID = T2.AddressID WHERE T1.SalesOrderID = 43873 GROUP BY T1.ShipToAddressID
337
simple
movielens
List down the ID of movies with running time of 3 and average revenue of 1?
SELECT T1.movieid FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid INNER JOIN directors AS T3 ON T2.directorid = T3.directorid WHERE T1.runningtime = 3 AND T3.avg_revenue = 1
338
simple
genes
Please list the location of the genes that have the most chromosomes.
SELECT T2.Localization FROM Genes AS T1 INNER JOIN Classification AS T2 ON T1.GeneID = T2.GeneID ORDER BY T1.Chromosome DESC LIMIT 1
339
simple
mondial_geo
How many organizations are established in the country with the most ethnic groups?
SELECT COUNT(T2.Province) FROM country AS T1 INNER JOIN organization AS T2 ON T1.Code = T2.Country INNER JOIN ethnicGroup AS T3 ON T3.Country = T2.Country GROUP BY T1.Name ORDER BY COUNT(T3.Name) DESC LIMIT 1
340
simple
legislator
State all the district that Benjamin Contee has served before.
SELECT T2.district FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name = 'Benjamin' AND T1.last_name = 'Contee'
341
simple
video_games
Calculate the total number of sales in North America.
total number of sales = MULTIPLY(SUM(num_sales), 100000); North America refers to region_name = 'North America';
SELECT SUM(T2.num_sales) * 100000 AS nums FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'North America'
342
simple
books
How many books were ordered by customer Kandy Adamec?
SELECT COUNT(*) FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T3.first_name = 'Kandy' AND T3.last_name = 'Adamec'
343
simple
books
List the author's and publisher's name of the book published on July 10, 1997.
author's name refers to author_name; publisher's name refers to publisher_name; book published on July 10, 1997 refers to publication_date LIKE '1997-07-10'
SELECT T3.author_name, T4.publisher_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id INNER JOIN publisher AS T4 ON T4.publisher_id = T1.publisher_id WHERE T1.publication_date = '1997-07-10'
344
challenging
retail_complains
Among the clients born between 1980 and 2000, list the name of male clients who complained through referral.
born between 1980 and 2000 refers to year BETWEEN 1980 AND 2000; name = first, middle, last; male refers to sex = 'Male'; complained through refers to "Submitted via";
SELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.year BETWEEN 1980 AND 2000 AND T1.sex = 'Male' AND T2.`Submitted via` = 'Referral'
345
moderate
synthea
When did Mrs. Ira Deckow have the standard pregnancy test?
standard pregnancy test refers to DESCRIPTION = 'Standard pregnancy test' from procedures;
SELECT T2.date FROM patients AS T1 INNER JOIN procedures AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mrs.' AND T1.first = 'Ira' AND T1.last = 'Deckow' AND T2.description = 'Standard pregnancy test'
346
simple
movie_3
From 5/30/2005 at 3:43:54 AM to 7/31/2005 at 10:08:29 PM, how many times did Susan Wilson pay for film rentals?
from 5/30/2005 at 3:43:54 AM to 7/31/2005 at 10:08:29 PM refers to payment_date between '2005-05-30 03:43:54' and '2005-07-31 10:08:29'
SELECT COUNT(T1.customer_id) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.payment_date BETWEEN '2005-05-30 03:43:54' AND '2005-07-31 10:08:29'
347
moderate
movie_3
What is Mary Smith's rental ID?
SELECT T2.rental_id FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'MARY' AND T1.last_name = 'SMITH'
348
simple
beer_factory
For the root beer brand with the most 5 star ratings, what is the name of the brewery?
most 5 star ratings refers to MAX(COUNT(StarRating = 5)); name of the brewery refers to BreweryName;
SELECT T1.BreweryName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T2.StarRating = 5 GROUP BY T1.BrandID ORDER BY COUNT(T2.StarRating) DESC LIMIT 1
349
moderate
public_review_platform
List down the business ID with a star range from 3 to 4, located at Tempe.
star range from 3 to 4 refers to stars > = 3 AND stars < 5; 'Tempe' is the name of city
SELECT business_id FROM Business WHERE city LIKE 'Tempe' AND stars BETWEEN 3 AND 4
350
simple
olympics
How many 20 years old athletes were there in the 1984 Summer Olympic Games?
20 years old athletes refer to person_id where age = 20; 1984 Summer Olympic Games refer to games_name = '1984 Summer';
SELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '1984 Summer' AND T2.age = 20
351
simple
donor
Among all the donors from New York, how many of them are teachers?
from New York refers to donor_city = 'New York'; donor is a teacher refers to is_teacher_acct = 't';
SELECT COUNT(donationid) FROM donations WHERE is_teacher_acct = 't' AND donor_city = 'New York'
352
simple
codebase_comments
How many solutions does the repository which has 1445 Forks contain?
solutions refers to Solution.Id; repository refers to Repository.Id;
SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks = 1445
353
simple
olympics
How many gold medals does Henk Jan Zwolle have?
gold medals refer to medal_name = 'Gold';
SELECT COUNT(T1.id) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN medal AS T4 ON T3.medal_id = T4.id WHERE T1.full_name = 'Henk Jan Zwolle' AND T4.medal_name = 'Gold'
354
simple
human_resources
Which employee's job position requires a higher education level, Jose Rodriguez or Sandy Adams?
Jose Rodriguez AND Sandy Adams are the fullname of employee; full name = firstname, lastname; higher education level refers to MAX(educationrequired)
SELECT T1.firstname, T1.lastname FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE (T1.lastname = 'Adams' AND T1.firstname = 'Sandy') OR (T1.lastname = 'Rodriguez' AND T1.firstname = 'Jose') ORDER BY T2.educationrequired DESC LIMIT 1
355
moderate
image_and_language
What object class is in the X and Y coordinates of 126 and 363?
object class refers to OBJ_CLASS; X and Y coordinates of 126 and 363 refer to coordinates of the bounding box where X = 126 and Y = 363;
SELECT T1.IMG_ID, T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.X = 126 AND T1.Y = 363
356
simple
sales
How many employees sold over 20,000 quantities of "Touring-2000 Blue, 50"?
over 20,000 quantities refers to Quantity > 20000; 'Touring-2000 Blue, 50' is name of product;
SELECT COUNT(*) FROM ( SELECT SUM(Quantity) FROM Sales WHERE ProductID IN ( SELECT ProductID FROM Products WHERE Name = 'Touring-2000 Blue, 50' ) GROUP BY Quantity, SalesPersonID HAVING SUM(Quantity) > 20000 )
357
moderate
retail_world
How many employees is a UK citizen and are they all covering the same region?
is a UK citizen refers to Country = 'UK'
SELECT COUNT(T1.EmployeeID), T3.RegionID FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID WHERE T1.Country = 'UK' GROUP BY T3.RegionID
358
moderate
movie_3
What is the rental price per day for Airplane Sierra?
rental price per day refers to DIVIDE(rental_price, rental_duration); 'Airplane Sierra' is a title of a film
SELECT rental_rate / rental_duration AS result FROM film WHERE title = 'AIRPLANE SIERRA'
359
simple
donor
How many suburban metros are there in Livingston Parish School District?
suburban metros refer to metro = 'suburban'; Livingston Parish School District refer to school_district
SELECT COUNT(projectid) FROM projects WHERE school_district = 'Livingston Parish School Dist' AND school_metro = 'suburban'
360
simple
college_completion
In female students in year 2012, how many of them from a state with number of schools ranges from 10 to 20?
female refers to gender = 'F'; number of schools refers to schools_count; schools_count BETWEEN 10 AND 20;
SELECT COUNT(T2.race) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.gender = 'F' AND schools_count BETWEEN 10 AND 20 AND T2.year = 2012
361
simple
regional_sales
List the 5 sales teams that have made sales with the highest net profits.
highest net profit = Max(Subtract (Unit Price, Unit Cost))
SELECT T2.`Sales Team` FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID ORDER BY REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') DESC LIMIT 5
362
moderate
food_inspection
Among the businesses with score that ranges from 70 to 80, list their violation type ID and risk category.
businesses with score that ranges from 70 to 80 refer to business_id where score between 80 and 90;
SELECT DISTINCT T1.violation_type_id, T1.risk_category FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id INNER JOIN inspections AS T3 ON T2.business_id = T3.business_id WHERE T3.score BETWEEN 70 AND 80
363
simple
student_loan
What is the organization enlisted by student168?
organization refers to organ; student168 is a name of student;
SELECT organ FROM enlist WHERE name = 'student168'
364
simple
public_review_platform
How many active businesses of city are underrated?
active businesses refers to active = 'true'; underrated refers to review_count = 'Low';
SELECT COUNT(business_id) FROM Business WHERE review_count LIKE 'Low' AND active LIKE 'TRUE'
365
simple
movie_3
Indicate the title of all the films that are in the Classics category.
'classics' is the name of category
SELECT T2.title FROM film_category AS T1 INNER JOIN film AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T1.category_id = T3.category_id WHERE T3.name = 'Classics'
366
simple
works_cycles
What's the profit for the Freewheel?
SUBTRACT(LastReceiptCost, StandardPrice) for ProductID where name = 'Freewheel'
SELECT T1.LastReceiptCost - T1.StandardPrice FROM ProductVendor AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'Freewheel'
367
simple
food_inspection_2
Provide the inspection ID of the inspection with the comment "MUST CLEAN AND BETTER ORGANIZE HALLWAY AREA" and sanitary operating requirement code of 7-38-030, 015, 010 (A), 005 (A).
comment "MUST CLEAN AND BETTER ORGANIZE HALLWAY AREA" refers to inspector_comment = 'MUST CLEAN AND BETTER ORGANIZE HALLWAY AREA'; sanitary operating requirement code of 7-38-030, 015, 010 (A), 005 (A) refers to code = '7-38-030, 015, 010 (A), 005 (A)'
SELECT T2.inspection_id FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T2.inspector_comment = 'MUST CLEAN AND BETTER ORGANIZE HALLWAY AREA' AND T1.code = '7-38-030, 015, 010 (A), 005 (A)'
368
challenging
mondial_geo
Among the independent countries whose type of government is republic, what is the biggest number of deserts they have?
SELECT COUNT(T3.Desert) FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country INNER JOIN geo_desert AS T3 ON T3.Country = T2.Country WHERE T2.Government = 'republic'
369
simple
cars
Give the model year of the heaviest car.
the heaviest refers to max(weight)
SELECT T2.model_year FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID ORDER BY T1.weight DESC LIMIT 1
370
simple
superstore
List the customer's name from the South region with a standard class ship mode and sales greater than the 88% of the average sales of all orders.
sales greater than the 88% of the average sales of all orders refers to Sales > avg(Sales) * 0.88; South region refers to south_superstore
SELECT DISTINCT T2.`Customer Name` FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.Region = 'South' AND T1.`Ship Mode` = 'Standard Class' AND 100 * T1.Sales / ( SELECT AVG(Sales) FROM south_superstore ) > 88
371
moderate
world
Among the countries that officially use the English language, what country has the highest capital?
officially use the English language refers to `Language` = 'English' AND IsOfficial = 'T'; highest capital refers to MAX(Capital);
SELECT T1.Code FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'English' AND T2.IsOfficial = 'T' ORDER BY T1.Capital DESC LIMIT 1
372
simple
professional_basketball
In what year did the only team to beat the Houston in the final round of postseason series games earn its lowest ranking?
beat the Huston refers to tmIDLoser = 'HSM';  in final round of post season refers to round = 'DSF'
SELECT T2.year FROM series_post AS T1 INNER JOIN teams AS T2 ON T1.tmIDWinner = T2.tmID WHERE T1.round = 'DSF' AND T1.tmIDLoser = 'HSM' ORDER BY T2.rank ASC LIMIT 1
373
moderate
restaurant
How many Thai restaurants can be found in San Pablo Ave, Albany?
Thai restaurant refers to food_type = 'thai'; San Pablo Ave Albany refers to street_name = 'san pablo ave' AND T1.city = 'albany'
SELECT COUNT(T1.id_restaurant) FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.food_type = 'thai' AND T1.city = 'albany' AND T2.street_name = 'san pablo ave'
374
simple
retail_world
What are the ID and description of the condiments category?
condiments category refers to CategoryName = 'Condiments'; the ID refers to CategoryID
SELECT CategoryID, Description FROM Categories WHERE CategoryName = 'Condiments'
375
simple
retail_world
Among the customers, list customers' company names and addresses who paid more than average in freight.
paid more than average in freight refers to Freight > divide(sum(Freight) , count(OrderID))
SELECT DISTINCT T1.CompanyName, T1.Address FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.Freight > ( SELECT AVG(Freight) FROM Orders )
376
simple
works_cycles
Between Northwest and Southeast of the United States, which territory one recorded the highest amount of sales last year?
United States refers to CountryRegionCode = 'US';
SELECT Name FROM SalesTerritory WHERE CountryRegionCode = 'US' AND (Name = 'Northwest' OR Name = 'Southeast') ORDER BY SalesLastYear DESC LIMIT 1
377
simple
food_inspection_2
Which business had the highest number of inspections done? Calculate the percentage of passed and failed inspections of the said business.
business name refers to dba_name; the highest number of inspections done max(count(inspection_id)); percentage of passed inspections = divide(sum(inspection_id where results = 'Pass'), total(inspection_id)) * 100%; percentage of failed inspections = divide(sum(inspection_id where results = 'Fail'), total(inspection_id)) * 100%
SELECT T2.dba_name , CAST(SUM(CASE WHEN T1.results = 'Pass' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.inspection_id) AS percentagePassed , CAST(SUM(CASE WHEN T1.results = 'Fail' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.inspection_id) FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no GROUP BY T2.dba_name ORDER BY COUNT(T1.license_no) DESC LIMIT 1
378
challenging
world_development_indicators
Please provide full name of any two countries using special trade system.
full name refers to longname; using special trade system refers to systemoftrade = 'Special trade system'
SELECT LongName FROM Country WHERE SystemOfTrade = 'Special trade system' LIMIT 2
379
simple
car_retails
Of the clients whose businesses are located in the city of Boston, calculate which of them has a higher average amount of payment.
average amount payment = AVG(amount);
SELECT T1.customerNumber FROM customers AS T1 INNER JOIN payments AS T2 ON T1.customerNumber = T2.customerNumber WHERE T1.city = 'Boston' GROUP BY T1.customerNumber ORDER BY SUM(T2.amount) / COUNT(T2.paymentDate) DESC LIMIT 1
380
moderate
authors
How many papers were published in 2011 in the journal whose short name is "Mol Brain"?
in 2011 refers to Year = 2011; 'Mol Brain' is the ShortName of journal
SELECT COUNT(T2.Id) FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T2.Year = 2011 AND T1.ShortName = 'Mol Brain'
381
simple
synthea
Among the patients with viral sinusitis condition, which patient's gender is most affected? Provide the number for each respectively.
viral sinusitis condition refers to conditions.DESCRIPTION = 'Viral sinusitis (disorder)'; gender that is most affected refers to MAX(COUNT(gender WHERE conditions.DESCRIPTION = 'Viral sinusitis (disorder)'));
SELECT SUM(CASE WHEN T1.gender = 'F' THEN 1 ELSE 0 END), SUM(CASE WHEN T1.gender = 'M' THEN 1 ELSE 0 END) FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Viral sinusitis (disorder)'
382
challenging
retail_world
The product 'Mozzarella di Giovanni' belongs in which category? Include the category's description as well.
Mozzarella di Giovanni' is a ProductName; category refers to CategoryName;
SELECT T2.CategoryName, T2.Description FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.ProductName = 'Mozzarella di Giovanni'
383
simple
shakespeare
Give the title and the characters name of the most recent work of Shakespeare.
characters name refers to CharName; most recent work refers to max(Date)
SELECT T1.Title, T4.CharName FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id ORDER BY T1.Date DESC LIMIT 1
384
moderate
movie_3
What are the addresses of the inactive customers?
inactive customers refers to active = 0;
SELECT T2.address FROM customer AS T1 INNER JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.active = 0
385
simple
superstore
What was the quantity of Xerox 1952 ordered by Aimee Bixby on 2014/9/10?
Xerox 1952 is a "Product Name"; ordered by Aimee Bixby refers to "Customer Name" = 'Aimee Bixby'; on 2014/9/10 refers to "Order Date" = date('2014-09-10');
SELECT SUM(T2.Quantity) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Aimee Bixby' AND T3.`Product Name` = 'Xerox 1952' AND T2.`Order Date` = '2014-09-10'
386
moderate
movielens
How many drama movie with the rating of 3?
SELECT COUNT(DISTINCT T2.movieid) FROM u2base AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T2.genre = 'drama' AND T1.rating = 3
387
simple
retail_world
How many customers are located in London?
London refers to City = 'London'
SELECT COUNT(CustomerID) FROM Customers WHERE City = 'London'
388
simple
university
What is the student staff ratio at the university with the greatest student staff ratio of all time?
greatest student staff ratio of all time refers to max(student_staff_ratio)
SELECT MAX(student_staff_ratio) FROM university_year ORDER BY student_staff_ratio DESC LIMIT 1
389
simple
video_games
When was the game titled 3DS Classic Collection released?
when refers to release_year; the game titled 3DS Classic Collection refers to game_name = '3DS Classic Collection'
SELECT T1.release_year 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 WHERE T3.game_name = '3DS Classic Collection'
390
simple
mondial_geo
How many more people speak English than speak Scottish in United Kingdom?
English and Scottish are two languages; United Kingdom is a country
SELECT T3.Population * (T2.Percentage - T1.Percentage) FROM ethnicGroup AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Country = T2.Country INNER JOIN country AS T3 ON T1.Country = T3.Code WHERE T1.Name = 'Scottish' AND T2.Name = 'English' AND T3.Name = 'United Kingdom'
391
moderate
student_loan
List all the disabled female students.
SELECT T1.name FROM disabled AS T1 INNER JOIN male AS T2 ON T1.name <> T2.name
392
simple
social_media
Users in which city of Argentina post the most tweets?
"Argentina" is the Country; post the most tweets refers to Max(Count(TweetID))
SELECT T2.City FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina' GROUP BY T2.City ORDER BY COUNT(T1.TweetID) DESC LIMIT 1
393
simple
retail_world
Please name any two products that have the highest satisfaction levels among users of Heli Swaren GmbH & Co. KG.
High reorder level generally means high user satisfaction; the highest satisfaction levels refer to MAX(ReorderLevel); two products refer to ProductName LIMIT 2; CompanyName = 'Heli Swaren GmbH & Co. KG';
SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Heli Swaren GmbH & Co. KG' ORDER BY T1.ReorderLevel DESC LIMIT 2
394
simple
movie_3
How many customers rented for an above-average period?
rented period refers to SUBTRACT(return_date, rental_date); calculation = rented period > (AVG(rented period))
SELECT COUNT(customer_id) FROM rental WHERE return_date - rental_date > ( SELECT AVG(return_date - rental_date) FROM rental )
395
simple
retails
How many items shipped by REG AIR were ordered on March 22, 1995?
items shipped by REG AIR refer to l_linenumber where l_shipmode = 'REG AIR'; ordered on March 22, 1995 refers to o_orderdate = '1995-03-22';
SELECT COUNT(T1.o_orderkey) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T2.l_shipmode = 'REG AIR' AND T1.o_orderdate = '1995-03-22'
396
simple
professional_basketball
List the first name, last name, height and weight of the players who has all free throw attempted successfully made.
all free throw attempted successfully made refers to ftAttempted > 0 and ftAttempted = ftMade
SELECT DISTINCT T1.firstName, T1.lastName, T1.height, T1.weight FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.ft_attempted > 0 AND ft_attempted = ft_made
397
moderate
hockey
For the goalies whose weight are above 190, who had most goal againsts in 1978 season?
Weight of above 190 refers to weight >190; 1978 season refers to the year played
SELECT T1.playerID FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.year = '1978' AND T2.weight > 190 ORDER BY T1.GA DESC LIMIT 1
398
simple
university
In 2011, which university got the lowest score in teaching criteria?
in 2011 refers to year 2011; got the lowest score refers to MIN(score), teaching criteria refers to criteria_name = 'Teaching'
SELECT T3.university_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T1.criteria_name = 'Teaching' AND T2.year = 2011 ORDER BY T2.score ASC LIMIT 1
399
moderate