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
movie_3
List all the films with the word "Lacklusture" in their description.
films refers to title
SELECT title FROM film_text WHERE description LIKE '%Lacklusture%'
100
simple
food_inspection_2
Calculate the average inspections per year done by Jessica Anthony from 2010 to 2017.
from 2010 to 2017 refers to inspection_date > '2010-01-01' AND T2.inspection_id < '2017-12-31'; average inspections per year = divide(count(inspection_id where inspection_date > '2010-01-01' AND T2.inspection_id < '2017-12-31'), 8)
SELECT CAST(COUNT(CASE WHEN T1.first_name = 'Jessica' AND T1.last_name = 'Anthony' THEN T2.inspection_id ELSE 0 END) AS REAL) / 8 FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE strftime('%Y', T2.inspection_date) BETWEEN '2010' AND '2017'
101
moderate
synthea
Provide medications received by patients with an allergy to mould on 6th June 2016.
medications refers to DESCRIPTION from medications; allergy to mould refers to allergies where DESCRIPTION = 'Allergy to mould'; on 6th June 2016 refers to START = '6/6/16';
SELECT T2.DESCRIPTION FROM allergies AS T1 INNER JOIN medications AS T2 ON T1.PATIENT = T2.PATIENT WHERE T1.START = '6/6/16' AND T1.DESCRIPTION = 'Allergy to mould'
102
simple
language_corpus
How many biwords pairs are there whose second word is "grec"?
grec refers to word = 'grec'; wid where word = 'grec' AS w2nd
SELECT COUNT(T2.w1st) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w2nd WHERE T1.word = 'grec'
103
simple
soccer_2016
How many overs were there in the first innings of match ID "335996"?
the first innings refers to Innings_No = 1; match ID "335996" refers to Match_Id = 335996
SELECT COUNT(Over_Id) FROM Ball_by_Ball WHERE Match_Id = 335996 AND Innings_No = 1
104
simple
retail_world
Among the supplied products from Australia, describe the discontinued products and the category.
from Australia refers to Country = 'Australia'; discontinued products refers to Discontinued = 1;
SELECT T2.ProductName, T3.CategoryName 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 T1.Country = 'Australia' AND T2.Discontinued = 1
105
simple
restaurant
Which county is El Cerrito from?
El Cerrito refers to city = 'el cerrito'
SELECT county FROM geographic WHERE city = 'el cerrito'
106
simple
world_development_indicators
From 1968 to 1970, what are indicator names whose license type is open and values are less than 100?
From 1968 to 1970 refers to Year between '1968' and '1970'; values are less than 100 imply Value<100;
SELECT DISTINCT T1.IndicatorName FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName WHERE T1.Year >= 1968 AND T1.Year < 1971 AND T2.LicenseType = 'Open' AND T1.Value < 100
107
simple
food_inspection_2
What is the average number of inspections did risk level 3 taverns have?
risk level 3 refers to risk_level = '3'; tavern refers to facility_type = 'TAVERN'; average number = divide(count(inspection_id), sum(license_no)) where risk_level = '3' and facility_type = 'TAVERN'
SELECT CAST(COUNT(T2.inspection_id) AS REAL) / COUNT(DISTINCT T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.risk_level = 3 AND T1.facility_type = 'TAVERN'
108
simple
retail_world
Describe Sales Representative names who were hired in 1992 and compare the number of orders among them.
Sales Representative refers to Title = 'Sales Representative';were hired in 1992 refers to HireDate = '1992'
SELECT T1.FirstName, T1.LastName, COUNT(T2.OrderID) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.Title = 'Sales Representative' AND STRFTIME('%Y', T1.HireDate) = '1992' GROUP BY T1.EmployeeID, T1.FirstName, T1.LastName
109
moderate
authors
Who authored the paper titled "Testing timed automata "?
'Testing timed automata' is a title of a paper; Who authored refers to PaperAuthor.Name
SELECT T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = 'Testing timed automata'
110
simple
codebase_comments
How many methods with solutions with path 'maravillas_linq-to-delicious\tasty.sln'?
solution refers to SolutionId;
SELECT COUNT(T2.SolutionId) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.Path = 'maravillas_linq-to-delicious\tasty.sln'
111
simple
donor
Please list the resource names of project that teacher "822b7b8768c17456fdce78b65abcc18e" created.
teacher "822b7b8768c17456fdce78b65abcc18e" refers to teacher_acctid = '822b7b8768c17456fdce78b65abcc18e';
SELECT T1.item_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.teacher_acctid = '822b7b8768c17456fdce78b65abcc18e'
112
simple
music_tracker
An American rapper '2Pac' released his first solo album in 1991, how many years have passed until his next album was released?
2Pac is an artist; album refers to releaseType; groupYear = 1991; SUBTRACT(groupYear = 1991, groupYear where releaseType = 'album' LIMIT 1 OFFSET 1);
SELECT ( SELECT groupYear FROM torrents WHERE artist LIKE '2Pac' AND releaseType LIKE 'album' ORDER BY groupYear LIMIT 1, 1 ) - groupYear FROM torrents WHERE artist LIKE '2Pac' AND releaseType LIKE 'album' AND groupYear = 1991
113
moderate
hockey
How many people were in the Hall of Fame's Builder category?
SELECT COUNT(hofID) FROM HOF WHERE category = 'Builder'
114
simple
mondial_geo
What kind of mountain is Ampato? Which province and nation does this mountain belong to?
Nation refers to country
SELECT T1.Type, T3.Name, T4.Name FROM mountain AS T1 INNER JOIN geo_mountain AS T2 ON T1.Name = T2.Mountain INNER JOIN province AS T3 ON T3.Name = T2.Province INNER JOIN country AS T4 ON T3.Country = T4.Code WHERE T1.Name = 'Ampato'
115
simple
retail_complains
List date of the review of the Eagle Capital from Indianapolis, Indiana.
Eagle Capital refers to Product = 'Eagle Capital'; Indianapolis refers to city = 'Indianapolis'; Indiana refers to state_abbrev = 'IN'
SELECT T2.Date FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T2.Product = 'Eagle Capital' AND T1.city = 'Indianapolis' AND T1.state_abbrev = 'IN'
116
simple
university
List the name of universities located in Spain.
name of universities refers to university_name; located in Spain refers to country_name = 'Spain';
SELECT T1.university_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T2.country_name = 'Spain'
117
simple
chicago_crime
Please list all of the contact information for the police district Near West.
"Near West" is the district_name; all contact information refers to phone, fax, tty, twitter
SELECT phone, fax, tty, twitter FROM District WHERE district_name = 'Near West'
118
simple
codebase_comments
Please list the path of the solution that contains files found within the repository most people like.
more stars mean more people like this repository; most people like refers to max(Stars);
SELECT DISTINCT T2.Path FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = ( SELECT MAX(Stars) FROM Repo )
119
simple
chicago_crime
What is the percentage of under $500 thefts among all cases that happened in West Englewood?
under $500 refers to secondary_description = '$500 AND UNDER'; theft refers to primary_description = 'THEFT'; West Englewood refers to community_area_name = 'West Englewood'; percentage = divide(count(case_number where secondary_description = '$500 AND UNDER'), count(case_number)) where primary_description = 'THEFT' and community_area_name = 'West Englewood' * 100%
SELECT CAST(SUM(CASE WHEN T2.secondary_description = '$500 AND UNDER' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.case_number) FROM Crime AS T1 INNER JOIN IUCR AS T2 ON T1.iucr_no = T2.iucr_no INNER JOIN Community_Area AS T3 ON T1.community_area_no = T3.community_area_no WHERE T2.primary_description = 'THEFT' AND T3.community_area_name = 'West Englewood'
120
challenging
public_review_platform
In businesses with a category of mexican, how many of them has a star rating below 4?
category of mexican refers to category_name = 'Mexican'; star rating below 4 refers to stars < 4
SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.stars < 4 AND T3.category_name LIKE 'Mexican'
121
moderate
movie_3
Who among the actors starred in a NC-17 rated film? Provide only the last name of the actors.
NC-17 rated refers to rating = 'NC-17'
SELECT T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.rating = 'NC-17'
122
simple
coinmarketcap
Name the coin that have higher than average percentage price changed from the previous 24 hours for transaction on 2013/6/22.
average percentage price changed from the previous 24 hours refers to AVG(percent_change_24h); on 15/5/2013 refers to DATE = '2013-04-15'
SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2020-06-22' GROUP BY T1.name HAVING AVG(T2.percent_change_24h) > T2.PRICE
123
simple
retail_complains
Calculate the difference in the average age of elderly and middle-aged clients in the Northeast region.
difference in the average = SUBTRACT(AVG(age BETWEEN 35 AND 55), AVG( age > 65)); elderly refers to age > 65; middle-aged refers to age BETWEEN 35 AND 55;
SELECT (CAST(SUM(CASE WHEN T1.age BETWEEN 35 AND 55 THEN T1.age ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.age BETWEEN 35 AND 55 THEN 1 ELSE 0 END)) - (CAST(SUM(CASE WHEN T1.age > 65 THEN T1.age ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.age > 65 THEN 1 ELSE 0 END)) AS difference FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T2.state_abbrev = T3.StateCode WHERE T3.Region = 'Northeast'
124
challenging
college_completion
What's the average number of graduates for Central Alabama Community College in the 3 consecutive years from 2011 to 2013?
graduates refers to grad_cohort; Central Alabama Community College refers to chronname = 'Central Alabama Community College'; average number of graduates for 3 consecutive years = DIVIDE(SUM(SUM(grad_cohort WHERE year = 2011), SUM(grad_cohort WHERE year = 2012), SUM(grad_cohort WHERE year = 2013)), 3);
SELECT AVG(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Central Alabama Community College' AND T2.year IN (2011, 2012, 2013) AND T2.gender = 'B' AND T2.race = 'X'
125
moderate
bike_share_1
On 8/29/2013, who took the longest to arrive in California Ave Caltrain Station from University and Emerson? Indicate the bike id.
start_date = '8/29/2013'; end_date = '8/29/2013'; end_station_name = 'California Ave Caltrain Station'; start_station_name = 'University and Emerson'; who took the longest to arrive refers to MAX(duration);
SELECT bike_id FROM trip WHERE start_date LIKE '8/29/2013%' AND end_date LIKE '8/29/2013%' AND end_station_name = 'California Ave Caltrain Station' AND start_station_name = 'University and Emerson' AND duration = ( SELECT MAX(duration) FROM trip WHERE start_date LIKE '8/29/2013%' AND end_date LIKE '8/29/2013%' AND end_station_name = 'California Ave Caltrain Station' AND start_station_name = 'University and Emerson' )
126
challenging
trains
What is the percentage of all the trains with at least 4 cars? List the directions of the said trains.
at least 4 cars refers to trailPosi > = 4; calculation = MULTIPLY(DIVIDE(count(trailPosi > = 4 then id), count(id)), 100)
SELECT CAST(COUNT(CASE WHEN T2.trailPosi >= 4 THEN T1.id ELSE NULL END) AS REAL) * 100 / COUNT(T1.id) FROM trains AS T1 INNER JOIN ( SELECT train_id, MAX(position) AS trailPosi FROM cars GROUP BY train_id ) AS T2 ON T1.id = T2.train_id UNION ALL SELECT T1.direction FROM trains AS T1 INNER JOIN ( SELECT train_id, MAX(position) AS trailPosi FROM cars t GROUP BY train_id ) AS T2 ON T1.id = T2.train_id AND T2.trailPosi >= 4
127
challenging
shipping
List the driver's name of the shipment shipped on February 22, 2016.
on February 22, 2016 refers to ship_date = '2016-02-22'; driver's name refers to first_name, last_name
SELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_date = '2016-02-22'
128
simple
world
Calculate the average population per city in Karnataka district.
average population = AVG(Population);
SELECT AVG(Population) FROM City WHERE District = 'Karnataka' GROUP BY ID
129
simple
retails
What is the name of the customer whose order was delivered the longest?
name of the customer refers to c_name; delivered the longest refers to max(subtract(l_receiptdate, l_commitdate))
SELECT T3.c_name FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey INNER JOIN customer AS T3 ON T1.o_custkey = T3.c_custkey ORDER BY (JULIANDAY(T2.l_receiptdate) - JULIANDAY(T2.l_commitdate)) DESC LIMIT 1
130
moderate
airline
What is the tail number of the flight with air carrier named Iscargo Hf: ICQ and arrival time of 1000 and below?
tail number refers to TAIL_NUM; Iscargo Hf: ICQ refers to Description = 'Iscargo Hf: ICQ'; arrival time of 1000 and below refers to ARR_TIME < = 1000;
SELECT T2.TAIL_NUM FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T2.ARR_TIME <= 1000 AND T1.Description = 'Iscargo Hf: ICQ'
131
simple
codebase_comments
List all the path of solution from all the "it" lang code method.
path of the solution refers to Path; solution refers to Solution.Id;
SELECT DISTINCT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Lang = 'it'
132
simple
mondial_geo
Which country is home to the world's tiniest desert, and what are its longitude and latitude?
SELECT T2.Country, T1.Latitude, T1.Longitude FROM desert AS T1 INNER JOIN geo_desert AS T2 ON T1.Name = T2.Desert WHERE T1.Name = ( SELECT Name FROM desert ORDER BY Area ASC LIMIT 1 )
133
simple
movie_platform
What are the URL to the list page on Mubi of the lists with followers between 1-2 and whose last update timestamp was on 2012?
URL to the list page on Mubi refers to list_url; list_followers = 1 OR list_followers = 2; last update timestamp was on 2012 refers to list_update_timestamp_utc BETWEEN '2012-1-1' AND '2012-12-31';
SELECT list_url FROM lists WHERE list_update_timestamp_utc LIKE '2012%' AND list_followers BETWEEN 1 AND 2 ORDER BY list_update_timestamp_utc DESC LIMIT 1
134
moderate
books
What is the order price of the book "The Servant Leader" in 2003?
"The Servant Leader" is the title of the book; book in 2003 refers to SUBSTR(publication_date, 1, 4) = '2003'
SELECT T2.price FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T1.title = 'The Servant Leader' AND STRFTIME('%Y', T1.publication_date) = '2003'
135
moderate
retail_complains
What is the first name of clients who have the highest priority?
first name refers to first; highest priority refers to priority = 2
SELECT T1.first FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.priority = ( SELECT MAX(priority) FROM callcenterlogs )
136
simple
retail_world
Among the employees, give me the full names of those who have less than 4 territories.
less than 4 territories refers to EmployeeID where Count(TerritoryID) < 4
SELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.EmployeeID < 4
137
simple
movies_4
List the movies in the Somali language.
List the movies refers to title; Somali language refers to language_name = 'Somali'
SELECT T1.title FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id WHERE T3.language_name = 'Somali'
138
simple
cs_semester
List the student's first and last name that got a C in the course named "Applied Deep Learning".
student's first name refers to f_name; student's last name refers to l_name; got a C refers to grade = 'C';
SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Applied Deep Learning ' AND T2.grade = 'C'
139
moderate
mondial_geo
Which island is city Balikpapan located on? How big is the island?
SELECT T3.Name, T3.Area FROM city AS T1 INNER JOIN locatedOn AS T2 ON T1.Name = T2.City INNER JOIN island AS T3 ON T3.Name = T2.Island WHERE T1.Name = 'Balikpapan'
140
simple
books
How many orders in 2022 have Iran as their destinations?
Iran as their destination refers to country_name = 'Iran'; orders in 2022 refers to order_date LIKE '2022%'
SELECT COUNT(*) FROM country AS T1 INNER JOIN address AS T2 ON T1.country_id = T2.country_id INNER JOIN cust_order AS T3 ON T3.dest_address_id = T2.address_id WHERE T1.country_name = 'Iran' AND STRFTIME('%Y', T3.order_date) = '2022'
141
simple
cs_semester
Describe the names and credits of the least difficult courses.
diff refers to difficulty; the least difficult courses refer to MIN(diff);
SELECT name, credit FROM course WHERE diff = ( SELECT MIN(diff) FROM course )
142
simple
world_development_indicators
What is the subject of the series SP.DYN.AMRT.MA and what does it pertain to?
subject refers to topic; pertain to refers to Description
SELECT DISTINCT T1.Topic, T2.Description FROM Series AS T1 INNER JOIN SeriesNotes AS T2 ON T1.SeriesCode = T2.Seriescode WHERE T1.SeriesCode = 'SP.DYN.AMRT.MA'
143
simple
professional_basketball
What is the full name of the team that selected Mike Lynn?
full name refers to teams.name
SELECT T1.name FROM teams AS T1 INNER JOIN draft AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.draftYear WHERE T2.firstName = 'Mike' AND T2.lastName = 'Lynn'
144
simple
food_inspection_2
What is the assumed name of the business located at 2903 W Irving Park Rd?
assumed name refers to dba_name; 2903 W Irving Park Rd refers to address = '2903 W IRVING PARK RD '
SELECT DISTINCT dba_name FROM establishment WHERE address = '2903 W IRVING PARK RD '
145
simple
restaurant
Among all asian restaurants in N. Milpitas Blvd., Milpitas, how many of them have restaurant ID greater than 385?
asian restaurant refers to food_type = 'asian'; N. Milpitas Blvd. refers to street_name = 'n milpitas blvd'; Milpitas refers to city = 'milpitas'; restaurant ID greater than 385 refers to id_restaurant > 385
SELECT COUNT(T1.id_restaurant) AS num FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.city = 'milpitas' AND T2.food_type = 'asian' AND T1.street_name = 'n milpitas blvd' AND T1.id_restaurant > 385
146
moderate
address
Name the bad alias of Geneva, AL.
"Geneva" is the city; 'AL' is the state
SELECT T1.bad_alias FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Geneva' AND T2.state = 'AL'
147
simple
works_cycles
When is the modified date of the phone number "1500 555-0143"?
SELECT ModifiedDate FROM PersonPhone WHERE PhoneNumber = '1 (11) 500 555-0143'
148
simple
soccer_2016
How many players bat with their left hands?
bat with their left hands refers to Batting_hand = 'Left-hand bat'
SELECT SUM(CASE WHEN T2.Batting_hand = 'Left-hand bat' THEN 1 ELSE 0 END) FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id
149
simple
chicago_crime
How many crimes were handled by Brendan Reilly on 7th October 2018?
7th October 2018 refers to date like '10/7/2018%'
SELECT SUM(CASE WHEN T2.alderman_last_name = 'Reilly' THEN 1 ELSE 0 END) FROM Crime AS T1 INNER JOIN Ward AS T2 ON T1.ward_no = T2.ward_no WHERE T2.alderman_name_suffix IS NULL AND T2.alderman_first_name = 'Brendan' AND date LIKE '10/7/2018%'
150
moderate
book_publishing_company
For all authors from CA who are not on contract, which title of his/hers has the most year to date sales.
year to date sales refers to ytd_sales; on contract refers to contract = 1
SELECT T1.title FROM titles AS T1 INNER JOIN titleauthor AS T2 ON T1.title_id = T2.title_id INNER JOIN authors AS T3 ON T2.au_id = T3.au_id WHERE T3.contract = 0 AND T3.state = 'CA' ORDER BY T1.ytd_sales DESC LIMIT 1
151
moderate
donor
Which payment method is most comonly used by the schools in the state of Georgia for the payment of donations?
Georgia refer to school_state = 'GA'
SELECT T1.payment_method FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_state = 'GA' GROUP BY T2.school_state ORDER BY COUNT(T1.payment_method) DESC LIMIT 1
152
simple
student_loan
Which students that are in the marines have been absent for 6 months?
in the marines refers to organ = 'marines'; absent for 6 months refers to month = 6
SELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T2.organ = 'marines' AND T1.`month` = 6
153
simple
regional_sales
What is the customer names of orders which have unit cost greater than 4000USD?
unit cost greater than 4000USD refers to Unit Cost > 4000;
SELECT T FROM ( SELECT DISTINCT CASE WHEN T2.`Unit Cost` > 4000 THEN T1.`Customer Names` END AS T FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID ) WHERE T IS NOT NULL
154
simple
regional_sales
In which regions are the stores that have shipped products through the WARE-UHY1004 warehouse?
"WARE-UHY1004" is the WarehouseCode
SELECT T FROM ( SELECT DISTINCT CASE WHEN T3.WarehouseCode = 'WARE-UHY1004' THEN T1.Region END AS T FROM Regions T1 INNER JOIN `Store Locations` T2 ON T2.StateCode = T1.StateCode INNER JOIN `Sales Orders` T3 ON T3._StoreID = T2.StoreID ) WHERE T IS NOT NULL
155
moderate
works_cycles
What is the surname suffix of the employee who works as a store contact and has the longest sick leave hours?
store contact refers to PersonType = 'SC';
SELECT T2.Suffix FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.PersonType = 'SP' ORDER BY T1.SickLeaveHours DESC LIMIT 1
156
simple
shakespeare
How many paragraphs are there in Act 5 Scene 1 of "Comedy of Errors"?
"Comedy of Errors" refers to Title = 'Comedy of Errors'
SELECT COUNT(T3.id) 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 WHERE T2.Act = 5 AND T2.Scene = 1 AND T1.Title = 'Comedy of Errors'
157
moderate
video_games
Calculate the number of games in the fighting genre.
fighting genre refers to genre_name = 'Fighting';
SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Fighting'
158
simple
synthea
Please list all the medication that are prescribed to Elly Koss.
medication that are prescribed refers to DESCRIPTION from medications;
SELECT DISTINCT T2.description FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss'
159
simple
beer_factory
How many sweet bottled root beers that do not contain cane sugar were purchased in 2015 through the selling company located in Sac State American River Courtyard?
sweet refers to Honey = 'TRUE'; bottled refers to ContainerType = 'Bottle'; do not contain cane sugar refers to CaneSugar = 'FALSE'; in 2015 refers to PurchaseDate < = '2015-12-31'; Sac State American River Courtyard refers to LocationName = 'Sac State American River Courtyard';
SELECT COUNT(T1.BrandID) FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID INNER JOIN location AS T3 ON T1.LocationID = T3.LocationID WHERE T3.LocationName = 'Sac State American River Courtyard' AND T1.PurchaseDate LIKE '2015%' AND T2.Honey = 'TRUE' AND T2.CaneSugar = 'FALSE' AND T1.ContainerType = 'Bottle'
160
challenging
public_review_platform
How many photos type compliment given from users with high cool votes?
photos type compliment refers to compliment_type = 'photos'; high cool votes refers to review_votes_cool = 'High'
SELECT COUNT(T1.user_id) FROM Users AS T1 INNER JOIN Users_Compliments AS T2 ON T1.user_id = T2.user_id INNER JOIN Compliments AS T3 ON T2.compliment_id = T3.compliment_id INNER JOIN Reviews AS T4 ON T1.user_id = T4.user_id WHERE T3.compliment_type = 'photos' AND T4.review_votes_cool = 'High'
161
moderate
retail_world
Who is the sales representative of the customer who has made the highest payment? Include the full name of employee and his/her supervisor.
highest payment refers to Max(Multiply(Quantity, UnitPrice, Subtract(1, Discount))); full name refers to FirstName, LastName; his/her supervisor refers to 'ReportsTo'
SELECT T4.LastName, T4.FirstName, T4.ReportsTo , T1.Quantity * T1.UnitPrice * (1 - T1.Discount) AS payment FROM `Order Details` AS T1 INNER JOIN Orders AS T2 ON T1.OrderID = T2.OrderID INNER JOIN Customers AS T3 ON T2.CustomerID = T3.CustomerID INNER JOIN Employees AS T4 ON T2.EmployeeID = T4.EmployeeID ORDER BY payment DESC LIMIT 1
162
moderate
ice_hockey_draft
What is the average weight in pounds of all the players with the highest prospects for the draft?
average = AVG(weight_in_lbs); weight in pounds refers to weight_in_lbs; players refers to PlayerName; highest prospects for the draft refers to MAX(CSS_rank);
SELECT CAST(SUM(T2.weight_in_lbs) AS REAL) / COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T1.CSS_rank = ( SELECT MAX(CSS_rank) FROM PlayerInfo )
163
moderate
professional_basketball
What is the nickname of the NBA player whose team competed in the Western Conference in the season 2006 and who had a total of two blocks?
completed in the Western conference refers to conference = 'West'; in season 2006 refers to season_id = 2006; total of two blocks refers to blocks = 2; nickname refers to nameNick
SELECT T2.nameNick FROM player_allstar AS T1 INNER JOIN players AS T2 ON T1.playerID = T2.playerID WHERE T1.blocks = 2 AND T1.conference = 'West' AND T1.season_id = 2006
164
moderate
student_loan
Which organization does student 313 belong to?
organization refers to organ
SELECT organ FROM enlist WHERE name = 'studenT113'
165
simple
menu
Please list the IDs of the menus that are DIYs of the restaurant and have the dish "Clear green turtle".
IDs of the menus refers to menu_id; menus that are DIYs of the restaurant refers to sponsor is null; Clear green turtle is a name of dish;
SELECT T2.menu_id FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id INNER JOIN Dish AS T4 ON T1.dish_id = T4.id WHERE T4.name = 'Clear green turtle' AND T3.sponsor IS NULL
166
moderate
synthea
Provide the number of encounters for Major D'Amore.
SELECT COUNT(T2.ID) FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Major' AND T1.last = 'D''Amore'
167
simple
simpson_episodes
Please give the name of the director who achieved the Outstanding Animated Program (For Programming Less Than One Hour) award whose episode title is "No Loan Again, Naturally".
the director refers to role = 'director'
SELECT T1.person FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.role = 'director' AND T1.award = 'Outstanding Animated Program (For Programming Less Than One Hour)' AND T2.title = 'No Loan Again, Naturally';
168
moderate
public_review_platform
Is the payment in mastercard possible for the Yelp business No."12476"?
Yelp business No."12476" refers to business_id = '12476'; payment in mastercard refers to attribute_value = 'payment_types_mastercard'
SELECT T1.attribute_value FROM Business_Attributes AS T1 INNER JOIN Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.business_id = 12476 AND T2.attribute_name = 'payment_types_mastercard'
169
simple
retail_world
Who are the top 8 suppliers supplying the products with the highest user satisfaction?
highest user satisfaction refers to max(ReorderLevel);
SELECT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID ORDER BY T1.ReorderLevel DESC LIMIT 8
170
simple
restaurant
Which county and region does the street E. El Camino Real belong to?
street E. El Camino Real refers to street_name = 'E. El Camino Real'
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'
171
simple
synthea
Identify the allergy period for Isadora Moen and what triggered it.
allergy period = SUBTRACT(allergies.START, allergies.STOP); what triggered the allergy refers to allergies.DESCRIPTION;
SELECT T2.START, T2.STOP, T2.DESCRIPTION FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Isadora' AND T1.last = 'Moen'
172
simple
retail_world
What is the full name of the employee who is in charge of the territory of Denver?
full name refers to FirstName, LastName; Denver is a TerritoryDescription
SELECT T1.FirstName, T1.LastName 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 T3.TerritoryDescription = 'Denver'
173
moderate
talkingdata
Please list any three devices that are owned by female users.
female refers to gender = 'F';
SELECT device_id FROM gender_age WHERE gender = 'F' LIMIT 3
174
simple
olympics
What were the cities in which John Aalberg competed?
cities refer to city_name;
SELECT T4.city_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN games_city AS T3 ON T2.games_id = T3.games_id INNER JOIN city AS T4 ON T3.city_id = T4.id WHERE T1.full_name = 'John Aalberg'
175
simple
legislator
Among the female legislators, what is the percentage of the senators in Maine?
female refers to gender_bio = 'F'; percentage = MULTIPLY(DIVIDE(SUM(type = 'sen'), COUNT(type)), 100.0); senators refers to type = 'sen'; Maine refers to state = 'ME';
SELECT CAST(SUM(CASE WHEN T2.type = 'sen' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.type) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.state = 'ME' AND T1.gender_bio = 'F'
176
moderate
movies_4
List 10 movie titles that were produced in France.
France refers to country_name = 'France'
SELECT T1.title 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 WHERE T3.COUNTry_name = 'France' LIMIT 10
177
simple
shipping
What is the brand and model of truck used in shipment id 1055?
shipment id 1055 refers to ship_id = 1055; brand refers to make; model refers to model_year
SELECT T1.make, T1.model_year FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1055'
178
simple
soccer_2016
Give the name of the youngest player.
name of player refers to Player_Name; the youngest refers to max(DOB)
SELECT Player_Name FROM Player ORDER BY DOB DESC LIMIT 1
179
simple
cs_semester
For the 3-credit course with the easiest difficulty, how many students get an "A" in that course?
diff refers to difficulty; diff is higher means the course is more difficult in which easiest difficulty refers to diff = 1; 3-credit course refers to credit = '3'; get an "A" refers to grade = 'A' for the course;
SELECT COUNT(T1.student_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.grade = 'A' AND T2.credit = '3' AND T2.diff = 1
180
simple
sales_in_weather
On how many days with the max temperature over 90 did the sale of item no.5 in store no.3 exceed 100?
max temperature over 90 refers to tmax > 90; item no. 5 refers to item_nbr = 5; store no.3 refers to store_nbr = 3; sale exceed 100 refers to units > 100; number of days refers to count (date)
SELECT SUM(CASE WHEN units > 100 THEN 1 ELSE 0 END) AS count FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND SUBSTR(T1.`date`, 1, 4) = '2012' AND T1.item_nbr = 5 AND tmax > 90
181
challenging
software_company
Of the first 60,000 customers who sent a true response to the incentive mailing sent by the marketing department, how many of them are divorced males?
RESPONSE = 'true'; SEX = 'Male'; MARITAL_STATUS = 'Divorced';
SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T1.SEX = 'Male' AND T1.MARITAL_STATUS = 'Divorced' AND T2.RESPONSE = 'true'
182
moderate
movielens
What's different average revenue status for director who directed the movie that got the most 1 ratings?
SELECT DISTINCT T1.avg_revenue FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid WHERE T1.d_quality = 5
183
simple
public_review_platform
List the categories of inactive businesses in AZ.
inactive business refers to active = 'FALSE'; 'AZ' is the state; category refers to category_name
SELECT T3.category_name FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.active LIKE 'FALSE' AND T1.state LIKE 'AZ'
184
moderate
professional_basketball
From 1950 to 1970, how many coaches who received more than 1 award?
from 1950 to 1970 refers to year between 1950 and 1970; more than 3 awards refers to count(award) > 3
SELECT COUNT(coachID) FROM awards_coaches WHERE year BETWEEN 1950 AND 1970 GROUP BY coachID HAVING COUNT(coachID) > 1
185
simple
public_review_platform
Among the users whose fan is medium, how many users received high compliments from other users.
is medium refers to user_fans = 'Medium'; high compliments refers to number_of_compliments = 'High'
SELECT COUNT(T1.user_id) FROM Users AS T1 INNER JOIN Users_Compliments AS T2 ON T1.user_id = T2.user_id WHERE T2.number_of_compliments = 'High' AND T1.user_fans = 'Medium'
186
moderate
talkingdata
How many users are there in the Home Decoration category?
SELECT COUNT(T1.app_id) FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T2.label_id = T1.label_id WHERE T2.category = 'Home Decoration'
187
simple
retail_world
Give the reorder level for the products from the supplier "Nord-Ost-Fisch Handelsgesellschaft mbH".
supplier "Nord-Ost-Fisch Handelsgesellschaft mbH" refers to CompanyName = 'Nord-Ost-Fisch Handelsgesellschaft mbH'
SELECT T1.ReorderLevel FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Nord-Ost-Fisch Handelsgesellschaft mbH'
188
simple
shakespeare
What is the description of chapter 18704, where there is a character called Orsino?
chapter 18704 refers to chapters.id = 18704; character called Orsino refers to CharName = 'Orsino'
SELECT DISTINCT T3.Description FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id INNER JOIN chapters AS T3 ON T2.chapter_id = T3.id WHERE T1.CharName = 'Orsino' AND T3.ID = 18704
189
simple
law_episode
Which episode number has the second highest positive viewer comments and has been awarded "Best Television Episode"?
episode number refers to episode_id; awarded "Best Television Episode" refers to award = 'Best Television Episode' and result = 'Winner'; the second highest positive viewer comments refers to rating = 8.5
SELECT T2.episode_id FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.award = 'Best Television Episode' AND T1.result = 'Winner' ORDER BY T2.rating DESC LIMIT 2
190
moderate
olympics
How many male competitors were there who participated in 1948 Summer?
male competitors refers to id where gender = 'M'; in 1948 Summer refers to games_name = '1948 Summer';
SELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_name = '1948 Summer' AND T3.gender = 'M'
191
simple
student_loan
What is the total number of students in the school?
SELECT COUNT(name) FROM person
192
simple
university
List the names of universities with a score less than 28% of the average score of all universities in 2015.
in 2015 refers to year = 2015; score less than 28% refers to score < MULTIPLY(avg(score), 0.28) where year = 2015; names of universities refers to university_name
SELECT T2.university_name FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2015 AND T1.score * 100 < ( SELECT AVG(score) * 28 FROM university_ranking_year WHERE year = 2015 )
193
simple
car_retails
When was the product with the highest unit price shipped?
The highest unit price refers to MAX(priceEach); when shipped refers to shippedDate;
SELECT t1.shippedDate FROM orders AS t1 INNER JOIN orderdetails AS t2 ON t1.orderNumber = t2.orderNumber ORDER BY t2.priceEach DESC LIMIT 1
194
simple
shakespeare
Provide the character name, paragraph number, and plain text of "cousin to the king" description.
character name refers to CharName; paragraph number refers to ParagraphNum
SELECT T1.CharName, T2.ParagraphNum, T2.PlainText FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.Description = 'cousin to the king'
195
simple
shakespeare
In "Florence. Without the walls. A tucket afar off", what is the id of the character that was mentioned in "His name, I pray you."?
"Florence. Without the walls. A tucket afar off" refers to chapters.Description = 'Florence. Without the walls. A tucket afar off.'; "His name, I pray you." refers to PlainText = 'His name, I pray you.'
SELECT T1.character_id FROM paragraphs AS T1 INNER JOIN chapters AS T2 ON T1.chapter_id = T2.id WHERE T1.PlainText = 'His name, I pray you.' AND T2.Description = 'Florence. Without the walls. A tucket afar off.'
196
moderate
codebase_comments
For the repository with '8094' watchers , how many solutions does it contain?
repository refers to Repo.Id and RepoId; solutions a repository contains refers to Solution.Id;
SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Watchers = 8094
197
simple
public_review_platform
What is the total number of active business in AZ with a high review count?
active business refers to active = 'true'; 'AZ' is the state; high review count refers to review_count = 'High'
SELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND review_count LIKE 'High' AND active LIKE 'True'
198
simple
video_games
Which is the publisher for the game "Prism: Light the Way"?
publisher refers to publisher_name; game "Prism: Light the Way" refers to game_name = 'Prism: Light the Way'
SELECT T1.publisher_name FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T3.game_name = 'Prism: Light the Way'
199
moderate