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 |
---|---|---|---|---|---|
student_loan | What is the average time for a disabled student to be absent from school? | average time refers to DIVIDE(SUM(`month`), COUNT(name)) | SELECT AVG(T1.month) FROM longest_absense_from_school AS T1 INNER JOIN disabled AS T2 ON T1.`name` = T2.`name` | 6,300 | simple |
authors | What was the topic of the article "A Formal Approach to Service Component Architecture" and when was it published? | article "A Formal Approach to Service Component Architecture" refers to Title = 'A Formal Approach to Service Component Architecture'; topic of the article refers to Keyword | SELECT Keyword, Year FROM Paper WHERE Title = 'A Formal Approach to Service Component Architecture' | 6,301 | simple |
public_review_platform | Among the users who have posted more than 10 reviews, how many users are elite users? | posted more than 10 reviews refers to count(Reviews.user_id) > 10 | SELECT COUNT(T4.user_id) FROM ( SELECT T1.user_id FROM Users AS T1 INNER JOIN Elite AS T2 ON T1.user_id = T2.user_id INNER JOIN Reviews AS T3 ON T1.user_id = T3.user_id WHERE T3.user_id IS NOT NULL GROUP BY T3.user_id HAVING COUNT(T3.user_id) > 10 ) T4 | 6,302 | moderate |
music_tracker | Please list all tags of kurtis blow from 2000 to 2010. | kurtis blow is an artist; from 2000 to 2010 refers to groupYear between 2000 and 2010; | SELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupYear BETWEEN 2000 AND 2010 AND T1.artist LIKE 'kurtis blow' | 6,303 | simple |
retail_complains | Which state has the highest number of clients who gave a 5-star review? | highest number of clients refers to MAX(COUNT(client_id)); 5-star review refers to stars = 5; | SELECT T2.state_abbrev FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Stars = 5 GROUP BY T2.state_abbrev ORDER BY COUNT(T2.state_abbrev) DESC LIMIT 1 | 6,304 | simple |
simpson_episodes | Please list the three episodes with the highest number of votes for the worst star rating. | highest number of votes refers to MAX(COUNT(votes)); worst star rating refers to stars = 1 | SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = ( SELECT MIN(stars) FROM Vote ) ORDER BY T2.votes DESC LIMIT 3; | 6,305 | simple |
books | On what date did the customers who live at number 460 of their respective streets place their orders? | live at number 460 refers to street_number = '460'; date the customers placed their orders refers to order_date | SELECT T1.order_date FROM cust_order AS T1 INNER JOIN address AS T2 ON T1.dest_address_id = T2.address_id WHERE T2.street_number = 460 | 6,306 | simple |
talkingdata | Indicate the location of all the events that occurred on April 30, 2016. | location = longitude, latitude; on April 30, 2016 refers timestamp BETWEEN '2016-04-30 00:00:00' AND '2016-04-30 23:59:59'; | SELECT longitude, latitude FROM events WHERE date(timestamp) = '2016-04-30' | 6,307 | simple |
university | What is the university ID of the university with the largest student staff ratio? | the largest student staff ratio refers to max(student_staff_ratio) | SELECT university_id FROM university_year ORDER BY student_staff_ratio DESC LIMIT 1 | 6,308 | simple |
retail_world | How many orders were shipped by Federal Shipping? | Federal Shipping refers to CompanyName = 'Federal Shipping' | SELECT COUNT(T1.OrderID) FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T2.CompanyName = 'Federal Shipping' | 6,309 | simple |
beer_factory | Please list the brands of all the root beer that Frank-Paul Santangelo had purchased on 2014/7/7. | brands of the root beer refers to BrandName; purchased on 2014/7/7 refers to transactiondate = '2014-07-07'; | SELECT DISTINCT T4.BrandName FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeer AS T3 ON T2.RootBeerID = T3.RootBeerID INNER JOIN rootbeerbrand AS T4 ON T3.BrandID = T4.BrandID WHERE T1.First = 'Frank-Paul' AND T1.Last = 'Santangelo' AND T2.TransactionDate = '2014-07-07' | 6,310 | moderate |
authors | What is the name of the co-authors of the paper titled 'Particle identification using the time-over-threshold method in the ATLAS Transition Radiation Tracker'? | paper titled 'Particle identification using the time-over-threshold method in the ATLAS Transition Radiation Tracker' refers to Title = 'Particle identification using the time-over-threshold method in the ATLAS Transition Radiation Tracker' | SELECT T1.Name FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T2.Title = 'Particle identification using the time-over-threshold method in the ATLAS Transition Radiation Tracker' | 6,311 | simple |
works_cycles | When did the Senior Tool Designer, who was 33 years old at the time he was hired, stopped working in the Engineering department? | Senior Tool Designer is a JobTitle; 33 years old at the time of hiring refers to SUBTRACT(year(HireDate)), (year(BirthDate)) = 33; | SELECT T2.EndDate FROM Employee AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Department AS T3 ON T2.DepartmentID = T3.DepartmentID WHERE T1.JobTitle = 'Senior Tool Designer' AND STRFTIME('%Y', T1.HireDate) - STRFTIME('%Y', T1.BirthDate) = 33 AND T2.EndDate IS NOT NULL | 6,312 | challenging |
law_episode | What are the keywords of the episode which received the 2nd-highest number of votes? | the 2nd-highest number of votes refers to second max(votes) | SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.votes NOT IN ( SELECT MAX(T1.votes) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id ) ORDER BY T1.votes DESC LIMIT 1 | 6,313 | moderate |
public_review_platform | How many businesses in AZ state have the beer_and_wine attribute? | beer_and_wine refers to attribute_value = 'beer_and_wine'; | SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id WHERE T2.attribute_value LIKE 'beer_and_wine' AND T1.state LIKE 'AZ' | 6,314 | simple |
video_games | Which platform is the most popular in Europe? | platform that is the most popular refers to platform_name WHERE MAX(num_sales); in Europe refers to region_name = 'Europe' ; | SELECT T.platform_name FROM ( SELECT T4.platform_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T1.region_name = 'Europe' ORDER BY T2.num_sales DESC LIMIT 1 ) t | 6,315 | moderate |
retails | Please state the segment, the name, the address, and the phone number of customer number 3. | segment refers to c_mktsegment; name refers to c_name; address refers to c_address; phone number refers to c_phone; customer number 3 refers to c_custkey = 3 | SELECT c_mktsegment, c_name, c_address, c_phone FROM customer WHERE c_custkey = 3 | 6,316 | simple |
movielens | How many French movies got the highest ranking? | France is a country | SELECT COUNT(movieid) FROM movies WHERE country = 'France' AND movieid IN ( SELECT movieid FROM u2base WHERE rating = ( SELECT MAX(rating) FROM u2base ) ) | 6,317 | simple |
law_episode | Who is the person who appeared the most in the series? Calculate in percentage how many times he or she appeared. | who refers to name; appear the most refers to max(count(person_id)); percentage = divide(count(person_id where max(count(person_id))), count(person_id)) * 100% | SELECT T2.person_id, CAST(COUNT(T2.person_id) AS REAL) * 100 / ( SELECT COUNT(T2.person_id) AS num FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id ) AS per FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id GROUP BY T2.person_id ORDER BY COUNT(T2.person_id) DESC LIMIT 1 | 6,318 | moderate |
superstore | What was the original price of Xerox 1952 ordered by Aimee Bixby on 2014/9/10? | Xerox 1952 is a "Product Name"; ordered by Aimee Bixby refers to "Customer Name" = 'Aimee Bixby'; on 2014/9/10 refers to "Order Date" = date('2014-09-10'); original price refers to DIVIDE(Sales, SUTRACT(1, discount)) | SELECT DISTINCT T2.Sales / (1 - T2.Discount) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Aimee Bixby' AND T3.`Product Name` = 'Xerox 1952' AND T2.`Order Date` = '2014-09-10' | 6,319 | moderate |
menu | To which menu does the menu page image ID5189412 belong? Please give its name. | FALSE; | SELECT T1.name FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T2.image_id = 5189412 | 6,320 | simple |
chicago_crime | Between Deering and Near West districts, which district reported the most number of crime incidents that happened in a library? | "Deering" and "Near West" are both district_name; 'LIBRARY' is the location_description; district with the most number of crime Max(Count(district_no)) | SELECT T1.district_name FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T1.district_name IN ('Deering', 'Near West') AND T2.location_description = 'LIBRARY' GROUP BY T1.district_name ORDER BY COUNT(T2.district_no) DESC LIMIT 1 | 6,321 | moderate |
video_games | For all the games which were published by Namco Bandai Games, what percentage of them were adventure games? | published by Namco Bandai Games refers to publisher_name = 'Namco Bandai Games'; adventure game refers to genre_name = 'Adventure'; percentage = divide(sum(game_id where genre_name = 'Adventure'), count(game_id)) * 100% where publisher_name = 'Namco Bandai Games' | SELECT CAST(COUNT(CASE WHEN T4.genre_name = 'Adventure' THEN T1.id ELSE NULL END) AS REAL) * 100 / COUNT(T1.id) FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id INNER JOIN genre AS T4 ON T1.genre_id = T4.id WHERE T3.publisher_name = 'Namco Bandai Games' | 6,322 | challenging |
regional_sales | List out the name of orders which have delivery date of 6/13/2018. | SELECT DISTINCT T FROM ( SELECT IIF(DeliveryDate = '6/13/18', OrderNumber, NULL) AS T FROM `Sales Orders` ) WHERE T IS NOT NULL | 6,323 | simple |
|
retails | What are the clerks of orders with line items shipped by mail? | clerk refers to o_clerk; shipped by mail refers to l_shipmode = 'MAIL' | SELECT T1.o_clerk FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T2.l_shipmode = 'MAIL' | 6,324 | simple |
chicago_crime | What is the beat and location description of the case JB112212? | case JB112212 refers to case_number = 'JB112212' | SELECT beat, location_description FROM Crime WHERE case_number = 'JB112212' | 6,325 | simple |
food_inspection_2 | Please list the full names of all the sanitarians who have inspected the facility Burbank. | full name refers to first_name, last_name; the facility Burbank refers to dba_name = 'Burbank' | SELECT DISTINCT T1.first_name, T1.last_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN establishment AS T3 ON T2.license_no = T3.license_no WHERE T3.dba_name = 'Burbank' AND T1.title = 'Sanitarian' | 6,326 | moderate |
codebase_comments | What is the time of sampling of the solution with the highest sampling time? Indicate the id number of the solution. | highest sampling time refers to max(SampledAt); id number of the solution refers to SolutionId; | SELECT DISTINCT SampledAt, SolutionId FROM Method WHERE SampledAt = ( SELECT MAX(SampledAt) FROM Method ) | 6,327 | simple |
superstore | What product category that Sam Craven ordered from the central and east superstore? | SELECT DISTINCT T3.Category FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` LEFT JOIN central_superstore AS T4 ON T3.`Product ID` = T4.`Product ID` WHERE T2.`Customer Name` = 'Sam Craven' | 6,328 | simple |
|
mondial_geo | What is the greatest length of the border between 2 independent countries? | SELECT MAX(T3.Length) FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country INNER JOIN borders AS T3 ON T3.Country1 = T2.Country WHERE T2.Independence IS NOT NULL | 6,329 | simple |
|
software_company | Of customers who provide other services, how many are from places where inhabitants are more than 20000? | OCCUPATION = 'Other-service'; inhabitants are more than 20000 refer to INHABITANTS_K > 20; | SELECT COUNT(T2.GEOID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.OCCUPATION = 'Other-service' AND T2.INHABITANTS_K > 20 | 6,330 | simple |
hockey | Among the players who won an award in the year 1983, how many of them play the position of goalie? | position of goalie refers to pos = 'G' | SELECT COUNT(playerID) FROM AwardsPlayers WHERE pos = 'G' AND year = 1983 | 6,331 | simple |
chicago_crime | Give the coordinate of the alleys where a crime was reported and an arrest was made. | coordinate refers to latitude, longitude; alley refers to location_description = 'ALLEY'; an arrest was made refers to arrest = 'TRUE' | SELECT latitude, longitude FROM Crime WHERE location_description = 'ALLEY' AND arrest = 'TRUE' GROUP BY latitude, longitude | 6,332 | simple |
computer_student | Among the faculty affiliated professor, how many professors teaches professional or master/undergraduate courses? | faculty affiliated professor refers to professor = 1 and hasPosition = 'Faculty_aff'; professional or master/undergraduate courses refers to courseLevel = 'Level_500' | SELECT COUNT(*) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T1.hasPosition = 'Faculty_aff' AND T1.professor = 1 AND T3.courseLevel = 'Level_500' | 6,333 | moderate |
talkingdata | Provide the total number of the male users that use OPPO as their phone brand. | male refers to gender = 'Male'; | SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'OPPO' AND T1.gender = 'M' | 6,334 | simple |
books | Calculate the percentage of the International shipping orders on 2022/11/10. | International shipping order refers to method_name = 'International'; orders on 2022/11/10 refers to order_date LIKE '2022-11-10%'; percentage = Divide (Sum(order_id where method_name = 'International'), Count(order_id)) * 100 | SELECT CAST(SUM(CASE WHEN T1.method_name = 'International' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM shipping_method AS T1 INNER JOIN cust_order AS T2 ON T1.method_id = T2.shipping_method_id WHERE T2.order_date LIKE '2022-11-10%' | 6,335 | moderate |
image_and_language | On image no. 20, identify the attribute ID that is composed of the highest number of objects. | image no. 20 refers to IMG_ID = 20; attribute ID refers to ATT_CLASS_ID; highest number of objects refers to max(count(ATT_CLASS_ID)) | SELECT ATT_CLASS_ID FROM IMG_OBJ_ATT WHERE IMG_ID = 20 GROUP BY ATT_CLASS_ID ORDER BY COUNT(ATT_CLASS_ID) DESC LIMIT 1 | 6,336 | simple |
shakespeare | What are the titles and genres of the one-act works of Shakespeare? | one-act works refers to count(Act) = 1; genre refers to GenreType
| SELECT DISTINCT T1.Title, T1.GenreType FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Act = 1 | 6,337 | simple |
movie_platform | Which film rated by user 59988436 that received 21 comments? | user 59988436 refers to user_id = 59988436; received 21 comments refers to critic_comments = 21; 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 T1.user_id = 59988436 AND T1.critic_comments = 21 | 6,338 | simple |
hockey | State the goalie who has the lowest percentage of goals against among all the shots against recorded. Name the players and season where he played. | goals against refers to GA; shots against refers to SA; lowest percentage of goals against among all the shots against refers to MIN(DIVIDE(GA,SA)*100) | SELECT T1.firstName, T1.lastName, T2.year FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE CAST(T2.GA AS REAL) / T2.SA IS NOT NULL ORDER BY CAST(T2.GA AS REAL) / T2.SA LIMIT 1 | 6,339 | moderate |
menu | What is the occasion for menu with ID 12463? | FALSE; | SELECT occasion FROM Menu WHERE id = 12463 | 6,340 | simple |
retail_world | How many products were ordered in the order with the highest freight? | highest freight refers to max(Freight) | SELECT COUNT(T2.ProductID) FROM Orders AS T1 INNER JOIN `Order Details` AS T2 ON T1.OrderID = T2.OrderID GROUP BY T2.ProductID ORDER BY COUNT(T1.Freight) DESC LIMIT 1 | 6,341 | simple |
sales | Calculate the total quantity of products with name starting with alphabet "c". | name starting with alphabet "c" refers to Name LIKE 'C%'; | SELECT SUM(T2.Quantity) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE SUBSTR(T1.Name, 1, 1) = 'C' | 6,342 | simple |
video_games | How many role-playing games are there? | role-playing game refers to genre_name = 'Role-Playing' | SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Role-Playing' | 6,343 | simple |
shipping | Who was the driver of truck no.3 on 2016/9/19? Tell the full name. | truck no. 3 refers to truck_id = 3; on 2016/9/19 refers to ship_date = '2016-09-19'; full name refers to first_name, last_name | SELECT T3.first_name, T3.last_name 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 T1.truck_id = '3' AND T2.ship_date = '2016-09-19' | 6,344 | moderate |
car_retails | How many checks were issued by Euro+ Shopping Channel in the year 2004? | Euro+ Shopping Channel is a customer name; year(paymentDate) = '2004'; | SELECT COUNT(T1.checkNumber) FROM payments AS T1 INNER JOIN customers AS T2 ON T1.customerNumber = T2.customerNumber WHERE customerName = 'Euro+ Shopping Channel' AND STRFTIME('%Y', T1.paymentDate) = '2004' | 6,345 | simple |
olympics | What is the average age of Argentina's athletes who participated in the Summer Olympics in 2012? | AVG(age) where games_name = '2012 Summer' and region_name = 'Argentina'; | SELECT AVG(T2.age) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person_region AS T3 ON T2.person_id = T3.person_id INNER JOIN noc_region AS T4 ON T3.region_id = T4.id WHERE T1.games_name = '2012 Summer' AND T4.region_name = 'Argentina' | 6,346 | simple |
books | How many books were published by publisher "Thomas Nelson"? | "Thomas Nelson" is the publisher_name | SELECT COUNT(*) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Thomas Nelson' | 6,347 | simple |
mondial_geo | In which province is the highest volcano mountain located in? | SELECT T1.Province FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country INNER JOIN mountain AS T3 ON T3.Name = T2.Mountain WHERE T3.Type = 'volcano' ORDER BY T3.Height DESC LIMIT 1 | 6,348 | simple |
|
book_publishing_company | For the quantities, what percent more did the store in Fremont sell than the store in Portland in 1993? | qty is abbreviation for quantity; Fremont and Portland are name of city; sell in 1993 refers to YEAR(ord_date) = 1993; percentage = DIVIDE(
SUBTRACT(SUM(qty where city = ‘Fremont’ and year(ord_date = 1993)),
SUM(qty where city = ‘Portland’ and year(ord_date = 1993))), SUM(qty where city = ‘Fremont’ and year(ord_date = 1993)) *100 | SELECT CAST(SUM(CASE WHEN T2.city = 'Fremont' THEN qty END) - SUM(CASE WHEN T2.city = 'Portland' THEN qty END) AS REAL) * 100 / SUM(CASE WHEN T2.city = 'Fremont' THEN qty END) FROM sales AS T1 INNER JOIN stores AS T2 ON T1.stor_id = T2.stor_id WHERE STRFTIME('%Y', T1.ord_date) = '1993' | 6,349 | challenging |
language_corpus | What are the word pairs that occured only twice? | word pair refers to w1st.word w2nd.word; occured only twice refers to occurrences = 2 | SELECT T1.word, T3.word FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st INNER JOIN words AS T3 ON T3.wid = T2.w2nd WHERE T2.occurrences = 2 | 6,350 | simple |
public_review_platform | Within the user who joined Yelp in 2004, explore the user ID with average star of 5 and it's review length on the business. | user who joined Yelp in 2004 refers to user_id where user_yelping_since_year = 2014; user_average_stars = 5; | SELECT T2.user_id, T2.review_length FROM Users AS T1 INNER JOIN Reviews AS T2 ON T1.user_id = T2.user_id WHERE T1.user_yelping_since_year = 2004 AND T1.user_average_stars = 5 | 6,351 | moderate |
legislator | Please list the official full names of all the current legislators who were once a senator during his or her terms. | once a senator during term refers to state_rank IS NOT NULL | SELECT T2.official_full_name FROM `current-terms` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T1.state_rank IS NOT NULL | 6,352 | simple |
sales | List down the first name of customers who placed order for product id 1. | SELECT T1.FirstName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T2.ProductID = 1 | 6,353 | simple |
|
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' | 6,354 | simple |
book_publishing_company | List the type of the book for the order which was sold on 1993/5/29. | sold on refers to ord_date | SELECT DISTINCT T1.type FROM titles AS T1 INNER JOIN sales AS T2 ON T1.title_id = T2.title_id WHERE STRFTIME('%Y-%m-%d', T2.ord_date) = '1993-05-29' | 6,355 | moderate |
social_media | What is the gender of the user who has posted the tweet that got the most likes? | tweet got the most likes refers to Max(Likes) | SELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID ORDER BY T1.Likes DESC LIMIT 1 | 6,356 | simple |
regional_sales | How many online orders were shipped during the month of June 2018? | online orders refers to Sales Channel = 'Online'; shipped during the month of June 2018 refers to SUBSTR(ShipDate, 1, 1) = '6' AND SUBSTR(ShipDate,-2) = '18' | SELECT SUM(IIF(ShipDate LIKE '6/%/18' AND `Sales Channel` = 'Online', 1, 0)) FROM `Sales Orders` | 6,357 | simple |
mental_health_survey | How many users participated in the mental health survey for 2014? | mental health survey for 2014 refers to SurveyID = 2014 | SELECT COUNT(DISTINCT T1.UserID) FROM Answer AS T1 INNER JOIN Survey AS T2 ON T1.SurveyID = T2.SurveyID WHERE T2.Description = 'mental health survey for 2014' | 6,358 | simple |
works_cycles | Please list the names of all the store contact employees whose credit cards expired in 2007. | year of credit card expiration refers to ExpYear; ExpYear = 2007; store contact refers to PersonType = 'SC'; | SELECT T1.FirstName, T1.LastName 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 T3.ExpYear = 2007 AND T1.PersonType = 'SC' | 6,359 | moderate |
beer_factory | What is the percentage difference of River City sale compare to Frostie? | percentage difference = (DIVIDE(MULTIPLY(SUBTRACT(SUM(PurchasePrice WHERE BrandName = 'River City'), SUM(PurchasePrice WHERE BrandName = 'Frostie')), 100), SUM(PurchasePrice WHERE BrandName = 'Frostie'))); River City refers to BrandName = 'River City'; Frostie refers to BrandName = 'Frostie'; | SELECT CAST((SUM(CASE WHEN T3.BrandName = 'River City' THEN T2.PurchasePrice ELSE 0 END) - SUM(CASE WHEN T3.BrandName = 'Frostie' THEN T2.PurchasePrice ELSE 0 END)) AS REAL) * 100 / SUM(CASE WHEN T3.BrandName = 'Frostie' THEN T2.PurchasePrice ELSE 0 END) FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID | 6,360 | challenging |
mondial_geo | State the area and population of the country where Asia Pacific Economic Cooperation headquarter is located. | Asia Pacific Economic Cooperation is an organization name | SELECT T2.Name, T2.Population FROM organization AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T1.Name = 'Asia Pacific Economic Cooperation' | 6,361 | simple |
soccer_2016 | How many of the matches are Superover? | are Superover refers to win_type = 'wickets'; | SELECT SUM(CASE WHEN T2.win_type = 'wickets' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id | 6,362 | simple |
food_inspection_2 | What are the inspection results for Xando Coffee & Bar / Cosi Sandwich Bar? | Xando Coffee & Bar / Cosi Sandwich Bar refers to dba_name = 'XANDO COFFEE & BAR / COSI SANDWICH BAR' | SELECT DISTINCT T2.results FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.dba_name = 'XANDO COFFEE & BAR / COSI SANDWICH BAR' | 6,363 | simple |
codebase_comments | What format does the method number 8's comment have? | format refers CommentIsXml; method number refers to Method_100k.Id; Method_100k.Id = 8; | SELECT CASE WHEN CommentIsXml = 0 THEN 'isNotXMLFormat' WHEN CommentIsXml = 1 THEN 'isXMLFormat' END format FROM Method WHERE Id = 8 | 6,364 | simple |
works_cycles | What is the name of the product the work order "2540" was making? | SELECT T2.Name FROM WorkOrder AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.WorkOrderID = 2540 | 6,365 | simple |
|
airline | Please list any three airports with their codes. | SELECT Code, Description FROM Airports LIMIT 3 | 6,366 | simple |
|
address | Describe the number of postal points and the countries in West Virginia. | postal points refer to zip_code; West Virginia is the name of the state, in which name = 'West Virginia'; | SELECT COUNT(DISTINCT T2.zip_code), COUNT(DISTINCT T2.county) FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'West Virginia' | 6,367 | simple |
world_development_indicators | In which years does the country whose Alpha2Code is 1A have a result of the indicator Adolescent fertility rate? | indicator Adolescent fertility rate refers to IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)'
| SELECT T2.Year FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' | 6,368 | simple |
chicago_crime | How many incidents are considered "severe" in the IUCR classification? | severe refers to index_code = 'I'; incidents refers to iucr_no | SELECT COUNT(*) FROM IUCR WHERE index_code = 'I' | 6,369 | simple |
address | Which state is Outagamie County in? Give the full name of the state. | "OUTAGAMIE" is the county | SELECT DISTINCT T2.name FROM country AS T1 INNER JOIN state AS T2 ON T1.state = T2.abbreviation WHERE T1.county = 'OUTAGAMIE' | 6,370 | simple |
student_loan | How many unemployed students have never been absent? | never been absent refers to month = 0; | SELECT COUNT(T2.name) FROM longest_absense_from_school AS T1 INNER JOIN unemployed AS T2 ON T2.name = T1.name WHERE T1.month = 0 | 6,371 | simple |
food_inspection_2 | What is the employee's last name at 7211 S Hermitage Ave, Chicago, IL? | 7211 S Hermitage Ave refers to address = '7211 S Hermitage Ave'; Chicago refers to city = 'Chicago'; IL refers to state = 'IL' | SELECT last_name FROM employee WHERE address = '7211 S Hermitage Ave' AND city = 'Chicago' AND state = 'IL' | 6,372 | simple |
sales | What are the full names of the top 3 employees who handled the highest number of sales? | full names of employees = FirstName, MiddleInitital, LastName; highest number of sales refers to MAX(COUNT(SalesID)); | SELECT T1.FirstName, T1.MiddleInitial, T1.LastName FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID GROUP BY T2.SalesPersonID, T1.FirstName, T1.MiddleInitial, T1.LastName ORDER BY COUNT(T2.SalesID) DESC LIMIT 3 | 6,373 | moderate |
image_and_language | List all the attribute classes of image ID 22. | attribute classes of image ID 22 refer to ATT_CLASS where MG_ID = 22; | SELECT T1.ATT_CLASS FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T2.IMG_ID = 22 | 6,374 | simple |
law_episode | Who is the youngest person to ever play a "clerk" role in the series? | who refers to name; the youngest person refers to max(birthdate); a "clerk" role refers to role = 'Clerk' | SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.role = 'Clerk' AND T2.birthdate IS NOT NULL ORDER BY T2.birthdate LIMIT 1 | 6,375 | simple |
airline | Please list the departure airports of the flights on 2018/8/1 that were delayed. | departure airports refers ORIGIN; on 2018/8/1 refers to FL_DATE = '2018/8/1'; delayed refers to DEP_DELAY > 0; | SELECT T1.Description FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE = '2018/8/1' AND T2.DEP_DELAY > 0 GROUP BY T1.Description | 6,376 | simple |
social_media | From which country is the tweet with the most likes posted? | tweet with the most likes refers to Max(Likes) | SELECT T2.Country FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID ORDER BY T1.Likes DESC LIMIT 1 | 6,377 | simple |
simpson_episodes | Out of the rating of 6.8 scored by title "No Loan Again, Naturally", how many percent of it consists of scores 5 to 10? | scores 5 to 10 refers to TOTAL(percent) where 1 < = stars < 5 | SELECT SUM(T2.percent) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'No Loan Again, Naturally' AND T1.rating = 6.8 AND T2.stars BETWEEN 5 AND 10; | 6,378 | moderate |
disney | What are the total grosses for the movies with Jim Cummings as the voice actor? | FALSE; | SELECT T2.movie_title FROM `voice-actors` AS T1 INNER JOIN movies_total_gross AS T2 ON T2.movie_title = T1.movie WHERE T1.`voice-actor` = 'Jim Cummings' ORDER BY CAST(REPLACE(trim(T2.total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1 | 6,379 | moderate |
regional_sales | What is the unit cost of order SO - 000103? | OrderNumber = 'SO - 000103'; | SELECT DISTINCT T FROM ( SELECT IIF(OrderNumber = 'SO - 000103', `Unit Cost`, NULL) AS T FROM `Sales Orders` ) WHERE T IS NOT NULL | 6,380 | simple |
retail_complains | What is the percentage of male clients complaining about their credit cards? | percentage = MULTIPLY(DIVIDE(SUM(sex = 'Male'), COUNT(client_id)), 1.0); male refers to sex = 'Male'; credit cards refers to Product = 'Credit card'; | SELECT CAST(SUM(CASE WHEN T1.sex = 'Male' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.sex) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Product = 'Credit card' | 6,381 | simple |
sales_in_weather | Give the average temperature of station no.20 on 2014/10/17. | station no.20 refers to station_nbr = 20; on 2014/10/17 refers to date = '2014-10-17'; average temperature refers to tavg | SELECT tavg FROM weather WHERE `date` = '2014-10-17' AND station_nbr = 20 | 6,382 | simple |
simpson_episodes | What are the titles of the episodes that have received more 7-star votes than the season average? | episodes that have received more 7-star votes than the season average refers to votes > DIVIDE(SUM(votes), COUNT(stars = 7)) | SELECT DISTINCT T1.episode_id FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 7 AND T2.votes > 0.7 * ( SELECT CAST(COUNT(votes) AS REAL) / COUNT(CASE WHEN stars = 7 THEN 1 ELSE 0 END) FROM Vote ); | 6,383 | challenging |
language_corpus | What percentage of Catalan-language Wikipedia pages have more than 10,000 words? | Catalan-language refers to lang = 'ca'; more than 10,000 words refer to words > 10000; DIVIDE(COUNT(pages WHERE words > 10000 and lang = 'ca'), COUNT(pages WHERE lang = 'ca')) as percentage; | SELECT CAST(COUNT(CASE WHEN T2.words > 10000 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.page) FROM langs AS T1 INNER JOIN pages AS T2 ON T1.lid = T2.lid WHERE T1.lang = 'ca' | 6,384 | moderate |
mondial_geo | Which nation has the smallest population, and where is its capital located? | SELECT Name, Capital FROM country ORDER BY Population ASC LIMIT 1 | 6,385 | simple |
|
airline | Among the airports whose destination is Logan International, what is the airline id of the carrier operator with the highest delay in minutes due to security? | destination refers to DEST; Logan International refers to Description = 'Boston, MA: Logan International'; airline id of the carrier operator refers to OP_CARRIER_AIRLINE_ID; highest delay in minutes due to security refers to MAX(SECURITY_DELAY); | SELECT T2.OP_CARRIER_AIRLINE_ID FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T1.Description = 'Boston, MA: Logan International' AND T2.DEST = 'BOS' ORDER BY T2.SECURITY_DELAY DESC LIMIT 1 | 6,386 | moderate |
video_games | List the genre id of the game Pro Evolution Soccer 2012. | Pro Evolution Soccer 2012 refers to game_name = 'Pro Evolution Soccer 2012' | SELECT T.genre_id FROM game AS T WHERE T.game_name = 'Pro Evolution Soccer 2012' | 6,387 | simple |
software_company | Which customer come from a place with more inhabitants, customer no.0 or customer no.1? | place with more inhabitants refers to GEOID where ID = 0 OR ID = 1 and MAX(NHABITANTS_K); | SELECT T1.ID FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.ID = 0 OR T1.ID = 1 ORDER BY INHABITANTS_K DESC LIMIT 1 | 6,388 | simple |
works_cycles | What percentage of male employees hired throughout the years 2009 are married? | male refers to Gender = 'M'; hired throughout the years 2009 refers to Year(HireDate) = 2009; married refers to MaritalStatus = 'M'; percentage = DIVIDE(count(BusinessEntityID(Gender = 'M'& Year(HireDate) = '2009& MaritalStatus = 'M')), count(BusinessEntityID(Gender = 'M'& Year(HireDate) = 2009)))
| SELECT CAST(SUM(CASE WHEN MaritalStatus = 'M' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(BusinessEntityID) FROM Employee WHERE SUBSTR(HireDate, 1, 4) = '2009' AND Gender = 'M' | 6,389 | simple |
address | What is the area code of Bishopville, SC? | "Bishopville" is the city; 'SC' is the state | SELECT T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Bishopville' AND T2.state = 'SC' | 6,390 | simple |
movie_platform | How many critics of the movie "Imitation of Life" got more than 1 like? | Imitation of Life refers to movie_title; critics got more than 1 like refers to critic_likes >1; | SELECT COUNT(*) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'Imitation of Life' AND T1.critic_likes > 1 | 6,391 | simple |
olympics | How many games has Prithipal Singh participated in? | games refer to games_id; | SELECT COUNT(T2.games_id) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T1.full_name = 'Prithipal Singh' | 6,392 | simple |
music_platform_2 | What is the average rating of all the podcasts with reviews created in 2019? | created in 2019 refers to created_at BETWEEN '2019-01-01T00:00:00' and '2019-12-31T23:59:59'; average rating = Divide (Sum(rating), Count(podcast_id)) | SELECT AVG(rating) FROM reviews WHERE created_at BETWEEN '2019-01-01T00:00:00-07:00' AND '2019-12-31T23:59:59-07:00' | 6,393 | simple |
donor | Which school requested the highest amount of resources from Amazon? State the school's ID. | highest amount of resources refers to max(count(schoolid)); Amazon refers to vendor_name = 'Amazon' | SELECT T2.schoolid FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.vendor_name LIKE 'Amazon' GROUP BY T2.schoolid ORDER BY COUNT(T1.vendor_name) DESC LIMIT 1 | 6,394 | simple |
talkingdata | What are the behavior categories that user number -9222198347540750000 belongs to? | behavior categories refers to category; user number refers to app_id; app_id = -9222198347540750000; | SELECT T3.category FROM app_all AS T1 INNER JOIN app_labels AS T2 ON T1.app_id = T2.app_id INNER JOIN label_categories AS T3 ON T2.label_id = T3.label_id WHERE T1.app_id = -9222198347540750000 | 6,395 | simple |
public_review_platform | What is the review length of user 60776 to business with business ID 1? | "60776" is the user_id | SELECT review_length FROM Reviews WHERE user_id = 60776 AND business_id = 1 | 6,396 | simple |
ice_hockey_draft | Name the player and his team who made the playoffs in the 2006-2007 season of SuperElit league with the highest points. | name of the player refers to PlayerName; playoffs refers to GAMETYPE = 'Playoffs'; highest points refers to MAX(P); 2006-2007 season refers to SEASON = '2006-2007'; SuperElit league refers to LEAGUE = 'SuperElit'; | SELECT T2.PlayerName, T1.TEAM FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2006-2007' AND T1.GAMETYPE = 'Playoffs' AND T1.LEAGUE = 'SuperElit' ORDER BY T1.P DESC LIMIT 1 | 6,397 | moderate |
movielens | What is the total amount male and female actors who were casted in movie ID 1684910 and what is the proportion between the highest quality actors against the worst quality of actors? Indicate your answer in percentage. List the the director as well as the genre. | Female actors mean that a_gender = 'F'; Male actors mean that a_gender = 'M'; a_quality = 5 refers to act the best, a_quality = 0 refers to act the worst | SELECT SUM(IIF(a_gender = 'M', 1, 0)) , SUM(IIF(a_gender = 'F', 1, 0)) , CAST(SUM(IIF(a_quality = 5, 1, 0)) AS REAL) * 100 / COUNT(*) , CAST(SUM(IIF(a_quality = 0, 1, 0)) AS REAL) * 100 / COUNT(*), ( SELECT directorid FROM movies2directors WHERE movieid = 1684910 ) , ( SELECT genre FROM movies2directors WHERE movieid = 1684910 ) FROM actors WHERE actorid IN ( SELECT actorid FROM movies2actors WHERE movieid = 1684910 ) | 6,398 | challenging |
regional_sales | What is the least purchased product by stores in the city of Santa Clarita? | least purchased product refers to Min(Count(Product Name)); 'Santa Clarita' is the City | SELECT T1.`Product Name` FROM Products AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._ProductID = T1.ProductID INNER JOIN `Store Locations` AS T3 ON T3.StoreID = T2._StoreID WHERE T3.`City Name` = 'Santa Clarita' GROUP BY T1.`Product Name` ORDER BY COUNT(T1.`Product Name`) ASC LIMIT 1 | 6,399 | moderate |
Subsets and Splits