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 |
---|---|---|---|---|---|
cookbook | Which recipe has the highest calories? | the highest calories refers to MAX(calories) | SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id ORDER BY T2.calories DESC LIMIT 1 | 600 | simple |
image_and_language | How many samples of clouds are there in the image no.2315533? | samples of clouds refer to IMG_ID where OBJ_CLASS = 'cloud'; image no.2315533 refers to IMG_ID = 2315533; | SELECT SUM(CASE WHEN T1.IMG_ID = 2315533 THEN 1 ELSE 0 END) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'clouds' | 601 | simple |
world | List down the cities that belong to the country with a life expectancy of 66.4. | SELECT T2.Name FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.LifeExpectancy = 66.4 | 602 | simple |
|
soccer_2016 | List down the match ID of matches that the "man of the match" award was given to BB McCullum. | SELECT T1.Match_Id FROM Match AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match WHERE T2.Player_Name = 'BB McCullum' | 603 | simple |
|
video_games | Calculate the difference in sales between the games released in 1990 and 2000. | difference = SUBTRACT(SUM(num_sales WHERE release_year = 2000), SUM(num_sales WHERE release_year = 1990)); | SELECT SUM(CASE WHEN T2.release_year = 2000 THEN T1.num_sales ELSE 0 END) - SUM(CASE WHEN T2.release_year = 1990 THEN T1.num_sales ELSE 0 END) FROM region_sales AS T1 INNER JOIN game_platform AS T2 ON T1.game_platform_id = T2.id | 604 | moderate |
retails | List by their id all customers who have a debit balance in their accounts. | customers who have a debt balance refer to c_custkey where c_acctbal < 0; | SELECT c_custkey FROM customer WHERE c_acctbal < 0 | 605 | simple |
public_review_platform | What is the category of the business with medium review length and highest review stars within business ID from 6 t0 9? | category refers to category_name; highest review stars refers to max(review_stars); business ID from 6 to 9 refers to business_id between 6 and 9 | SELECT T4.category_name FROM Reviews 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 T1.review_length LIKE 'Medium' AND T2.business_id BETWEEN 6 AND 9 ORDER BY T1.review_stars DESC LIMIT 1 | 606 | challenging |
retails | How many customers are in the furniture segment? | furniture segment refers to c_mktsegment = 'FURNITURE' | SELECT COUNT(c_custkey) FROM customer WHERE c_mktsegment = 'FURNITURE' | 607 | simple |
works_cycles | Name all products that started selling in 2013. State its respective vendor's name. | Started selling in 2013 refers to year(SellStartDate) = 2013; | SELECT T1.Name, T3.Name FROM Product AS T1 INNER JOIN ProductVendor AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Vendor AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID WHERE STRFTIME('%Y', T1.SellStartDate) = '2013' | 608 | moderate |
talkingdata | Between device ID of "-9215352913819630000" and "-9222956879900150000", mention the age and gender of device user who participated more events. | more events refers to MAX(COUNT(event_id)); | SELECT T.age, T.gender FROM ( SELECT T2.age, T2.gender, COUNT(T1.device_id) AS num FROM events AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id WHERE T1.device_id BETWEEN -9215352913819630000 AND -9222956879900150000 GROUP BY T2.age, T2.gender ) AS T ORDER BY T.num DESC LIMIT 1 | 609 | moderate |
public_review_platform | Which year has the most elite users? | year has the most elite users refers to year_id with MAX(user_id); | SELECT year_id FROM Elite GROUP BY year_id ORDER BY COUNT(user_id) DESC LIMIT 1 | 610 | simple |
movie_3 | How many rentals did Ella Oliver hire in June 2016? | 'Ella Oliver' is a full name of a customer; full name refers to first_name, last_name; rental hired in June 2016 refers to rental_date BETWEEN '2005-06-01' AND '2005-06-30' | SELECT COUNT(T1.rental_id) FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'ELLA' AND T2.last_name = 'ELLA' AND date(T1.rental_date) BETWEEN '2005-06-01' AND '2005-06-30' | 611 | moderate |
works_cycles | Please list all the vendors' usual selling prices of the product Hex Nut 5. | vendor's selling price refers to StandardPrice | SELECT T1.StandardPrice FROM ProductVendor AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'Hex Nut 5' GROUP BY T1.StandardPrice ORDER BY COUNT(T1.StandardPrice) DESC LIMIT 1 | 612 | simple |
disney | Indicate the release date of the film The Lion King directed by Roger Allers. | The Lion King refers to movie_title = 'The Lion King'; Roger Allers refers to director = 'Roger Allers'; | SELECT T1.release_date FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Roger Allers' AND T1.movie_title = 'The Lion King' | 613 | simple |
movie | What is the MPAA rating and title of the movie starred by Leonardo DiCaprio with highest budget? | starred by Leonardo DiCaprio refers to Name = 'Leonardo Dicaprio'; highest budget refers to max(Budget) | SELECT T1.`MPAA Rating`, T1.Title 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 = 'Leonardo DiCaprio' ORDER BY T1.Budget DESC LIMIT 1 | 614 | moderate |
sales | List down all of the sales IDs for sales handled by sales people with first name starting with alphabet "s". | first name starting with alphabet "s" refers to FirstName LIKE 's%'; | SELECT T1.SalesID FROM Sales AS T1 INNER JOIN Employees AS T2 ON T1.SalesPersonID = T2.EmployeeID WHERE SUBSTR(T2.FirstName, 1, 1) = 's' | 615 | simple |
chicago_crime | What is the first name of the aldermen of wards with more than 50,000 inhabitants? | more than 50000 inhabitants refers to Population > 50000; first name of alderman refers to alderman_first_name | SELECT alderman_first_name FROM Ward WHERE Population > 50000 | 616 | simple |
restaurant | List all the cities in Sonoma County. | SELECT city FROM geographic WHERE county = 'sonoma county' | 617 | simple |
|
human_resources | Which positions are suitable with 4 years degree education? | 4 years degree education refers to educationrequired = '4 year degree'; positions refers to positiontitle | SELECT positiontitle FROM position WHERE educationrequired = '4 year degree' | 618 | simple |
cs_semester | Among students that gave satisfaction of value 4 for the course named "Statistical Learning", how many of them have a gpa of 3.8? | satisfaction refers to sat;
sat = 4; gpa = 3.8 | SELECT COUNT(T1.student_id) 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 = 'Statistical learning' AND T2.sat = 4 AND T1.gpa = 3.8 | 619 | moderate |
movies_4 | How many movies were produced by "Eddie Murphy Productions"? | produced by "Eddie Murphy Productions" refers to company_name = 'Eddie Murphy Productions' | SELECT COUNT(T1.movie_id) FROM movie_company AS T1 INNER JOIN production_company AS T2 ON T1.company_id = T2.company_id WHERE T2.company_name = 'Eddie Murphy Productions' | 620 | simple |
regional_sales | Which product has the highest net profit in 2019? | net profit can be computed as SUBTRACT(Unit Price, Unit Cost); the highest net profit in 2019 refers to MAX(Net Profit) where OrderDate LIKE '%/19'; product refers to Product Name; | SELECT T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T1.OrderDate LIKE '%/%/19' ORDER BY REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') DESC LIMIT 1 | 621 | moderate |
movies_4 | List the title of movies in Latin released between 1/01/1990 and 12/31/1995. | movies in Latin refers to language_name = 'Latin'; released between 1/01/1990 and 12/31/1995 refers to release_date BETWEEN '1990-01-01' AND '1995-12-31' | 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 = 'Latin' AND T1.release_date BETWEEN '1990-01-01' AND '1995-12-31' | 622 | moderate |
books | Give the number of Ukrainian addresses in the database. | Ukrainian address refers to country_name = 'Ukraine' | SELECT COUNT(*) FROM country AS T1 INNER JOIN address AS T2 ON T1.country_id = T2.country_id WHERE T1.country_name = 'Ukraine' | 623 | simple |
works_cycles | Average of the last receipt cost of the products whose average lead time is 60 days. | average = DIVIDE(SUM(lastreceiptcost), COUNT(OnorderQty)) where AverageLeadTime = 60 | SELECT SUM(LastReceiptCost) / COUNT(ProductID) FROM ProductVendor WHERE AverageLeadTime = 60 | 624 | simple |
legislator | What is the title of legislator whose birthday on 2/20/1942? | birthday on 2/20/1942 refers to birthday_bio = '1942-02-20' | SELECT T2.title FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.birthday_bio = '1942-02-20' GROUP BY T2.title | 625 | simple |
world | Write down the name of the largest population country. | largest population refers to MAX(Population); | SELECT Name FROM Country ORDER BY Population DESC LIMIT 1 | 626 | simple |
sales_in_weather | What was the average temperature differences during May 2012 for store number 6 and 7? | during May 2012 refers to SUBSTR(date, 1, 7) = '2012-05'; store number 6 refers to store_nbr = 6; store number 7 refers to store_nbr = 7; average temperature difference = Subtract (Divide (Sum(tavg), Count (date) where the store_nbr = 6), Divide (Sum(tavg), Count(date) where store_nbr = 7)) | SELECT ( SELECT CAST(SUM(tavg) AS REAL) / COUNT(`date`) FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr AND T1.`date` LIKE '%2012-05%' AND T2.store_nbr = 6 ) - ( SELECT CAST(SUM(tavg) AS REAL) / COUNT(`date`) FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.`date` LIKE '%2012-05%' AND T2.store_nbr = 7 ) | 627 | challenging |
airline | Tell the number of fights landed earlier on Miami Airport on 2018/8/12. | landed on refers to DEST; landed earlier refers to ARR_DELAY < 0; Miami Airport refers to DEST = 'MIA'; on 2018/8/12 refers to FL_DATE = '2018/8/12'; | SELECT COUNT(*) FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE = '2018/8/12' AND T2.DEST = 'MIA' AND T2.ARR_DELAY < 0 | 628 | simple |
mondial_geo | Find the GPD for Bosnia and Herzegovina and the type of government it belongs to. | SELECT T1.GDP, T2.Government FROM economy AS T1 INNER JOIN politics AS T2 ON T1.Country = T2.Country INNER JOIN country AS T3 ON T3.Code = T2.Country WHERE T3.Name = 'Bosnia and Herzegovina' | 629 | simple |
|
chicago_crime | List all the crimes of the narcotic type that exist. | narcotic type refers to primary_description = 'NARCOTICS'; crime refers to secondary_description | SELECT secondary_description FROM IUCR WHERE primary_description = 'NARCOTICS' GROUP BY secondary_description | 630 | simple |
video_games | State the name of the platforms for games released in 2000. | name of the platforms refers to platform_name; released in 2000 refers to release_year = 2000; | SELECT DISTINCT T2.platform_name FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id WHERE T1.release_year = 2000 | 631 | simple |
human_resources | What is the average salary of the employees who work as a Trainee? | average = DIVIDE( SUM(salary), COUNT(positiontitle) where positiontitle = 'Trainee'; Trainee is a position title | SELECT AVG(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) AS avg FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Trainee' | 632 | moderate |
video_games | What is the genre of the Advent Rising game? | genre refers to genre_name; Advent Rising game refers to game_name = 'Advent Rising' | SELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = 'Advent Rising' | 633 | simple |
movie_3 | Write down any five film names under the documentary category. | "Documentary" is the name of category; film name refers to title | SELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Documentary' LIMIT 5 | 634 | simple |
donor | What percentage of projects in the City of Santa Barbara are in suburban metro? | City of Santa Barbara refers to school_city = 'Santa Barbara'; percentage refers to DIVIDE(school_metro = 'suburban'; school_metro)*100 | SELECT CAST(SUM(CASE WHEN school_metro = 'suburban' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(projectid) FROM projects WHERE school_city = 'Santa Barbara' | 635 | simple |
movie_platform | Please list the names of the films released in 2003 among the films scored by user 2941 . | released in 2003 refers to movie_release_year = 2003; user 2941 refers to user_id = 2941; film refers to movie; | SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year = 2003 AND T1.user_id = 2941 | 636 | simple |
video_games | How many games were published by Acclaim Entertainment? | published by Acclaim Entertainment refers to publisher_name = 'Acclaim Entertainment' | SELECT COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'Acclaim Entertainment' | 637 | simple |
hockey | What is the average winning rate of the Buffalo Sabres in 2000? | DIVIDE(SUM(DIVIDE(W,G), COUNT(oppID) where year = 2000; Montreal Canadiens is name of team; | SELECT SUM(CAST(T2.W AS REAL) / T2.G) / COUNT(T1.oppID) FROM TeamVsTeam AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID WHERE T2.name = 'Buffalo Sabres' AND T1.year = 2000 | 638 | simple |
ice_hockey_draft | Among all the players that are right-shooted, how many of them weigh over 90 kg? | right-shooted refers to shoots = 'R'; weigh over 90 kg refers to weight_in_kg > 90; | SELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 AND T1.shoots = 'R' | 639 | simple |
citeseer | Which paper ID cited the most word? In which class label does it belongs to? | most cited word refers to max(word_cited_id); | SELECT T1.paper_id, T1.class_label FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id GROUP BY T1.paper_id, T1.class_label ORDER BY COUNT(T2.word_cited_id) DESC LIMIT 1 | 640 | simple |
law_episode | Who was the Law and Order series writer who also won the Television Silver Gavel Award at the American Bar Association Silver Gavel Awards for Media and the Arts for two consecutive years? | who refers to name; writer refers to role = 'writer'; won refers to result = 'Winner'; the Television refers to award = 'Television'; Silver Gavel Award refers to award_category = 'Silver Gavel Award'; the American Bar Association Silver Gavel Awards for Media and the Arts refers to organization = 'American Bar Association Silver Gavel Awards for Media and the Arts' | SELECT t3.name FROM ( SELECT DISTINCT T2.year AS years, T1.name, row_number() OVER (PARTITION BY T1.name ORDER BY T2.year) AS rm FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.award = 'Television' AND T2.award_category = 'Silver Gavel Award' AND T2.series = 'Law and Order' AND T2.result = 'Winner' AND T2.organization = 'American Bar Association Silver Gavel Awards for Media and the Arts' ) AS T3 GROUP BY t3.name HAVING COUNT(t3.years - t3.rm) >= 2 | 641 | challenging |
menu | How many dishes are there on the menu "Zentral Theater Terrace"? | Zentral Theater Terrace is a name of menu; | SELECT COUNT(*) FROM Menu WHERE name = 'Zentral Theater Terrace' | 642 | simple |
food_inspection | List down the owner's name with a zip code 94104. | zip code 94104 refers to owner_zip = '94104'; | SELECT DISTINCT owner_name FROM businesses WHERE owner_zip = '94104' | 643 | simple |
donor | Which resource type is commonly bought by the Los Angeles Unified School District? | resource type refer to project_resource_type; most commonly bought refer to COUNT(project_resource_type where school_district = ’Los Angeles Unif Sch Dist’); Los Angeles Unified School District refer to school_district = ’Los Angeles Unif Sch Dist’ | SELECT T1.project_resource_type FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_district = 'Los Angeles Unif Sch Dist' GROUP BY T2.school_district ORDER BY COUNT(T1.project_resource_type) DESC LIMIT 1 | 644 | simple |
soccer_2016 | What is the role of SC Ganguly in the match on 2008/4/18? | role refers to of Role_Id; SC Ganguly refers to Player_Name = 'SC Ganguly'; on 2008/4/18 refers to Match_Date = '2008-04-18' | SELECT T2.Role_Id FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T2.Role_Id = T3.Role_Id INNER JOIN Match AS T4 ON T2.Match_Id = T4.Match_Id WHERE T1.Player_Name = 'SC Ganguly' AND T4.Match_Date = '2008-04-18' | 645 | moderate |
food_inspection_2 | Calculate the percentage of inspections with the fine for a minor food safety problem. | fine for a minor food safety problem refers to fine = 100; percentage = divide(count(inspection_id where fine = 100), sum(inspection_id)) * 100% | SELECT CAST(COUNT(CASE WHEN fine = 100 THEN inspection_id END) AS REAL) * 100 / COUNT(inspection_id) FROM violation | 646 | simple |
movie_3 | Among the films starring PENELOPE GUINESS, how many of them are released in 2006? | release in 2006 refers to release_year = 2006; | SELECT COUNT(T2.film_id) 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.release_year = 2006 AND T1.first_name = 'PENELOPE' AND T1.last_name = 'GUINESS' | 647 | moderate |
european_football_1 | What is the most consecutive games tied by Ebbsfleet as an away team in the 2008 season? | consecutive games mean happen one after the other without interruption and refer to Date; tied refers to FTR = 'D'; | SELECT COUNT(*) FROM matchs WHERE season = 2008 AND AwayTeam = 'Ebbsfleet' AND FTR = 'D' | 648 | simple |
simpson_episodes | Name the title of the episode that received the highest star score and the highest number of votes. | received the highest star score refers to MAX(stars); the highest number of votes refers to MAX(votes) | SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id ORDER BY T2.stars DESC, T2.votes DESC LIMIT 1; | 649 | simple |
movie_3 | Calculate the total amount paid by Stephanie Mitchell for film rentals in June 2005. | the total amount = sum(amount); in June 2005 refers to payment_date like '2005-06%' | SELECT SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'STEPHANIE' AND T2.last_name = 'MITCHELL' AND SUBSTR(T1.payment_date, 1, 7) = '2005-06' | 650 | moderate |
food_inspection | Give the address of the business with the most number of the low risk violations. | the most number of the low risk violations refers to MAX(COUNT(business_id)) where risk_category = 'Low Risk' ; | SELECT T2.address FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'Low Risk' GROUP BY T2.address ORDER BY COUNT(T1.business_id) DESC LIMIT 1 | 651 | simple |
movie_platform | Please list the names of the movies that have been rated the most times in 2020. | in 2020 refers to rating_timestamp_utc = '2020%'; rated the most times refers to Max(Count(movie_title)); | SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_timestamp_utc LIKE '2020%' GROUP BY T2.movie_title ORDER BY COUNT(T2.movie_title) DESC LIMIT 1 | 652 | moderate |
chicago_crime | Among the incidents with the generic description of "BATTERY" in the IUCR classification, how many of them do not have arrests made? | general description refers to primary_description; 'BATTERY' is the primary_description; do not have arrest made refers to arrest = 'FALSE' | SELECT SUM(CASE WHEN T2.arrest = 'FALSE' THEN 1 ELSE 0 END) FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T1.primary_description = 'BATTERY' | 653 | moderate |
genes | How many non-essential genes are located in the nucleus? | SELECT COUNT(T1.GeneID) FROM Genes AS T1 INNER JOIN Classification AS T2 ON T1.GeneID = T2.GeneID WHERE T2.Localization = 'nucleus' AND T1.Essential = 'Non-Essential' | 654 | simple |
|
books | How many customers ordered the book titled "Anleitung zum Zickigsein" | "Anleitung zum Zickigsein" is the title of the book | SELECT COUNT(*) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T1.title = 'Anleitung zum Zickigsein' | 655 | simple |
hockey | What is the total amount of assists of the NHL player with the most assists in history? Please indicate his/her full name. | NHL refers to lgID = 'NHL'; most assists refers to max(A); full name = nameGiven + lastName; total amount of assists = sum(A(playerID(max(A)))) | SELECT SUM(T1.A), T2.firstName, T2.lastName FROM Scoring AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.lgID = 'NHL' GROUP BY T2.firstName, T2.lastName ORDER BY SUM(T1.A) DESC LIMIT 1 | 656 | moderate |
shipping | List the drivers who shipped the shipments to the least populated city. | least populated city refers to Min(population); name refers to first_name, last_name | SELECT T3.first_name, T3.last_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id ORDER BY T2.population ASC LIMIT 1 | 657 | simple |
car_retails | Please list all the customers that have Steve Patterson as their sales representitive. | Steve Patterson is an employee; | SELECT t1.customerName FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t2.firstName = 'Steve' AND t2.lastName = 'Patterson' | 658 | simple |
movie | Find the actor's name that played as Don Altobello in a drama movie that has a gross of 136766062. | actor's name refers to Name; as Don Altobello refers to Character Name = 'Don Altobello'; drama movie refers to Genre = 'Drama' | 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.Gross = 136766062 AND T2.`Character Name` = 'Don Altobello' AND T1.Genre = 'Drama' | 659 | moderate |
beer_factory | What is the credit card type used by Kenneth Walton? | FALSE; | SELECT DISTINCT T2.CreditCardType FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'Kenneth' AND T1.Last = 'Walton' | 660 | simple |
public_review_platform | How many "cool" type compliments does user No. 41717 get? | "cool" type compliments refers to compliment_type = 'cool'; user No. 41717 refers to user_id = 41717 | SELECT COUNT(T2.number_of_compliments) FROM Compliments AS T1 INNER JOIN Users_Compliments AS T2 ON T1.compliment_id = T2.compliment_id WHERE T1.compliment_type = 'cool' AND T2.user_id = 41717 | 661 | simple |
app_store | How many neutral reviews does the app "Dino War: Rise of Beasts" have? | neutral reviews refers to Sentiment = 'Neutral'; | SELECT COUNT(App) FROM user_reviews WHERE App = 'Dino War: Rise of Beasts' AND Sentiment = 'Neutral' | 662 | simple |
computer_student | Which courses were taught by a professor who is not a faculty member? | courses refers to taughtBy.course_id; professor refers to professor = 1; is not a faculty member refers to hasPosition = 0 | SELECT DISTINCT T2.course_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.professor = 1 AND T1.hasPosition = 0 | 663 | simple |
movie_3 | What is the title of the animated films that have the shortest length? | animated film means animation; animation is a name of a category | SELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id ORDER BY T1.length LIMIT 1 | 664 | simple |
retail_complains | What is the name of the state in which there have been the largest number of complaints with priority 0? | largest number of complaints refers to MAX(COUNT("Complaint ID") WHERE priority = 0); | SELECT T2.state FROM callcenterlogs AS T1 INNER JOIN client AS T2 ON T1.`rand client` = T2.client_id INNER JOIN district AS T3 ON T2.district_id = T3.district_id INNER JOIN state AS T4 ON T3.state_abbrev = T4.StateCode WHERE T1.priority = 0 GROUP BY T2.state ORDER BY COUNT(T2.state) DESC LIMIT 1 | 665 | moderate |
airline | Tell the number of flights that landed at Lake Charles Regional Airport on 2018/8/15. | landed at refers to DEST; Lake Charles Regional Airport refers to Description = 'Lake Charles, LA: Lake Charles Regional'; on 2018/8/15 refers to FL_DATE = '2018/8/15'; | SELECT COUNT(T1.Code) FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE = '2018/8/15' AND T1.Description = 'Lake Charles, LA: Lake Charles Regional' | 666 | simple |
image_and_language | Which object in image 8 is the widest? State its object sample ID. | widest relates to the width of the bounding
box of the object which refers to MAX(W); object in image 8 refers to OBJ_SAMPLE_ID where IMG_ID = 8; | SELECT OBJ_SAMPLE_ID FROM IMG_OBJ WHERE IMG_ID = 8 ORDER BY W DESC LIMIT 1 | 667 | simple |
mondial_geo | Please list the name of the countries with over 5 ethnic groups. | SELECT T1.Name FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country GROUP BY T1.Name HAVING COUNT(T1.Name) > 5 | 668 | simple |
|
cs_semester | Among the professors with more than average teaching ability, list the full name and email address of the professors who advise two or more students. | more than average teaching ability refers to teachingability > AVG(teachingability); full_name of the professor = first_name, last_name; email address of the professor refers to email; advises two or more students refers to COUNT(student_id) > = 2;
| SELECT T2.first_name, T2.last_name, T2.email FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.teachingability > ( SELECT AVG(teachingability) FROM prof ) GROUP BY T2.prof_id HAVING COUNT(T1.student_id) >= 2 | 669 | moderate |
retail_world | Which customer have the biggest purchase in one order and where does this order being ship to? | biggest purchase refers to max(ProductID.Order_Details); ship to refers to ShipCountry | SELECT T1.CompanyName, T2.ShipCountry FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN `Order Details` AS T3 ON T2.OrderID = T3.OrderID GROUP BY T1.CompanyName, T2.ShipCountry ORDER BY COUNT(T3.ProductID) DESC LIMIT 1 | 670 | moderate |
professional_basketball | Among the coaches who have served more than 2 NBA teams, during which coach's period of coaching, a team has the least numbers of games lost in the post-season games? | served more than 2 NBA teams refers to count (tmID) > = 2; least number of game lost in post season refers to Min(post_losses) | SELECT coachID FROM coaches WHERE lgID = 'NBA' AND post_wins != 0 AND post_losses != 0 AND coachID IN ( SELECT coachID FROM coaches WHERE lgID = 'NBA' GROUP BY coachID HAVING COUNT(tmID) > 2 ) ORDER BY post_losses ASC LIMIT 1 | 671 | moderate |
authors | What was the name of the paper that was published on "IEEE Transactions on Pattern Analysis and Machine Intelligence" in 2011? | 'IEEE Transactions on Pattern Analysis and Machine Intelligence' is the FullName of journal; 2011 refers to Year = '2011'; name of the paper refers to Title of paper | SELECT T2.Title FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.FullName = 'IEEE Transactions on Pattern Analysis and Machine Intelligence' AND T2.Year = 2011 AND T2.Title <> '' | 672 | moderate |
address | What is the state for area code of 787? | SELECT DISTINCT T2.state FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 787 | 673 | simple |
|
computer_student | List the ID and years in program for students taught by advisor with ID 5. | advisor with ID 5 refers to p_id_dummy = 5 | SELECT T1.p_id, T2.yearsInProgram FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T1.p_id_dummy = 5 | 674 | simple |
cars | How much is the car with the highest sweep volume? | cost refers to price; the highest sweep volume refers to max(divide(displacement, cylinders)) | SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T1.displacement / T1.cylinders DESC LIMIT 1 | 675 | simple |
retail_complains | How many days delay for the complaint call from Mr. Brantley Julian Stanley on 2012/5/18? | days delay for the complaint = SUBTRACT("date sent to company", "Date received"); Mr refers to sex = 'Male'; on 2012/5/18 refers to "Date received" = '2012-05-18'; | SELECT 365 * (strftime('%Y', T2.`Date sent to company`) - strftime('%Y', T2.`Date received`)) + 30 * (strftime('%M', T2.`Date sent to company`) - strftime('%M', T2.`Date received`)) + (strftime('%d', T2.`Date sent to company`) - strftime('%d', T2.`Date received`)) AS days FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Date received` = '2012-05-18' AND T1.sex = 'Male' AND T1.first = 'Brantley' AND T1.middle = 'Julian' AND T1.last = 'Stanley' | 676 | challenging |
food_inspection_2 | What are the inspection description and inspector's comments in the inspection ID 164795? | inspection description refers to Description; inspector's comment refers to inspector_comment | SELECT T1.Description, T2.inspector_comment FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T2.inspection_id = 44247 | 677 | simple |
works_cycles | If a married employee has a western name style, what is the probability of him or her working as a store contact? | married refers to MaritalStatus = 'M'; western name style refers to NameStyle = 0; store contact refers to PersonType = 'SC'; probability = Divide (Count (BusinessEntityID( PersonType = 'SC' & MaritalStatus = 'M')), Count (BusinessEntityID ( PersonType) & MariatlStatus = 'M'))
| SELECT CAST(COUNT(IIF(T1.PersonType = 'SC', T1.PersonType, NULL)) AS REAL) / COUNT(T1.PersonType) FROM Person AS T1 INNER JOIN Employee AS T2 WHERE T1.PersonType = 'SC' AND T1.NameStyle = 0 AND T2.MaritalStatus = 'M' | 678 | moderate |
student_loan | How many months has student217 been absent? | SELECT month FROM longest_absense_from_school WHERE name = 'student217' | 679 | simple |
|
world_development_indicators | What is the percentage of countries in the Middle East and North Africa that have finished reporting on their real external debt? | percentage = divide(count(countrycode where ExternalDebtReportingStatus = 'Actual' ), count(countrycode))*100%; in the Middle East and North Africa refers to region = 'Middle East & North Africa'; have finished reporting on their real external debt refers to ExternalDebtReportingStatus = 'Actual' | SELECT CAST(SUM(CASE WHEN ExternalDebtReportingStatus = 'Actual' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(CountryCode) FROM Country WHERE region = 'Middle East & North Africa' | 680 | moderate |
social_media | What is the text of the tweet that got the most `likes`? | got the most like refers to Max(Likes) | SELECT text FROM twitter WHERE Likes = ( SELECT MAX( Likes) FROM twitter ) | 681 | simple |
movie_platform | What is the name of the list that was updated most recently? | updated most recently refers to MAX(list_update_date_utc) | SELECT list_title FROM lists WHERE list_update_timestamp_utc = ( SELECT list_update_timestamp_utc FROM lists ORDER BY list_update_timestamp_utc DESC LIMIT 1 ) | 682 | simple |
music_tracker | How many times was the album released by blowfly in 1980 downloaded? | blowfly is an artist; groupYear = 1980; album refers to releaseType; downloaded refers to totalSnatched; | SELECT totalSnatched FROM torrents WHERE artist LIKE 'blowfly' AND groupYear = 1980 | 683 | simple |
soccer_2016 | What percentage of players have Legbreak skill? | Legbreak skill refers to Bowling_skill = 'Legbreak' ; percentage = divide(sum(Player_Id) when Bowling_skill = 'Legbreak', count(Player_Id)) as percentage | SELECT CAST(SUM(CASE WHEN T2.Bowling_skill = ' Legbreak' THEN 1 ELSE 0 END) AS REAL) * 100 / TOTAL(T1.Player_Id) FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T1.Bowling_skill = T2.Bowling_Id | 684 | simple |
trains | Please list the directions in which the trains with at least one empty-loaded car run. | at least one empty-loaded car run refers to load_num = 0 | SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.load_num = 0 | 685 | simple |
regional_sales | How many stores with less need for products, and purchased through a distributor, are located in Washtenaw County? | less need for products refers to Order Quantity = 1; purchased through a distributor refers to Sales Channel = 'Distributor'; 'Harri County' is the County | SELECT SUM(CASE WHEN T1.`Order Quantity` = 1 AND T1.`Sales Channel` = 'Distributor' AND T2.County = 'Washtenaw County' THEN 1 ELSE 0 END) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID | 686 | moderate |
movies_4 | List the names of camera supervisors in the crew. | names refers to person_name; camera supervisors refers to job = 'Camera Supervisor'; | SELECT T1.person_name FROM person AS T1 INNER JOIN movie_crew AS T2 ON T1.person_id = T2.person_id WHERE T2.job = 'Camera Supervisor' | 687 | simple |
mondial_geo | Which countries have more than 90% of African? List the name of the country in full. | Percentage = 90 means 90% of the population | SELECT T2.Name FROM ethnicGroup AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T1.Name = 'African' AND T1.Percentage > 90 | 688 | simple |
retails | Identify the names of the top 3 customers with the highest number of orders of all time and calculate for the average total price per order of each customers. | customers with the highest number of orders refer to c_name where MAX(COUNT(o_orderkey)); DIVIDE(SUM(o_totalprice), COUNT(o_orderkey)); | SELECT T.c_name, T.res FROM ( SELECT T2.c_name, SUM(T1.o_totalprice) / COUNT(T1.o_orderkey) AS res , COUNT(T1.o_orderkey) AS num FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey GROUP BY T1.o_custkey ) AS T ORDER BY T.num DESC LIMIT 3 | 689 | moderate |
mondial_geo | What nations are considered British Overseas Territories? | British Overseas Territories is one government form; Nation and country share the same meaning | SELECT name FROM country WHERE CODE IN ( SELECT country FROM politics WHERE government = 'British Overseas Territories' ) | 690 | simple |
european_football_1 | How many times did the team Werder Bremen win as the away team in matches of the Bundesliga division? | Bundesliga is the name of division; win as the away team refers to FTR = 'A', where 'A' stands for away victory; | SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.AwayTeam = 'Werder Bremen' AND T1.FTR = 'A' | 691 | moderate |
restaurant | What percentage of restaurants are from the Bay Area? | Bay Area refers to region = 'bay area'; percentage = divide(count(id_restaurant where region = 'bay area'), count(id_restaurant)) * 100% | SELECT CAST(SUM(IIF(T1.region = 'bay area', 1, 0)) AS REAL) * 100 / COUNT(T2.id_restaurant) FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city | 692 | simple |
university | List down all universities that scored below 50. | scored below 50 refers to score < 50; all universities refers to university_name; | SELECT DISTINCT T2.university_name FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.score < 50 | 693 | simple |
works_cycles | Please show the credit card number of David Bradley. | credit card number refers to CardNumber; | SELECT T3.CardNumber FROM Person AS T1 INNER JOIN PersonCreditCard AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN CreditCard AS T3 ON T2.CreditCardID = T3.CreditCardID WHERE T1.FirstName = 'David' AND T1.LastName = 'Bradley' | 694 | simple |
works_cycles | List all the scraped work orders for handling damage reason. | handling damage is descrription of manufacturing failure which refers to ScrapReason.Name | SELECT T2.WorkOrderID FROM ScrapReason AS T1 INNER JOIN WorkOrder AS T2 ON T1.ScrapReasonID = T2.ScrapReasonID WHERE T1.Name = 'Handling damage' | 695 | simple |
olympics | Show the name of the sport with the most events. | name of the sport with the most events refers to sport_name where MAX(COUNT(id)); | SELECT T1.sport_name FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id GROUP BY T1.sport_name ORDER BY COUNT(T2.event_name) DESC LIMIT 1 | 696 | simple |
talkingdata | How many devices belong to model "A51"? | model refers to device_model; device_model = 'A51'; | SELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE device_model = 'A51' | 697 | simple |
shipping | What is the brand of truck used in shipment id 1011? | shipment id 1011 refers to ship_id = 1011; brand of truck refers to make | SELECT T1.make FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1011' | 698 | simple |
video_games | Which region has the highest number of games sold on all platforms? | which region refers to region_name; highest number of games sold on all platforms refers to MAX(SUM(num_sales)); | SELECT T.region_name FROM ( SELECT T2.region_name, SUM(T1.num_sales) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id INNER JOIN game_platform AS T3 ON T1.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id GROUP BY T4.platform_name ORDER BY SUM(T1.num_sales) DESC LIMIT 1 ) t | 699 | moderate |
Subsets and Splits