Dataset Viewer
Auto-converted to Parquet Duplicate
db_id
stringclasses
68 values
question
stringlengths
27
325
evidence
stringlengths
0
580
SQL
stringlengths
42
475
question_id
int64
3
9.39k
movie_3
Which film titles have the most expensive rental rate?
the most expensive rental rate refers to max(rental_rate)
SELECT title FROM film WHERE rental_rate = ( SELECT MAX(rental_rate) FROM film )
9,341
superstore
How many furniture products were ordered at central superstore?
furniture products refers to Category = 'Furniture'
SELECT COUNT(*) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Category = 'Furniture'
2,441
retail_complains
What was the review context from Jacksonville on 2017/7/22?
Jacksonville refers to city = 'Jacksonville'; on 2017/7/22 refers to Date = '2017-07-22';
SELECT T1.Reviews FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.city = 'Jacksonville' AND T1.Date = '2017-07-22'
265
image_and_language
What colour is the van that can be spotted in image no. 1?
colour refers to ATT_CLASS; van refers to OBJ_CLASS = 'van'; image no. 1 refers to IMG_ID = 1
SELECT T4.ATT_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID INNER JOIN IMG_OBJ_ATT AS T3 ON T1.IMG_ID = T3.IMG_ID INNER JOIN ATT_CLASSES AS T4 ON T3.ATT_CLASS_ID = T4.ATT_CLASS_ID WHERE T2.OBJ_CLASS = 'van' AND T1.IMG_ID = 1 GROUP BY T4.ATT_CLASS
7,534
simpson_episodes
Please list the name of crew that were born before 1970.
born before 1970 refers to birthdate < '1970-01-01'
SELECT name FROM Person WHERE SUBSTR(birthdate, 1, 4) < '1970';
4,250
beer_factory
What is the percentage of 5 star ratings River City brand root beer get?
percentage = MULTIPLY(DIVIDE(SUM(BrandID WHERE StarRating = 5), COUNT(BrandID) WHERE BrandName = 'River City'), 1.0); 5 star ratings refers to StarRating = 5; River City refers to BrandName = 'River City';
SELECT CAST(COUNT(CASE WHEN T2.StarRating = 5 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.StarRating) FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T1.BrandName = 'River City'
5,264
cars
What is the fastest car made by Japan?
the fastest refers to max(horsepower); made by Japan refers to country = 'Japan'; name of the car refers to car_name
SELECT T1.car_name FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'Japan' ORDER BY T1.horsepower DESC LIMIT 1
3,094
authors
What is the title and journal homepage of the latest published paper?
latest published paper refers to Max(Year)
SELECT T1.Title, T2.HomePage FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id ORDER BY T1.Year DESC LIMIT 1
3,529
movie
How much longer in percentage is the screen time of the most important character in Batman than the least important one?
most important character refers to max(screentime); least important character refers to min(screentime); movie Batman refers to title = 'Batman'; percentage = divide(subtract(max(screentime) , min(screentime)) , min(screentime)) * 100%
SELECT (MAX(CAST(SUBSTR(T2.screentime, 3, 2) AS REAL)) - MIN(CAST(SUBSTR(T2.screentime, 3, 2) AS REAL))) * 100 / MIN(CAST(SUBSTR(T2.screentime, 3, 2) AS REAL)) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T1.Title = 'Batman'
743
superstore
How much is the total quantity of items from the East region shipped on 3/25/2015? Name the products.
shipped on 3/25/2015 refers to "Ship Date" = Date('2015-03-25');
SELECT SUM(T1.Quantity), T2.`Product Name` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Date` = '2015-03-25' AND T2.Region = 'East'
2,375
retail_complains
What is the average age of Norwalk clients?
average age = AVG(age); Norwalk refers to city = 'Norwalk';
SELECT CAST(SUM(T1.age) AS REAL) / COUNT(T1.age) AS average FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.city = 'Norwalk'
315
app_store
What is the lowest sentiment polarity score of the Basketball Stars app for people who dislikes the app pretty much and how many downloads does it have?
lowest sentiment polarity score refers to MIN(Sentiment_Polarity); user dislike the app pretty much refers to Sentiment_Polarity<-0.5; number of downloads it has refers to installs;
SELECT MIN(T2.Sentiment_Polarity), T1.Installs FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Basketball Stars'
2,517
talkingdata
What is the brand of the device used by the most users in the M23-26 user group?
brand of the device refers to phone_brand; M23-26 user group refers to `group` = 'M23-26';
SELECT T.phone_brand FROM ( SELECT T2.phone_brand, COUNT(T1.device_id) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.`group` = 'M23-26' GROUP BY T2.phone_brand ) AS T ORDER BY T.num DESC LIMIT 1
1,145
mondial_geo
What sea does the Baltic Sea converge with, and how deep is the Baltic Sea?
Coverage refers to mergesWith
SELECT T2.Sea2, T1.Depth FROM sea AS T1 INNER JOIN mergesWith AS T2 ON T1.Name = T2.Sea1 WHERE T1.Name = 'Baltic Sea'
8,454
address
What is the name of the state with the most counties?
the most counties refer to MAX(COUNT(county));
SELECT T1.name FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state GROUP BY T2.state ORDER BY COUNT(T2.county) DESC LIMIT 1
5,186
cs_semester
What is the difficulty of the course in which a student with level of intellengence of 5 got an A grade?
difficulty of the course refers to diff;
SELECT T3.diff 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 T2.grade = 'A' AND T1.intelligence = 5
934
authors
Write down the conference full name of "ICWE" and it's homepage address.
"ICWE" is the ShortName of conference
SELECT FullName, Homepage FROM Conference WHERE ShortName = 'ICWE'
3,541
shipping
What is the model year of the truck used in shipment id 1003?
shipment id 1003 refers to ship_id = 1003
SELECT T1.model_year FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1003'
5,633
works_cycles
Please provide contact details of all Marketing Managers. State their name and phone number.
Marketing Manager is a job title
SELECT T1.FirstName, T1.LastName, T2.PhoneNumber FROM Person AS T1 INNER JOIN PersonPhone AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Employee AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID WHERE T3.JobTitle = 'Marketing Manager'
7,325
address
Which state has greater than 50 CBSA officers of metro type?
greater than 50 CBSA officers of metro type refers to COUNT(CBSA_type = 'Metro') > 50;
SELECT T2.state FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_type = 'Metro' GROUP BY T2.state HAVING COUNT(T1.CBSA_type) > 50
5,198
world_development_indicators
What's the lastest household survey in Angola and when did it take place?
in Angola refers to ShortName = 'Angola'; when refers to PppSurveyYear
SELECT LatestHouseholdSurvey, PppSurveyYear FROM Country WHERE ShortName = 'Angola'
2,231
image_and_language
What is the caption for the prediction class id 12?
caption for the prediction class id 12 refers to PRED_CLASS where PRED_CLASS_ID = 12;
SELECT PRED_CLASS FROM PRED_CLASSES WHERE PRED_CLASS_ID = 12
7,545
retail_complains
How many stars did "Eagle Capital" received from Little Rock on 2013/4/4?
Eagle Capital refers to Product = 'Eagle Capital'; Little Rock is a city; on 2013/4/4 refers to Date = '2013-04-04';
SELECT COUNT(T1.Stars) FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Product = 'Eagle Capital' AND T2.city = 'Little Rock' AND T1.Date = '2013-04-04'
267
world_development_indicators
Please write down the footnote descriptions of Albania in 1981.
Albania is the name of country where Country = 'Albania'
SELECT DISTINCT T1.Description FROM FootNotes AS T1 INNER JOIN Country AS T2 ON T1.Countrycode = T2.CountryCode WHERE T1.Year = 'YR1981' AND T2.ShortName = 'Albania'
2,114
movies_4
Which production company produced the movie that made the most money at the box office?
Which production company refers to company_name; most money at the box office refers to max(revenue)
SELECT T1.company_name FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id GROUP BY T1.company_id ORDER BY SUM(T3.revenue) DESC LIMIT 1
447
retail_world
Name products and their quantity ordered by the company 'GROSELLA-Restaurante' in the sales order that was processed by Nancy Davolio.
name products refers to ProductName; 'GROSELLA-Restaurante' refers to CompanyName; 'Nancy Davolio' is the full name of an employee; full name refers to FirstName, LastName;
SELECT T4.ProductName, T3.Quantity FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN `Order Details` AS T3 ON T2.OrderID = T3.OrderID INNER JOIN Products AS T4 ON T3.ProductID = T4.ProductID INNER JOIN Customers AS T5 ON T2.CustomerID = T5.CustomerID WHERE T1.FirstName = 'Nancy' A...
6,576
bike_share_1
What is the name of the station that is less used by customers who borrow bikes from? Indicate when was the station installed.
less used station where bikes are borrowed from refers to start_station_name which has the least number of customers; subscription_type = 'Customer'; when installed refers to installation_date;
SELECT T1.start_station_name, T2.installation_date FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.subscription_type = 'Customer' GROUP BY T1.start_station_name ORDER BY COUNT(T1.subscription_type) LIMIT 1
9,016
retail_world
How many territories are there in the Eastern Region?
Eastern Region refers to RegionDescription = 'Eastern';
SELECT COUNT(T1.TerritoryID) FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Eastern'
6,310
mondial_geo
In which city is the sea whose depth is 4232 meters less than that of the Bay of Bengal?
SELECT T2.City FROM sea AS T1 INNER JOIN located AS T2 ON T1.Name = T2.Sea INNER JOIN city AS T3 ON T3.Name = T2.City WHERE ( SELECT Depth FROM sea WHERE Name LIKE '%Bengal%' ) - T1.Depth = 4235
8,417
authors
What is the average number of papers published in the journal "Molecular Brain" every year from 2008 to 2011?
"Molecular Brain" is the FullName of journal; year from 2008 to 2011 refers to Year BETWEEN 2008 AND 2011; average = Divide (Count(Id),4)
SELECT CAST(COUNT(T2.Id) AS REAL) / COUNT(DISTINCT T2.Year) FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.FullName = 'Molecular Brain' AND T2.Year BETWEEN 2008 AND 2011
3,522
retail_world
Which of the American customers have experienced a delay in the shipment and how long was the longest?
"American" refers to Country = 'USA'; longest delay in shipment refers to Max(Subtract(RequiredDate, ShippedDate)); customer refers to CustomerID
SELECT T1.CompanyName, TIMESTAMPDIFF(DAY, T2.ShippedDate, T2.RequiredDate) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Country = 'USA' AND TIMESTAMPDIFF(DAY, T2.ShippedDate, T2.RequiredDate) < 0
6,492
university
Provide the ranking criteria and scores in 2005 that were received by Harvard University.
Harvard University refers to university_name = 'Harvard University'; in 2005 refers to year = 2005; ranking criteria refers to criteria_name;
SELECT T1.criteria_name, T2.score 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 = 2005
8,064
movielens
Please list down ID of movies acted by top 5 actors based on actor rating.
SELECT T2.movieid FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid GROUP BY T2.actorid ORDER BY AVG(T1.a_quality) DESC LIMIT 5
2,272
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
5,009
movies_4
List 10 crews alongside their jobs who worked on the movie 'Mad Max: Fury Road.'
crews refers to person_name; movie 'Mad Max: Fury Road' refers to title = 'Mad Max: Fury Road'
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 = 'Mad Max: Fury Road' LIMIT 10
483
movie
Please list the names of the actors who played a role in the movie Batman.
movie Batman refers to title = 'Batman'
SELECT T3.Name 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 T1.Title = 'Batman'
733
olympics
Which region is the majority of the athletes from?
region refers to region_name; the majority of the athletes from refer to MAX(COUNT(region_name));
SELECT T2.region_name FROM person_region AS T1 INNER JOIN noc_region AS T2 ON T1.region_id = T2.id GROUP BY T2.region_name ORDER BY COUNT(T1.person_id) DESC LIMIT 1
5,048
student_loan
Mention the status of payment of student 299.
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; student299 is a name of student;
SELECT bool FROM no_payment_due WHERE name = 'student299'
4,535
synthea
How many unmarried women were checked for normal pregnancy?
unmarried refers to marital = 'S'; women refers to gender = 'F'; normal pregnancy refers to conditions.DESCRIPTION = 'normal pregnancy';
SELECT COUNT(DISTINCT T2.patient) FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Normal pregnancy' AND T2.gender = 'F' AND T2.marital = 'S'
1,483
movie_platform
Name the movie with the most ratings.
movie with the most rating refers to MAX(SUM(rating_score));
SELECT movie_title FROM movies GROUP BY movie_title ORDER BY COUNT(movie_title) DESC LIMIT 1
3
codebase_comments
What is the github address of the repository that contains files used by solution ID12?
github address refers to Url;
SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 12
592
chicago_crime
Which community area has the highest number of crimes reported on the street?
reported on the street refers to location_description = 'STREET'; community area with highest number of crime refers to Max(Count(location_description)); community area refers to community_area_no
SELECT T1.community_area_no FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T2.location_description = 'STREET' GROUP BY T1.community_area_no ORDER BY COUNT(T2.location_description) DESC LIMIT 1
8,682
coinmarketcap
Name the coin and date of transactions with the greatest decline in percent change in 1 hour.
the greatest decline in percent change in 1 hour refers to max(percent_change_1h)
SELECT T1.name, T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.percent_change_1h = ( SELECT MIN(percent_change_1h) FROM historical )
6,260
image_and_language
List all the ids of the images that have a self-relation relationship.
ids of the images refers to IMG_ID; self-relations refers to OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID
SELECT DISTINCT IMG_ID FROM IMG_REL WHERE OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID
7,508
retails
What is the name of the product with the highest retail price?
name of the product refers to p_name; the highest retail price refers to p_retailprice
SELECT p_name FROM part WHERE p_retailprice = ( SELECT MAX(p_retailprice) FROM part )
6,862
movie
In romantic movies, how many of them starred by John Travolta?
romantic movies refers to Genre = 'Romance'; starred by John Travolta refers to Name = 'John Travolta'
SELECT COUNT(*) 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 T1.Genre = 'Romance' AND T3.Name = 'John Travolta'
763
sales_in_weather
What was the temperature range of station no.1 on 2012/1/1?
on 2012/1/1 refers to date = '2012-01-01'; temperature range refers to Subtract (tmax, tmin); station no.1 refers to station_nbr = 1
SELECT tmax - tmin AS temrange FROM weather WHERE station_nbr = 1 AND `date` = '2012-01-01'
8,140
talkingdata
Please list the categories of the app users who are not active when event no.2 happened.
not active refers to is_active = 0; event no. refers to event_id; event_id = 2;
SELECT DISTINCT T1.category FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id INNER JOIN app_events AS T3 ON T2.app_id = T3.app_id WHERE T3.event_id = 2 AND T3.is_active = 0
1,087
chicago_crime
What is the district address associated with the case JB107731?
case JB107731 refers to case_number = 'JB107731'
SELECT T1.address FROM District AS T1 INNER JOIN Crime AS T2 ON T2.district_no = T1.district_no WHERE T2.case_number = 'JB107731'
8,670
public_review_platform
Write down the any five of ID and name of category that starts with alphabet "P".
category that starts with alphabet "P" refers to category_name like 'P%';
SELECT category_id, category_name FROM Categories WHERE category_name LIKE 'P%' LIMIT 5
4,075
codebase_comments
What is the linearized sequenced of API calls of the method whose solution path is "mauriciodeamorim_tdd.encontro2\Tdd.Encontro2.sln"?
linearized sequenced of API calls refers to ApiCalls;
SELECT T2.ApiCalls FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.Path = 'mauriciodeamorim_tdd.encontro2Tdd.Encontro2.sln'
582
computer_student
Which professor teaches the highest number of professional or master/graduate courses?
professor refers to taughtBy.p_id; highest number of professional or master/graduate courses refers to max(count(taughtBy.course_id)) where courseLevel = 'Level_500'
SELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500' GROUP BY T2.p_id ORDER BY COUNT(T2.course_id) DESC LIMIT 1
1,020
car_retails
How many Sales Manager who are working in Sydney? List out their email.
Sales Manager is a job title; Sydney is a city;
SELECT T1.email FROM employees AS T1 INNER JOIN offices AS T2 ON T1.officeCode = T2.officeCode WHERE T1.jobTitle LIKE '%Sales Manager%' AND T2.city = 'Sydney'
1,575
synthea
What is the most common condition among the female Americans?
the most common condition refers to MAX(COUNT(DESCRIPTION)); among the female Americans refer to PATIENT where gender = 'F' and ethnicity = 'american';
SELECT T2.DESCRIPTION FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.gender = 'F' AND T1.ethnicity = 'american' GROUP BY T2.DESCRIPTION ORDER BY COUNT(T2.DESCRIPTION) DESC LIMIT 1
1,393
movies_4
What is the average number of crews for a movie?
average number of crews = divide(count(person_id), COUNT(movie_id))
SELECT CAST(SUM(CD) AS REAL) / COUNT(movie_id) FROM ( SELECT movie_id, COUNT(person_id) AS CD FROM movie_crew GROUP BY movie_id )
518
retail_world
Among the seafoods, how many of them have an order quantity of more than 50?
"Seafood" is the CategoryName; order quantity of more than 50 refers to Quantity > 50
SELECT COUNT(T1.ProductID) FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Categories AS T3 ON T1.CategoryID = T3.CategoryID WHERE T3.CategoryName = 'Seafood' AND T2.Quantity > 50
6,482
address
What are the precise locations of the cities with an area code of 787?
precise location refers to latitude, longitude
SELECT T2.latitude, T2.longitude FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = '787' GROUP BY T2.latitude, T2.longitude
5,100
movielens
Among the users who gave a rating of 5, how many of them are male?
Male users mean that u_gender = 'M'
SELECT COUNT(T1.userid) FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating = 5 AND T2.u_gender = 'M'
2,248
sales_in_weather
What was the total unit sold for item 10 when the average temperature was below the median temperature?
item 10 refers to item_nbr = 10; average temperature below median temperature refers to tavg < avg(tavg); total units refers to Sum(units)
SELECT SUM(T5.units) FROM weather AS T4 INNER JOIN sales_in_weather AS T5 ON T4.`date` = T5.`date` INNER JOIN relation AS T6 ON T5.store_nbr = T6.store_nbr WHERE T5.item_nbr = 10 AND T4.tavg < ( SELECT AVG(T1.tavg) FROM weather AS T1 INNER JOIN sales_in_weather AS T2 ON T1.`date` = T2.`date` INNER JOIN relation AS T3 O...
8,215
music_platform_2
What is the longest review?
review refers to content; longest review refers to Max(content)
SELECT title FROM reviews ORDER BY LENGTH(content) DESC LIMIT 1
7,965
retail_complains
Write down the date received of complaints sent via Fax.
sent via Fax refers to Submitted via = 'Fax'
SELECT T1.`Date received` FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.`Submitted via` = 'Fax'
360
menu
Among the menus that include baked apples with cream, who is the sponsor of the menu with the highest price?
baked apples with cream is a name of dish; highest price refers to MAX(price);
SELECT T4.sponsor FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id INNER JOIN Menu AS T4 ON T4.id = T1.menu_id WHERE T3.name = 'Baked apples with cream' AND T3.id = 107 ORDER BY T2.price DESC LIMIT 1
5,556
movie
Who was the actor that played in the movie "Batman" with the longest screentime?
movie "Batman" refers to Title = 'Batman'; longest screentime refers to max(screentime)
SELECT T2.Name FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID INNER JOIN movie AS T3 ON T3.MovieID = T1.MovieID WHERE T3.Title = 'Batman' ORDER BY T1.screentime DESC LIMIT 1
747
talkingdata
Please list the app IDs of all the users in the Securities category.
SELECT T2.app_id FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'Securities'
1,142
movie_3
How many film titles were released in 2006?
released in 2006 refers to release_year = 2006
SELECT COUNT(film_id) FROM film WHERE release_year = 2006
9,338
cars
What is the name of the most expensive car?
name of the car refers to car_name; the most expensive refers to max(price)
SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1
3,091
movie_3
Provide the list of the longest movies. Arrange these titles in alphabetical order.
the longest refers to max(length)
SELECT title FROM film WHERE length = ( SELECT MAX(length) FROM film )
9,384
car_retails
How many distinct orders were there in 2003 when the quantity ordered was less than 30?
year(orderDate) = '2003'; quantityOrdered < 30;
SELECT COUNT(DISTINCT T1.orderNumber) FROM orderdetails AS T1 INNER JOIN orders AS T2 ON T1.orderNumber = T2.orderNumber WHERE T1.quantityOrdered < 30 AND STRFTIME('%Y', T2.orderDate) = '2003'
1,558
trains
How many trains are running west?
west is a direction
SELECT COUNT(id) FROM trains WHERE direction = 'west'
711
superstore
Among the orders in Central superstore, which art product were ordered the most?
art product refers to Sub-Category = 'Art'; the most refers to max(order_number)
SELECT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Sub-Category` = 'Art' GROUP BY T2.`Product Name` ORDER BY COUNT(T2.`Product ID`) DESC LIMIT 1
2,417
professional_basketball
Which teams have winning rate less than 50%?
team with winning rate less than 50% refers to Divide (won, Sum(won, lost)) < 0.5
SELECT name FROM teams WHERE CAST(won AS REAL) * 100 / (won + lost) < 50
2,835
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'
6,137
university
In 2014, what is the name of the university which was considered a leader in the publications rank?
In 2014 refers to year = 2014; leader refers to MAX(score); in the publications rank refers to criteria_name = 'Publications Rank'; name of university refers to university_name;
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 = 'Publications Rank' AND T2.year = 2014 AND T1.id = 17 ORDER BY T2.score DESC LIMIT 1
7,995
human_resources
By what percentage is the average salary of Trainees higher than the minimum salary of this postion?
AVG(salary); Trainee is a position title; minimum salary refers to minsalary; calculation = DIVIDE(SUBTRACT(AVG(salary), minsalary), minsalary) * 100
SELECT 100 * (AVG(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) - CAST(REPLACE(SUBSTR(T2.minsalary, 4), ',', '') AS REAL)) / CAST(REPLACE(SUBSTR(T2.minsalary, 4), ',', '') AS REAL) AS per FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Trainee'
8,949
language_corpus
Name the longest Catalan language Wikipedia page title and state the number of different words in this page.
longest title refers to max(length(title))
SELECT title, words FROM pages WHERE title = ( SELECT MAX(LENGTH(title)) FROM pages )
5,684
public_review_platform
Find out which business ID are opened all the time.
opened all the time refers to Business_Hours where day_id BETWEEN 1 and 7 and opening_time = closing_time;
SELECT DISTINCT business_id FROM Business_Hours WHERE day_id >= 1 AND day_id < 8 AND opening_time = closing_time
4,039
retail_world
What is the shipping cost for order number 10692 from the company Alfreds Futterkiste?
Alfreds Futterkiste is the name of the company; order number 10692 refers to OrderID = 10692;
SELECT T2.Freight FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.OrderID = 10692 AND T1.CompanyName = 'Alfreds Futterkiste'
6,426
talkingdata
How many device users are male?
male refers to gender = 'M';
SELECT COUNT(device_id) FROM gender_age WHERE gender = 'M'
1,078
beer_factory
List the brands of root beer produced by Dr Pepper Snapple Group and calculate their percentage of purchases between 2014 to 2016.
brand of root beer refers to BrandName; produced by Dr Pepper Snapple Group refers to BreweryName = 'Dr Pepper Snapple Group'; percentage of purchases = MULTIPLY(DIVIDE(SUM(BrandID WHERE PurchaseDate > = '2014-01-01' AND PurchaseDate < = '2016-12-31'), COUNT(BrandID) WHERE BreweryName = 'Dr Pepper Snapple Group'), 1.0)...
SELECT T1.BrandName , CAST(SUM(CASE WHEN T2.PurchaseDate >= '2014-01-01' AND T2.PurchaseDate <= '2016-12-31' THEN 1 ELSE 0 END) AS REAL) / COUNT(T2.BrandID) AS purchase FROM rootbeerbrand AS T1 INNER JOIN rootbeer AS T2 ON T1.BrandID = T2.BrandID WHERE T1.BreweryName = 'Dr Pepper Snapple Group' GROUP BY T2.BrandID
5,284
video_games
How many platforms are available for the game Pro Evolution Soccer 2016?
game Pro Evolution Soccer 2016 refers to game_name = 'Pro Evolution Soccer 2016'
SELECT COUNT(T2.id) FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id INNER JOIN game_publisher AS T3 ON T1.game_publisher_id = T3.id INNER JOIN game AS T4 ON T3.game_id = T4.id WHERE T4.game_name = 'Pro Evolution Soccer 2016'
3,332
works_cycles
What's Lynn N Tsoflias's job title?
SELECT T2.JobTitle FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.FirstName = 'Lynn' AND T1.MiddleName = 'N' AND T1.LastName = 'Tsoflias'
7,174
soccer_2016
Who is the youngest player to have won the Purple Cap?
Who refers to Player_Name; youngest player to have won the Purple Cap refers to min(subtract(Season_Year, DOB))
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Season AS T2 ON T1.Player_Id = T2.Purple_Cap ORDER BY T2.Season_Year - SUBSTR(T1.DOB, 1, 4) LIMIT 1
1,963
works_cycles
What is the company's profit on the product that was rated second-highest by David?
profit on net on a single product = SUBTRACT(ListPrice, StandardCost); second highest rating refers to Rating = 4; David is the ReviewerName;
SELECT T2.ListPrice - T2.StandardCost FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ReviewerName = 'David' ORDER BY T1.Rating DESC LIMIT 1
7,394
movie_3
Name the most recent movie rented by Dorothy Taylor.
movie name refers to title; the most recent refers to max(rental_date)
SELECT T4.title FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T1.first_name = 'DOROTHY' AND T1.last_name = 'TAYLOR' ORDER BY T2.rental_date DESC LIMIT 1
9,372
superstore
Who is the customer with an order shipped on March 5, 2013, in the eastern region?
Who is the customer refers to Customer Name; shipped on March 5, 2013 refers to "Ship Date" = '2013-03-05'; eastern region refers to Region = 'East'
SELECT DISTINCT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Ship Date` = '2013-03-05'
2,453
address
Provide the population of Arecibo in 2020.
population of Arecibo in 2020 refers to SUM(population_2020) where county = 'ARECIBO';
SELECT SUM(T2.population_2020) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.county = 'ARECIBO'
5,199
donor
Name the project titles created by teacher who acquired a doctor degree.
teacher who acquired a doctor degree refers to teacher_prefix = 'Dr.'
SELECT T1.title FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.donation_message LIKE 'Donation on behalf of Matt Carpenter because I''m a strong believer in education.'
3,154
sales
Among customers with the last name of Valdez, who purchased the highest quantity?
highest quantity refers to MAX(Quantity);
SELECT T1.FirstName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.LastName = 'Valdez' ORDER BY T2.Quantity DESC LIMIT 1
5,384
world_development_indicators
Which low income country has a series code of DT.DOD.DECT.CD? Name the country code of it.
IncomeGroup = 'Low income';
SELECT T1.CountryCode FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.IncomeGroup = 'Low income' AND T2.Seriescode = 'DT.DOD.DECT.CD'
2,167
works_cycles
Which product ID do not have any work order ID?
Do not have any work order ID means WorkOrderID is null
SELECT ProductID FROM Product WHERE ProductID NOT IN ( SELECT T1.ProductID FROM Product AS T1 INNER JOIN WorkOrder AS T2 ON T1.ProductID = T2.ProductID )
7,183
shooting
What is the proportion of white males and females in the police force?
white refers to race = 'W'; male refers to gender = 'M'; female refers to gender = 'F'; proportion of white males = divide(count(officers where race = 'W' and gender = 'M'), count(officers)) * 100%; proportion of white females = divide(count(officers where race = 'W' and gender = 'F'), count(officers)) * 100%
SELECT CAST(SUM(gender = 'M') AS REAL) / SUM(gender = 'F') FROM officers WHERE race = 'W'
2,483
regional_sales
Calculate the average net profit of phones which have sales channel of distributor.
net profit can be computed as SUBTRACT(Unit Price, Unit Cost); AVG(net profit) where Product Name = 'Phones' and Sales Channel = 'Distributor';
SELECT SUM(REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '')) / COUNT(T1.OrderNumber) FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T2.`Product Name` = 'Phones' AND T1.`Sales Channel` = 'Distributor'
2,614
movielens
List the genres of the movies which actor id 851 is the star.
SELECT T2.genre FROM movies2actors AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid INNER JOIN actors AS T3 ON T1.actorid = T3.actorid WHERE T3.actorid = 851
2,249
public_review_platform
How many open businesses in the City of Phoenix have users left a long review?
open businesses refers to active = 'true'; long review refers to review_length = 'Long'
SELECT COUNT(DISTINCT T2.business_id) FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T1.review_length = 'Long' AND T2.active = 'true' AND T2.city = 'Phoenix'
4,112
computer_student
How many courses are there for basic or medium undergraduate courses?
basic or medium undergraduate courses refers to courseLevel = 'Level_300'; courses refers to course.course_id
SELECT COUNT(course_id) FROM course WHERE courseLevel = 'Level_300'
970
professional_basketball
For the players who played the most PBLA games, who was graduated from Central Missouri State college?
the most PBLA games refers to max(games_played); Central Missouri State college refers to college = 'Central Missouri State'
SELECT T1.firstName, T1.middleName, T1.lastName FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.lgID = 'PBLA' AND T2.GP = 10 AND T1.college = 'Central Missouri State' GROUP BY T1.firstName, T1.middleName, T1.lastName ORDER BY COUNT(T2.id) DESC LIMIT 1
2,945
movie_platform
How many paying subscribers gave a rating to the movie "One Flew Over the Cuckoo's Nest"?
paying subscribers refer to user_has_payment_method = 1; movie "One Flew Over the Cuckoo's Nest" refers to movie_id = 'One Flew Over the Cuckoo''s Nest'
SELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id INNER JOIN ratings_users AS T3 ON T1.user_id = T3.user_id WHERE T2.movie_title = 'One Flew Over the Cuckoo''s Nest' AND T3.user_has_payment_method = 1
131
car_retails
How many 2001 Ferrari Enzo were ordered?
2001 Ferrari Enzo refers to productName;
SELECT SUM(t1.orderNumber) FROM orderdetails AS t1 INNER JOIN products AS t2 ON t1.productCode = t2.productCode WHERE t2.productName = '2001 Ferrari Enzo'
1,665
world_development_indicators
List out the country code and country name of the rich countries using Euro as their currency unit
Non-OECD and OECD countries can be regarded as rich countries for those that are part of the High Income Group;
SELECT DISTINCT T1.CountryCode, T2.CountryName FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.CurrencyUnit = 'Euro' AND (T1.IncomeGroup = 'High income: OECD' OR T1.IncomeGroup = 'High income: nonOECD')
2,157
student_loan
List out all bankrupt students that are able to make payment before due?
make payment before due refers to bool = 'neg';
SELECT T1.name FROM filed_for_bankrupcy AS T1 INNER JOIN no_payment_due AS T2 ON T1.name = T2.name WHERE T2.bool = 'neg'
4,418
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
89

Collection including uiuc-kang-lab/bird-corrected-600