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_platform
What is the average score for the movie Versailles Rive-Gauche?
Versailles Rive-Gauche' is movie_title; average score refers to Avg(rating_score);
SELECT AVG(T1.rating_score) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title LIKE 'Versailles Rive-Gauche'
6,200
simple
shipping
What is the brand of the truck that is used to ship by Zachery Hicks?
brand of truck refers to make
SELECT DISTINCT T1.make FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id INNER JOIN driver AS T3 ON T3.driver_id = T2.driver_id WHERE T3.first_name = 'Zachery' AND T3.last_name = 'Hicks'
6,201
simple
image_and_language
How many samples of food object are there in image no.6?
samples of food object refers to OBJ_CLASS = 'food'; image no.6 refers to IMG_ID = 6
SELECT COUNT(T2.OBJ_SAMPLE_ID) FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 6 AND T1.OBJ_CLASS = 'food'
6,202
simple
retail_complains
What are the complaint id of client who were born in 1931?
in 1931 refers to year = 1931
SELECT T2.`Complaint ID` FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.year = 1931
6,203
simple
menu
List the dishes that appeared at the left upper corner of the CHAS.BRADLEY'S OYSTER & DINING ROOM"s sponsored menu.
appeared at the left upper corner refers to xpos < 0.25 and ypos < 0.25; CHAS.BRADLEY'S OYSTER & DINING ROOM refers to sponsor = 'CHAS.BRADLEY''S OYSTER & DINING ROOM';
SELECT T4.name 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 T3.sponsor = 'CHAS.BRADLEY''S OYSTER & DINING ROOM' AND T1.xpos < 0.25 AND T1.ypos < 0.25
6,204
moderate
donor
List by school id projects from schools located in the Union Pub School District I-9 that have a New York teaching fellow
located in the Union Pub School District I-9 refers to school_district = 'Union Pub School District I-9'; New York teaching fellow refers to teacher_ny_teaching_fellow = 't'
SELECT schoolid FROM projects WHERE school_district = 'Union Pub School District I-9' AND teacher_ny_teaching_fellow = 't'
6,205
simple
hockey
What is the percentage of American players among all the players who have gotten in the Hall of Fame?
percentage of American players = divide(count(hofID where birthCountry = 'USA'), count(hofID))*100%
SELECT CAST(COUNT(CASE WHEN T1.birthCountry = 'USA' THEN T1.playerID ELSE NULL END) AS REAL) * 100 / COUNT(T1.playerID) FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID
6,206
moderate
world
How many languages are there in the country where Tocantins district belongs?
SELECT COUNT(DISTINCT T2.Language) FROM City AS T1 INNER JOIN CountryLanguage AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.District = 'Tocantins'
6,207
simple
simpson_episodes
How old was composer of the show when he was nominated for Emmy's Outstanding Music Composition for a Series in 2009. Indicate his full name as well.
in 2009 refers to year = 2009; old refers to SUBTRACT(2009, birthdate); composer of the show refers to role = 'composer'; Emmy's refers to organization = 'Primetime Emmy Awards'; nominated refers to result = 'Nominee'; Outstanding Music Composition refers to award = 'Outstanding Music Composition for a Series (Original Dramatic Score)'
SELECT T1.year - T2.birthdate AS ageIn2009, T2.name FROM Award AS T1 INNER JOIN Person AS T2 ON T1.person = T2.name WHERE T1.role = 'composer' AND T1.organization = 'Primetime Emmy Awards' AND T1.award = 'Outstanding Music Composition for a Series (Original Dramatic Score)' AND T1.result = 'Nominee' AND T1.year = 2009;
6,208
challenging
works_cycles
How many materials still need to be assembled and have a depth of 2 between each component and their parent product?
still need to be assembled means the assembly doesn't finish or still going on which refers to EndDate IS NULL; a depth of 2 refers to BOMLevel = 2;
SELECT COUNT(*) FROM BillOfMaterials WHERE BOMLevel = 2 AND EndDate IS NULL
6,209
simple
codebase_comments
Which solution contains files within a more popular repository, the solution ID18 or solution ID19?
more watchers mean that this repository is more popular;
SELECT CASE WHEN SUM(CASE WHEN T2.Id = 18 THEN T1.Watchers ELSE 0 END) > SUM(CASE WHEN T2.Id = 19 THEN T1.Watchers ELSE 0 END) THEN 'SolutionID18' WHEN SUM(CASE WHEN T2.Id = 18 THEN T1.Watchers ELSE 0 END) < SUM(CASE WHEN T2.Id = 19 THEN T1.Watchers ELSE 0 END) THEN 'SolutionID19' END isMorePopular FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId
6,210
challenging
music_platform_2
Indicate the id of the reviewer whose itunes id is 1516665400.
"151665400" is itunes_id; id of reviewer refers to author_id
SELECT T2.author_id FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.itunes_id = 1516665400
6,211
simple
movielens
Please list movie IDs which has the oldest publication date and the cast numbers are zero.
Year contains relative value, higher year value refers to newer date; Year = 1 refer to oldest date
SELECT DISTINCT T1.movieid FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.year = 1 AND T2.cast_num = 0
6,212
simple
bike_share_1
Which day in the month of November, 2014 have a foggy weather in the zip code 94301 and in total, how many bikes were borrowed by subscribers from all of the stations in the said day?
day in the month of November, 2014 refers to start_date between '11/1/2014' and '11/30/2014'; foggy weather refers to events = 'Fog'; subscriber refers to subscription_type; all of the stations bikes were borrowed from refer to start_station_name;
SELECT T2.date, COUNT(T1.start_station_name) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.date LIKE '11/%/2014%' AND T2.zip_code = 94301 AND T2.events = 'Fog' AND T1.subscription_type = 'Subscriber'
6,213
moderate
food_inspection_2
How much is the salary of the employee who has the highest number of inspections done of all time?
the highest number of inspections done refers to max(count(employee_id))
SELECT T1.salary FROM employee AS T1 INNER JOIN ( SELECT employee_id, COUNT(inspection_id) FROM inspection GROUP BY employee_id ORDER BY COUNT(inspection_id) DESC LIMIT 1 ) AS T2 ON T1.employee_id = T2.employee_id
6,214
simple
bike_share_1
What is the ratio for subscriber to customer given that the starting and the ending stations is 2nd at South Park?
subscriber refers to subscription_type = 'Subscriber'; customer refers to subscription_type = 'customer';starting station refers to start_station_name; ending station refers to end_statio_name; start_station_name = '2nd at South Park' AND end_station_name = '2nd at South Park'
SELECT CAST(SUM(IIF(subscription_type = 'Subscriber', 1, 0)) AS REAL) / SUM(IIF(subscription_type = 'Customer', 1, 0)) FROM trip WHERE start_station_name = '2nd at South Park' AND end_station_name = '2nd at South Park'
6,215
moderate
simpson_episodes
Among episodes from 10 to 20, which episode has more than 200 votes?
episodes from 10 to 20 refers to episode BETWEEN 10 and 20; more than 200 votes refers to COUNT(votes) > 200
SELECT DISTINCT T1.episode FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.episode BETWEEN 10 AND 20 AND T2.votes > 200;
6,216
simple
movies_4
What is the name of the director of photography of the movie "Pirates of the Caribbean: At World's End"?
name of the director of photography refers to person_name where job = 'Director of Photography'; "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' AND T2.job = 'Director of Photography'
6,217
moderate
social_media
For the tweet which got a reach number of 547851, which country did it come from?
reach number of 547851 refers to Reach = 547851
SELECT T2.Country FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T1.Reach = 547851
6,218
simple
food_inspection
List the tax code and inspection type of the business named "Rue Lepic".
"Rue Lepic" is the name of the business;
SELECT DISTINCT T3.tax_code, T2.type FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id INNER JOIN businesses AS T3 ON T2.business_id = T3.business_id WHERE T3.name = 'Rue Lepic'
6,219
simple
retail_complains
In reviews for the Eagle National Bank product, how many of the 5 star reviews where from Nashville, Tennessee?
5 star refers to Stars = 5; Nashville refers to city = 'Nashville'; Tennessee refers to state_abbrev = 'TN'
SELECT COUNT(T2.Stars) FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T1.city = 'Nashville' AND T1.state_abbrev = 'TN' AND T2.Product = 'Eagle National Mortgage' AND T2.Stars = 5
6,220
moderate
restaurant
At what numbers on 9th Avenue of San Francisco there are restaurants?
9th Avenue refers to street_name = '9th avenue'; San Francisco refers to City = 'san francisco'
SELECT id_restaurant FROM location WHERE City = 'san francisco' AND street_name = '9th avenue'
6,221
simple
disney
Provide the titles, main characters, and associated songs of the movies directed by Wolfgang Reitherman in 1977.
Wolfgang Reitherman refers to director = 'Wolfgang Reitherman'; 1997 refers to substr(release_date, length(release_date) - 3, length(release_date)) = '1977'; the titles refer to movie_title; main characters refer to hero;
SELECT T1.movie_title, T2.hero, T2.song FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title INNER JOIN director AS T3 ON T1.movie_title = T3.name WHERE T3.director = 'Wolfgang Reitherman' AND SUBSTR(T1.release_date, LENGTH(T1.release_date) - 3, LENGTH(T1.release_date)) = '1977'
6,222
challenging
disney
Provide the movie titles and the estimated inflation rate of the highest total grossed movie.
The highest grossed movie refers to MAX(total_gross); DIVIDE(inflation_adjusted_gross, total_gross) as percentage;
SELECT movie_title, CAST(REPLACE(trim(inflation_adjusted_gross, '$'), ',', '') AS REAL) / CAST(REPLACE(trim(total_gross, '$'), ',', '') AS REAL) FROM movies_total_gross ORDER BY CAST(REPLACE(trim(total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1
6,223
challenging
hockey
Which year recorded the most number of goals by a player and how old was the player at the time the most number of goals was achieved by him?
most number of goals refers to max(G); how old refers to age = subtract(year(max(G)), birthYear)
SELECT T1.year, T1.year - T2.birthYear FROM Scoring AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID GROUP BY T1.year, T1.year - T2.birthYear ORDER BY SUM(T1.G) DESC LIMIT 1
6,224
moderate
works_cycles
What is the location of business number 1?
Location refers to AddressLine1; business number refers to the BusinessEntityID where BusinessEntityID = 1
SELECT T1.AddressLine1 FROM Address AS T1 INNER JOIN BusinessEntityAddress AS T2 USING (AddressID) WHERE T2.BusinessEntityID = 1
6,225
simple
synthea
What kind of allergy is most common among white people?
kind of allergy is most common refers to MAX(COUNT(DESCRIPTION)) from allergies; white refers to race = 'white';
SELECT T2.DESCRIPTION FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T1.race = 'white' GROUP BY T2.DESCRIPTION ORDER BY COUNT(T2.DESCRIPTION) DESC LIMIT 1
6,226
simple
codebase_comments
Please provide the solution id of the respository among the respository that receive 238 forks.
solution id of the repository refers to solution.Id;
SELECT T2.Id FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks = 238
6,227
simple
superstore
Please list any three orders that caused a loss to the company.
caused a loss to the company refers to Profit < 0
SELECT `Order ID` FROM central_superstore WHERE Profit < 0 LIMIT 3
6,228
simple
talkingdata
How many events were held at coordinate 97,40?
coordinate 97,40 refers to longitude = 97 AND latitude = 40;
SELECT COUNT(event_id) FROM `events` WHERE latitude = 40 AND longitude = 97
6,229
simple
restaurant
Calculate the average rating of reviews for restaurants in Santa Cruz County.
average rating = divide(sum(review where county = 'santa cruz county'), count(id_restaurant where county = 'santa cruz county'))
SELECT AVG(T2.review) FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.county = 'santa cruz county'
6,230
simple
public_review_platform
How many users became an elite user the same year they joined Yelp?
became an elite user the same year they joined Yelp refers to user_yelping_since_year = year_id
SELECT COUNT(T1.user_id) FROM Users AS T1 INNER JOIN Elite AS T2 ON T1.user_id = T2.user_id WHERE T1.user_yelping_since_year = T2.year_id
6,231
simple
world_development_indicators
List down the series codes in which the topic is about Environment: Emissions and the license type is restricted. Please include their alpha code.
SELECT SeriesCode FROM Series WHERE Topic = 'Environment: Emissions' AND LicenseType = 'Restricted'
6,232
simple
works_cycles
Among the salable products from the mountain product line, how many of them have the most reviews?
salable product refers to FinishedGoodsFlag = 1; mountain product line refers to ProductLine = 'M'
SELECT SUM(CASE WHEN T2.ProductLine = 'M' THEN 1 ELSE 0 END) FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.FinishedGoodsFlag = 1 GROUP BY T1.ProductID ORDER BY COUNT(T1.ProductReviewID) DESC LIMIT 1
6,233
moderate
donor
How many donations from teachers were done in the state of Colorado?
from teachers refers to is_teacher_acct = 't'; the state of Colorado refers to donor_state = 'CO-Colorado'
SELECT COUNT(donationid) FROM donations WHERE is_teacher_acct = 't' AND donor_state = 'CO'
6,234
simple
trains
Trains that run in which direction have more rectangle-shaped cars in total?
more rectangle-shaped cars refers to MAX(rectCarsNum)
SELECT T1.direction FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS rectCarsNum FROM cars WHERE shape = 'rectangle' GROUP BY train_id ) AS T2 ON T1.id = T2.train_id ORDER BY T2.rectCarsNum DESC
6,235
simple
talkingdata
Please provide the age group of any LG Nexus 4 device users.
age group refers to `group`; LG Nexus 4 refers to phone_brand = 'LG' AND device_model = 'Nexus 4';
SELECT T1.`group` FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'LG' AND T2.device_model = 'Nexus 4'
6,236
simple
talkingdata
How many users belong to the same behavior category as comics?
behavior category refers to category; category = 'comics';
SELECT COUNT(T2.app_id) FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'comics'
6,237
simple
public_review_platform
Among the active businesses in Arizona, how many businesses work after 12PM?
active businesses in Arizona refer to business_id where state = 'Arizona' and active = 'true'; work after 12PM refer to opening_time > '12PM';
SELECT COUNT(DISTINCT T2.business_id) FROM Business_Hours AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T2.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T2.active = 'true' AND T2.state = 'AZ' AND T1.opening_time > '12PM'
6,238
moderate
simpson_episodes
What are the characters that were nominated for Primetime Emmy Award from 2009 to 2010 but did not win?
nominated for Primetime Emmy Award but did not win refers to award_category = 'Primetime Emmy' and result = 'Nominee';  from 2009 to 2010 refers to year > = '2009' and  year < = '2010'
SELECT T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.award_category = 'Primetime Emmy' AND T1.year BETWEEN 2009 AND 2010 AND T1.result != 'Winner';
6,239
moderate
soccer_2016
Who is the oldest player?
name of the player refers to Player_Name; the oldest refers to min(DOB)
SELECT Player_Name FROM Player ORDER BY DOB ASC LIMIT 1
6,240
simple
european_football_1
List the number of games that ended up with 5-0 in Greece.
5-0 is a score where FTHG = '5' and FTAG = '0'; Greece is a name of country; games refer to Div;
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.country = 'Greece' AND T1.FTHG = 5 AND T1.FTAG = 0
6,241
simple
restaurant
How many restaurants have more than 4 star reviews?
more than 4 star review refers to review > 4
SELECT COUNT(id_restaurant) AS cnt FROM generalinfo WHERE review > 4
6,242
simple
olympics
What is the id of Rio de Janeiro?
Rio de Janeiro refers to city_name = 'Rio de Janeiro';
SELECT id FROM city WHERE city_name = 'Rio de Janeiro'
6,243
simple
world_development_indicators
List out the series code of countries using Euro as their currency unit.
SELECT DISTINCT T2.SeriesCode FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.CurrencyUnit = 'Euro'
6,244
simple
movie_platform
For all ratings which are rated in year 2020, name the movies which has the rating scored 4 and above.
ratings in year 2020 refers to rating_timestamp_utc like '%2020%'; rating_score > = 4;
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE CAST(SUBSTR(T1.rating_timestamp_utc, 1, 4) AS INTEGER) = 2020 AND CAST(SUBSTR(T1.rating_timestamp_utc, 6, 2) AS INTEGER) > 4
6,245
challenging
music_platform_2
How many people rated 5 for the podcast which title contains the word 'spoiler' under the 'art' category '?
rated 5 refers to rating = 5; contain the word 'spoilers' refers to title like '%spoilers%'; 'art' is the category name;
SELECT COUNT(T3.podcast_id) FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T2.title LIKE '%spoilers%' AND T1.category = 'arts' AND T3.rating = 5
6,246
moderate
coinmarketcap
When was Lebowskis not opened?
when refers to date; not opened refers to open IS NULL
SELECT DISTINCT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Lebowskis' AND (T2.open IS NULL OR T2.open = 0)
6,247
simple
airline
How many flights of Alaska Airlines were delayed on 2018/8/2?
Alaska Airlines refers to Description = 'Alaska Airlines Inc.: AS'; delayed refers to DEP_DELAY > 0; on 2018/8/2 refers to FL_DATE = '2018/8/2';
SELECT COUNT(*) FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.FL_DATE = '2018/8/2' AND T2.Description = 'Alaska Airlines Inc.: AS' AND T1.DEP_DELAY > 0
6,248
simple
movie
What is the average rating of all the movies starring Tom Cruise?
starring Tom Cruise refers to name = 'Tom Cruise'; average rating = divide(sum(rating where name = 'Tom Cruise'), count(movieid where name = 'Tom Cruise'))
SELECT AVG(T1.Rating) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Tom Cruise'
6,249
simple
retail_complains
Please list the full name, date of birth, and email id of the elderly clients in descending order of age.
full name = first, middle, last; date of birth = year, month, day; elderly clients refers to age > 65;
SELECT first, middle, last, year, month , day, email FROM client WHERE age > 65 ORDER BY age DESC
6,250
simple
books
List all the authors who wrote fewer pages than the average.
author refers to author_name; who wrote fewer pages than the average refers to num_pages < AVG(num_pages)
SELECT T3.author_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 WHERE T1.num_pages < ( SELECT AVG(num_pages) FROM book )
6,251
moderate
movie_3
Provide the full names and emails of customers whose payments were greater than 70% of the average.
full name refers to first_name, last_name; average payment refers to AVG(amount); payments were greater than 70% of the average refers to amount > (AVG(amount) MULTIPLY 0.7)
SELECT DISTINCT T2.first_name, T2.last_name, T2.email FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id INNER JOIN address AS T3 ON T2.address_id = T3.address_id WHERE T1.amount > ( SELECT AVG(amount) FROM payment ) * 0.7
6,252
moderate
authors
Which conference has the longest name?
the longest name refers to MAX(length(FullName))
SELECT FullName FROM Conference ORDER BY LENGTH(FullName) DESC LIMIT 1
6,253
simple
simpson_episodes
Among the episodes aired in 2008 with votes ranges from 920 to 950, list their percent.
aired in 2008 refers to air_date LIKE '2008%'; votes ranges from 920 to 950 refers to votes BETWEEN 920 AND 950
SELECT T2.percent FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE SUBSTR(T1.air_date, 1, 4) = '2008' AND T1.votes BETWEEN 950 AND 960;
6,254
simple
public_review_platform
What is the most common type of compliments that a user has received from other users?
the most common type of compliments refers to MAX(COUNT(compliment_type))
SELECT T2.compliment_type FROM Users_Compliments AS T1 INNER JOIN Compliments AS T2 ON T1.compliment_id = T2.compliment_id GROUP BY T2.compliment_type ORDER BY COUNT(T2.compliment_type) DESC LIMIT 1
6,255
simple
law_episode
What are the keywords of the episode "Shield"?
the episode "Shield" refers to title = 'Shield'
SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Shield'
6,256
simple
movies_4
Tally the movie ID and character name in the movie starring Jim Carrey.
SELECT T2.movie_id, T2.character_name FROM person AS T1 INNER JOIN movie_cast AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Jim Carrey'
6,257
simple
retail_complains
List down the email of client whose complaint is type "PS".
SELECT T1.email FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.type = 'PS'
6,258
simple
professional_basketball
How many times have coaches who were from CHI been awarded as NBA Coach of the Year?
CHI refers to tmID = 'CHI'; awarded Coach of the Year refers to award = 'Coach of the Year'; NBA refers to lgID = 'NBA'
SELECT COUNT(DISTINCT T2.coachID) FROM coaches AS T1 INNER JOIN awards_coaches AS T2 ON T1.coachID = T2.coachID WHERE T1.tmID = 'CHI' AND T2.award = 'NBA Coach of the Year'
6,259
simple
university
Please list the names of all the ranking criteria of Harvard University in 2011.
in 2011 refers to year 2011; Harvard University refers to university_name = 'Harvard University'; names of all the ranking criteria refers to criteria_name
SELECT T1.criteria_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 T3.university_name = 'Harvard University' AND T2.year = 2011
6,260
simple
mondial_geo
Which three countries does the Amazonas flow through? Give the full name of the countries.
Amazonas flow is a river
SELECT DISTINCT T4.Name FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River INNER JOIN country AS T4 ON T4.Code = T2.Country WHERE T3.Name = 'Amazonas'
6,261
simple
book_publishing_company
Name the store with the highest quantity in sales? What is the least quantity title from the store's sale?
qty is abbreviation for quantity; highest quantity refers to MAX(qty); least quantity refers to MIN(qty)
SELECT T3.stor_id, T2.title FROM sales AS T1 INNER JOIN titles AS T2 ON T1.title_id = T2.title_id INNER JOIN stores AS T3 ON T3.stor_id = T1.stor_id WHERE T3.stor_id = ( SELECT stor_id FROM sales GROUP BY stor_id ORDER BY SUM(qty) DESC LIMIT 1 ) GROUP BY T3.stor_id, T2.title ORDER BY SUM(T1.qty) ASC LIMIT 1
6,262
challenging
donor
What is the id of the project that has the highest optional tip? Indicate the names of the resources that were requested.
highest optional tip refers to subtract(total_price_including_optional_support, total_price_excluding_optional_support); names of the resources refers to item_name
SELECT T1.projectid, T1.item_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid ORDER BY T2.total_price_including_optional_support - T2.total_price_excluding_optional_support DESC LIMIT 1
6,263
moderate
regional_sales
List out the product name of order which has unit cost of 781.22.
SELECT T FROM ( SELECT DISTINCT IIF(T1.`Unit Cost` = 781.22, T2.`Product Name`, NULL) AS T FROM `Sales Orders` T1 INNER JOIN Products T2 ON T2.ProductID = T1._ProductID ) WHERE T IS NOT NULL
6,264
moderate
mondial_geo
Which city has most population other than its capital in Bangladesh?
Bangladesh is a country
SELECT T3.Name FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name WHERE T1.Name = 'Bangladesh' AND T3.Name <> T1.Capital ORDER BY T3.Population DESC LIMIT 1
6,265
simple
retail_world
Which company placed the order with the id 10257?
"10257" is the OrderID; company refers to CompanyName
SELECT T1.CompanyName FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.OrderID = 10257
6,266
simple
books
Name the streets in Dallas.
"Dallas" is the city; streets refers to street_name
SELECT street_name FROM address WHERE city = 'Dallas'
6,267
simple
authors
List the short name of all conferences whose full name begins with International Symposium.
full name refers to FullName LIKE 'International Symposium%'
SELECT ShortName FROM Conference WHERE FullName LIKE 'International Symposium%'
6,268
simple
legislator
What is the average number of terms served for a current legislator that's famous or impact?
average = DIVIDE(COUNT(bioguide), COUNT(bioguide_id)); legislator that's famous or impact refers to wikipedia_id is not null;
SELECT CAST(COUNT(T2.bioguide) AS REAL) / COUNT(DISTINCT T1.bioguide_id) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.wikipedia_id IS NOT NULL
6,269
simple
university
Name the university and country which had the highest number of international students in 2015.
highest number of international students refers to MAX(DIVIDE(MULTIPLY(num_students, pct_international_students), 100)); in 2015 refers to year = 2015; name of university refers to university_name;
SELECT T1.university_name, T3.country_name FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T2.year = 2015 ORDER BY T2.num_students DESC LIMIT 1
6,270
simple
retails
How many of the line items have been shipped by rail with a quantity less than 30?
shipped by rail refers to l_shipmode = 'RAIL'; quantity less than 30 refers to l_quantity < 30;
SELECT COUNT(l_linenumber) FROM lineitem WHERE l_quantity < 30 AND l_shipmode = 'RAIL'
6,271
simple
food_inspection_2
What is the establishment's name and employee involved in the inspection ID 44256 on May 5, 2010?
establishment's name refers to dba_name; employee name refers to first_name, last_name; inspection ID 44256 refers to inspection_id = 44256; on May 5, 2010 refers to inspection_date = '2010-05-05'
SELECT T1.dba_name, T3.first_name, T3.last_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN employee AS T3 ON T2.employee_id = T3.employee_id WHERE T2.inspection_date = '2010-05-05' AND T2.inspection_id = 44256
6,272
simple
chicago_crime
Please list the blocks where all the incidents in the district commanded by Robert A. Rubio took place.
"Robert A. Rubio" is the commander
SELECT T2.block FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T1.commander = 'Robert A. Rubio'
6,273
simple
legislator
Among the current legislators who served the term starting on 2013/1/3, how many of them are female?
term starting on 2013/1/3 refers to start = '2013-01-03; female refers to gender_bio = 'F';
SELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.start = '2013-01-03' AND T1.gender_bio = 'F'
6,274
moderate
retail_complains
Which region has the second most clients?
region refers to division; second most refers to second max(client_id)
SELECT T2.division FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id GROUP BY T2.division ORDER BY COUNT(T2.division) DESC LIMIT 1, 1
6,275
simple
retails
How many orders of more than 10 items have been returned?
more than 10 items have been returned refer to l_returnflag = 'R' where l_quantity > 10; orders refer to l_orderkey;
SELECT COUNT(l_linenumber) FROM lineitem WHERE l_quantity > 10 AND l_returnflag = 'R'
6,276
simple
chicago_crime
List crimes that the FBI has classified as Drug Abuse by their report number.
"Drug Abuse" is the title of crime
SELECT T2.report_no FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T2.fbi_code_no = T1.fbi_code_no WHERE T1.title = 'Drug Abuse'
6,277
simple
hockey
Please list the birth cities of the players who have won an award in the year 1970.
SELECT DISTINCT T1.birthCity FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1970
6,278
simple
authors
List the names of authors affiliated with the University of Oxford in alphabetical order.
affiliated with the University of Oxford refers to Affiliation = 'University of Oxford'
SELECT Name FROM Author WHERE Affiliation = 'University of Oxford' ORDER BY Name ASC
6,279
simple
bike_share_1
Calculate the difference between the number of customers and the number of subscribers who did the trip in June 2013.
customer refers to subscription_type = 'Customer'; subscribers refers to subscription_type = 'Subscriber'; difference = SUBTRACT(SUM(subscription_type = 'Subscriber' t), SUM(subscription_type = 'Customer')); trip in June 2013 refers to start_date BETWEEN '6/1/2013 0:00'AND '6/31/2013 12:59';
SELECT SUM(IIF(subscription_type = 'Subscriber', 1, 0)) - SUM(IIF(subscription_type = 'Customer', 1, 0)) FROM trip WHERE start_date LIKE '6/%/2013%'
6,280
moderate
retails
Which market segment does the customer with the highest amount of debt belongs to?
market segment refers to c_mktsegment; the highest amount of debt refers to max(c_acctbal)
SELECT c_mktsegment FROM customer WHERE c_acctbal = ( SELECT MIN(c_acctbal) FROM customer )
6,281
simple
book_publishing_company
What is the average quantity of each order for the book "Life Without Fear"?
qty is abbreviation for quantity; average quantity order = AVG(qty)
SELECT CAST(SUM(T2.qty) AS REAL) / COUNT(T1.title_id) FROM titles AS T1 INNER JOIN sales AS T2 ON T1.title_id = T2.title_id WHERE T1.title = 'Life Without Fear'
6,282
simple
student_loan
How many disabled students have payment due?
payment due refers to bool = 'pos';
SELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name WHERE T1.bool = 'pos'
6,283
simple
college_completion
Among the institutes in the state of Alabama whose percent rank for median SAT value within sector is 77, how many of them have over 500 graduates in total in 2011?
percent rank for median SAT value within sector refers to med_sat_percentile; over 500 graduates refers to grad_cohort > 500; in 2011 refers to year = 2011;
SELECT COUNT(DISTINCT T1.chronname) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.state = 'Alabama' AND T1.med_sat_percentile = '100' AND T2.year = 2011 AND T2.grad_cohort > 500
6,284
moderate
retail_complains
What is the full name of the client whose complaint on 2017/3/27 was received by MICHAL?
full names = first, middle, last; on 2017/3/27 refers to "Date received" = '2017-03-27'; MICHAL refers to server = 'MICHAL';
SELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.`Date received` = '2017-03-27' AND T2.server = 'MICHAL'
6,285
simple
law_episode
Who is the tallest camera operator?
who refers to name; the tallest refers to max(height_meters); camera operator refers to role = 'camera operator'
SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.role = 'camera operator' ORDER BY T2.height_meters DESC LIMIT 1
6,286
simple
shooting
How many more black female victims than white female victims were discovered?
black refers to race = 'B'; female refers to gender = 'F'; white refers to race = 'W'; result = subtract(count(victims where race = 'B'), count(victims where race = 'W')) where gender = 'F'
SELECT SUM(race = 'B') - SUM(race = 'W') FROM subjects WHERE gender = 'F'
6,287
simple
retail_complains
How many reviews by people between 30 and 50 years include the word 'great'?
between 30 and 50 years refers to age BETWEEN 30 AND 50; include the word great refers to Review like '%Great%';
SELECT COUNT(T1.Reviews) FROM reviews AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id WHERE T2.age BETWEEN 30 AND 50 AND T1.Reviews LIKE '%great%'
6,288
simple
hockey
For the goalie who had the highest defensive success rate in the postseason of 2011, what's his legends ID ?
Post season of 2011 refers to year = ’2011’ defensive success rate refers to (SUBTRACT(1 (DIVIDE(PostGA/PostSA)), *100%)
SELECT T2.legendsID FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.year = 2011 ORDER BY 1 - CAST(T1.PostGA AS REAL) / T1.PostSA DESC LIMIT 1
6,289
moderate
movie_3
How many film categories are there?
SELECT COUNT(DISTINCT category_id) FROM category
6,290
simple
app_store
What is the average sentiment polarity score of the Cooking Fever app? Indicate the age group that the app is targeted at.
average sentiment polarity score = AVG(Sentiment_Polarity); age group the app is target at refers to Content Rating;
SELECT AVG(T2.Sentiment_Polarity), T1."Content Rating" FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Cooking Fever'
6,291
simple
olympics
Provide the age of the tallest competitor.
the tallest refers to MAX(height);
SELECT T2.age FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id ORDER BY T1.height DESC LIMIT 1
6,292
simple
student_loan
How many months did a student in the Air Force miss school the most?
Air Force refers to organ = 'air_force'; number of months a student miss school the most refers to MAX(COUNT(month));
SELECT T1.month FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name ORDER BY T1.month DESC LIMIT 1
6,293
simple
olympics
In the Winter and Summer Olympics of 1988, which game has the most number of competitors? Find the difference of the number of competitors between the two games.
the most number of competitors refer to MAX(COUNT(person_id)); SUBTRACT(COUNT(person_id where games_name = '1988 Summer'), COUNT(person_id where games_name = '1988 Winter'));
SELECT P1 , ( SELECT MAX(P2) - MIN(P2) FROM ( SELECT COUNT(T2.person_id) AS P2 FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name IN ('1988 Winter', '1988 Summer') GROUP BY T1.season ) ORDER BY P2 DESC LIMIT 1 ) FROM ( SELECT T1.season AS P1, COUNT(T2.person_id) AS P2 FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name IN ('1988 Winter', '1988 Summer') GROUP BY T1.season ) ORDER BY P2 DESC LIMIT 1
6,294
challenging
trains
Among the trains that run in the east direction, how many of them have more than 2 long cars?
more than 2 long cars refers to longCarsNum > 2
SELECT SUM(CASE WHEN T2.longCarsNum > 2 THEN 1 ELSE 0 END)as count FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS longCarsNum FROM cars WHERE len = 'long' GROUP BY train_id ) AS T2 ON T1.id = T2.train_id WHERE T1.direction = 'west'
6,295
moderate
books
What is the title of the book in the order ID 931?
SELECT T1.title FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T2.order_id = 931
6,296
simple
shakespeare
What is the name of the character that can be found in paragraph 8 of chapter 18820?
name of the character refers to CharName; paragraph 8 refers to ParagraphNum = 8; chapter 18820 refers to chapter_id = 18820
SELECT T1.CharName FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.ParagraphNum = 8 AND T2.chapter_id = 18820
6,297
simple
shakespeare
List the paragraph number and paragraphs said by the character named "Sir Andrew Aguecheek".
paragraph number refers to ParagraphNum; character named "Sir Andrew Aguecheek" refers to CharName = 'Sir Andrew Aguecheek'
SELECT T2.ParagraphNum, T2.id FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'Sir Andrew Aguecheek'
6,298
simple
public_review_platform
In users yelping since 2009 to 2011, how many of them have low count of fans?
users in yelping since 2009 to 2011 refers to user_yelping_since_year BETWEEN 2009 AND 2011; low count of fans refers to user_fans = 'Low'
SELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year >= 2009 AND user_yelping_since_year < 2012 AND user_fans = 'Low'
6,299
simple