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 |
---|---|---|---|---|---|
disney | List all the voice actors in the movie directed by Ben Sharpsteen which was released on February 9, 1940. | Ben Sharpsteen refers to director = 'Ben Sharpsteen'; released on February 9, 1940 refers to release_date = 'Feb 9, 1940'; | SELECT T2.`voice-actor` FROM director AS T1 INNER JOIN `voice-actors` AS T2 INNER JOIN movies_total_gross AS T3 ON T1.name = T2.movie AND T2.movie = T3.movie_title WHERE T1.director = 'Ben Sharpsteen' AND T3.release_date = 'Feb 9, 1940' AND T2.`voice-actor` != 'None' GROUP BY T2.`voice-actor` | 6,000 | challenging |
law_episode | What role was Julia Roberts nominated for? | nominated refers to result = 'Nominee' | SELECT T2.role FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.Result = 'Nominee' AND T1.name = 'Julia Roberts' | 6,001 | simple |
book_publishing_company | Name the title with the highest price published by 'Binnet & Hardley'. | published by refers to pub_name | SELECT T1.title FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.pub_name = 'Binnet & Hardley' ORDER BY T1.price DESC LIMIT 1 | 6,002 | simple |
car_retails | Please list the order number of the customer whose credit card has a limit of 45300. | Credit card does not have a limit refers to creditLimit = 45300; | SELECT t1.orderNumber FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.creditLimit = 45300 | 6,003 | simple |
world | Describe the capital city and languages used in the country with the shortest life expectancy. | capital city refers to Capital; shortest life expectancy refers to MIN(LifeExpectancy); | SELECT T1.Capital, T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode INNER JOIN City AS T3 ON T1.Code = T3.CountryCode ORDER BY T1.LifeExpectancy LIMIT 1 | 6,004 | simple |
public_review_platform | Please indicate the opening day of businesses whose category is pets. | category is pets refers to category_name = 'Pets'; opening day refers to day_id from Business_Hours and opening_time; | SELECT DISTINCT T4.day_of_week FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business_Hours AS T3 ON T1.business_id = T3.business_id INNER JOIN Days AS T4 ON T3.day_id = T4.day_id WHERE T2.category_name = 'Pets' | 6,005 | simple |
synthea | Give the number of claims did Ms. Abbie Cole have in the year of 2011. | in the year of 2011 refers to BILLABLEPERIOD between '2010-12-31' and '2012-01-01'; | SELECT COUNT(T2.BILLABLEPERIOD) FROM patients AS T1 INNER JOIN claims AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Ms.' AND T1.first = 'Abbie' AND T1.last = 'Cole' AND T2.BILLABLEPERIOD BETWEEN '2010-12-31' AND '2012-01-01' | 6,006 | moderate |
mondial_geo | Calculate the percentage of country which gained independence as republic after 1970. | SELECT CAST(SUM(CASE WHEN Government = 'republic' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Country) FROM politics WHERE STRFTIME('%Y', Independence) > '1970' | 6,007 | simple |
|
bike_share_1 | What are the average maximum and minimum temperatures in May 2015 when the mean humidity is between 65 and 75? | average maximum temperature = DIVIDE(SUM(max_temperature_f), COUNT(date)); average minimum temperature = DIVIDE(SUM(min_temperature_f), COUNT(date)); May 2015 refers to date BETWEEN '5/1/2015'AND '5/31/2015'; | SELECT AVG(max_temperature_f), AVG(min_temperature_f) FROM weather WHERE date LIKE '5/%/2015' AND mean_humidity BETWEEN 65 AND 75 | 6,008 | simple |
public_review_platform | Which business ID has the most reviews? | the most reviews refer to MAX(user_id); | SELECT business_id FROM Reviews GROUP BY business_id ORDER BY COUNT(user_id) DESC LIMIT 1 | 6,009 | simple |
donor | Which project have the highest total price including optional support? Indicate the project id. | highest total price including optional support refers to max(total_price_including_optional_support) | SELECT projectid FROM projects ORDER BY total_price_including_optional_support DESC LIMIT 1 | 6,010 | simple |
address | What is the area code of Phillips county in Montana? | "PHILLIPS" is the county; 'Montana' is the name of state | SELECT DISTINCT T1.area_code FROM area_code AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code INNER JOIN state AS T3 ON T2.state = T3.abbreviation WHERE T2.county = 'PHILLIPS' AND T3.name = 'Montana' | 6,011 | simple |
mondial_geo | How many organizations are established in countries where people speak Bosnian? | Bosnian is one of language | SELECT COUNT(T2.Name) FROM language AS T1 INNER JOIN organization AS T2 ON T1.Country = T2.Country WHERE T1.Name = 'Bosnian' | 6,012 | simple |
talkingdata | What are the label IDs and app IDs of the Chinese Classical Mythology category? | SELECT T1.label_id, T2.app_id FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'Chinese Classical Mythology' | 6,013 | simple |
|
movie_platform | How many films were released in 2007? | film released in 2007 refers to movie_release_year = 2007; film refers to movie | SELECT COUNT(*) FROM movies WHERE movie_release_year = 2007 | 6,014 | simple |
movie_3 | Among the classic movies, how many movies have a rental rate of less than 1? | classic movie refers to name = 'Classics'; rental rate of less than 1 refers to rental_rate < 1; movie refers to film_id | SELECT COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T3.rental_rate < 1 AND T2.name = 'Classics' | 6,015 | simple |
regional_sales | What is the type of store located in the city with the highest amount of water area? | type of store in City refers to Type = 'City'; highest amount of water area refers to Max(Water Area) | SELECT CASE WHEN MAX(`Water Area`) THEN Type END FROM `Store Locations` | 6,016 | simple |
authors | Identify by publication year in the paper database all journals that don't have short name. | don't have short name refers to ShortName is NULL OR ShortName = '' | SELECT DISTINCT T2.Year, FullName FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.ShortName = '' | 6,017 | simple |
address | Name the country with the largest number of households in a residential area. | the largest number of households refers to MAX(households); | SELECT T1.county FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code GROUP BY T1.county ORDER BY T2.households DESC LIMIT 1 | 6,018 | simple |
public_review_platform | Based on all user compliments, find the percentage of low number of compliments on all compliments ID. | low number of compliments refers to number_of_compliments = 'Low'; percentage refers to DIVIDE(COUNT(number_of_compliments = 'Low'), COUNT(user_id)) * 100 | SELECT CAST(SUM(CASE WHEN number_of_compliments = 'Low' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(user_id) FROM Users_compliments | 6,019 | simple |
sales_in_weather | How many units of item 7 have been sold by store 7 when the snow is less than 5 inches? | item 7 refers to item_nbr = 7; store 7 refers to store_nbr = 7; snow is less than 5 inches refers to snowfall < 5 | SELECT SUM(units) FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr INNER JOIN sales_in_weather AS T3 ON T2.store_nbr = T3.store_nbr WHERE T2.store_nbr = 7 AND T3.item_nbr = 7 AND T1.snowfall < 5 | 6,020 | moderate |
coinmarketcap | When is Devcoin most valuable in the market? | when refers to date; most valuable refers to max(market_cap) | SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Devcoin' ORDER BY T2.market_cap DESC LIMIT 1 | 6,021 | simple |
european_football_1 | How many matches played in the 2019 season of Scottish Championship league were ended with an equal result of 2-2? | matches refer to Div; Scottish Championship is a name of the league; equal result of 2-2 refers to FTAG = 2 AND FTHG = 2; | SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2019 AND T2.name = 'Scottish Championship' AND T1.FTAG = 2 AND T1.FTHG = 2 | 6,022 | moderate |
public_review_platform | Among the businesses with a category of Food, what is the percentage of the business with greater than 3 stars? | category of food refers to category_name = 'Food'; calculation = DIVIDE(COUNT(stars > 3), SUM(stars)) | SELECT CAST(SUM(CASE WHEN T1.stars > 3 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.stars) FROM Business AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id WHERE T3.category_name = 'Food' | 6,023 | moderate |
movies_4 | Provide the genre ID of the movie with the title of "The Dark Knight". | movie with the title of "The Dark Knight" refers to title = 'The Dark Knight' | SELECT T2.genre_id FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'The Dark Knight' | 6,024 | simple |
shipping | How many shipments were shipped to the least populated city in California? | "California" is the state; least populated city refers to Min(population) | SELECT COUNT(T3.city_name) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id WHERE T3.state = 'California' ORDER BY T3.population ASC LIMIT 1 | 6,025 | simple |
donor | What is the total donation amount made for projects whose main subject area are Literacy & Language? | main subject area refers to primary_focus_area = 'Literacy & Language'; total donation amount refers to Sum(dollar_amount); | SELECT SUM(T2.dollar_amount) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.primary_focus_area = 'Literacy & Language' | 6,026 | simple |
sales | What is the name of the sales person who handled the highest number of sales? | name of the sales person = FirstName, MiddleInitial, 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 T2.SalesPersonID = T1.EmployeeID GROUP BY T2.SalesPersonID, T1.FirstName, T1.MiddleInitial, T1.LastName ORDER BY COUNT(T2.SalesID) DESC LIMIT 1 | 6,027 | moderate |
mondial_geo | List all the cities and provinces located at the rivers that flows to Atlantic Ocean. | Atlantic Ocean is the second-largest ocean on Earth, after the Pacific Ocean; Ocean and sea share the same meaning | SELECT T1.Name, T1.Province FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T3.Sea = 'Atlantic Ocean' | 6,028 | simple |
retail_world | How many products supplied by Plutzer Lebensmittelgromrkte AG that is currently out of stock and on order? | Plutzer Lebensmittelgromrkte AG refers to CompanyName; is currently out of stock and on order refers to UnitsInStock = 0 and UnitsOnOrder > 0 | SELECT COUNT(T1.ProductID) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Plutzer Lebensmittelgromrkte AG' AND T1.UnitsInStock = 0 AND T1.UnitsOnOrder = 0 | 6,029 | moderate |
mondial_geo | Among all the rivers finally flows to the sea of 540m in depth, which one has the longest length? | SELECT T2.Name FROM sea AS T1 INNER JOIN river AS T2 ON T2.Sea = T1.Name WHERE T1.Depth = 540 ORDER BY T2.Length DESC LIMIT 1 | 6,030 | simple |
|
food_inspection_2 | Provide the first name of employee who did inspection ID 48225? | SELECT T1.first_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_id = 48225 | 6,031 | simple |
|
olympics | How many athletes from Malaysia have won a medal? | Malaysia refers to region_name = 'Malaysia'; athletes won a medal refer to competitor_id where medal_id <> 4; | SELECT COUNT(T3.person_id) FROM medal AS T1 INNER JOIN competitor_event AS T2 ON T1.id = T2.medal_id INNER JOIN games_competitor AS T3 ON T2.competitor_id = T3.id INNER JOIN person_region AS T4 ON T3.person_id = T4.person_id INNER JOIN noc_region AS T5 ON T4.region_id = T5.id WHERE T5.region_name = 'Malaysia' AND T1.id != 4 | 6,032 | simple |
donor | What is the average donation amount to a project created by a teacher working in a school in Brooklyn? | school in Brooklyn refers to school_city = 'Brooklyn'; Average = AVG(donation_total); | SELECT SUM(T2.donation_total) / COUNT(donationid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.school_city = 'Brooklyn' | 6,033 | simple |
public_review_platform | User No."63469" has got "1" like for a tip to the Yelp business, which city is that business located in? | user No. refers to user_id; | SELECT T1.city FROM Business AS T1 INNER JOIN Tips AS T2 ON T1.business_id = T2.business_id WHERE T2.likes = 1 AND T2.user_id = 63469 | 6,034 | simple |
cs_semester | List the student's email with grade of B in a course with difficulty greater than the 80% of average difficulty of all courses. | difficulty refers to diff; course with difficulty greater than the 80% of average difficulty refers to diff > MULTIPLY(AVG(diff), 80%); | SELECT T2.email FROM registration AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T1.course_id = T3.course_id WHERE T1.grade = 'B' GROUP BY T3.diff HAVING T3.diff > AVG(T3.diff) * 0.8 | 6,035 | moderate |
public_review_platform | How many users have "uber" number of fans? | uber number of fans refers to user_fans = 'uber'; | SELECT COUNT(user_id) FROM Users WHERE user_fans LIKE 'Uber' | 6,036 | simple |
donor | What is the name of the vendors serving material for projects for grades 9-12? | for grades 9-12 refers to grade_level = 'Grades 9-12' | SELECT DISTINCT T1.vendor_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.grade_level = 'Grades 9-12' | 6,037 | simple |
bike_share_1 | In 2006, how many trips ended at stations in Mountain View? | in 2006 refers to start_date LIKE'%2006%'; ended at station refers to end_station_name; Mountain View refers to city = 'Mountain View'; | SELECT COUNT(T2.city) FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.end_station_name WHERE T2.city = 'Mountain View' AND T1.start_date LIKE '%2006%' | 6,038 | simple |
world_development_indicators | Please list out all annual indicator names of Sudan in 1961? | Sudan is the name of the country; Periodicity = 'Annual'; Year = '1961' | SELECT T1.IndicatorName FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName WHERE T1.CountryName = 'Sudan' AND T1.Year = 1961 AND T2.Periodicity = 'Annual' | 6,039 | simple |
public_review_platform | Among the businesses with a category of Accessories, what is the percentage of the business with less than 4 stars? | category of Accessories refers to category_name = 'Accessories'; percentage of the business with less than 4 stars = divide(count(Business.business_id(stars < 4)), count(Business.business_id)) * 100% | SELECT CAST(SUM(CASE WHEN T1.stars < 4 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.stars) AS "percentage" FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T3.category_name LIKE 'Accessories' | 6,040 | challenging |
car_retails | Please calculate the average total price of orders from Exoto Designs Vendor in 2005. | average total price = DIVIDE(SUM(MULTIPLY(quantityOrdered, priceEach))), COUNT(orderNumber)); year(orderDate) = '2005'; | SELECT SUM(T2.quantityOrdered * T2.priceEach) / COUNT(T3.orderNumber) FROM products AS T1 INNER JOIN orderdetails AS T2 ON T1.productCode = T2.productCode INNER JOIN orders AS T3 ON T2.orderNumber = T3.orderNumber WHERE T1.productVendor = 'Exoto Designs' AND STRFTIME('%Y', T3.orderDate) = '2005' | 6,041 | moderate |
works_cycles | What type of transaction was made with the only yellow product, size 62 and with a minimum inventory stock of 500 units? | yellow product refers to Color = 'Yellow'; minimum inventory stock of 500 units refers to SafetyStockLevel = 500 | SELECT DISTINCT T2.TransactionType FROM Product AS T1 INNER JOIN TransactionHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Size = 62 AND T1.Color = 'Yellow' AND T1.SafetyStockLevel = 500 | 6,042 | moderate |
mondial_geo | Please provide a list of every volcano mountain in the province of Ecuador. | SELECT T1.Name FROM mountain AS T1 INNER JOIN geo_mountain AS T2 ON T1.Name = T2.Mountain INNER JOIN province AS T3 ON T3.Name = T2.Province WHERE T3.Name = 'Ecuador' AND T1.Type = 'volcano' | 6,043 | simple |
|
retail_world | What is the full name of the employee who handled the highest amount of orders? | full name refers to FirstName LastName; highest amount of orders refers to max(count(OrderID)) | SELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID GROUP BY T1.FirstName, T1.LastName ORDER BY COUNT(*) DESC LIMIT 1 | 6,044 | simple |
legislator | Among the legislators who started a term on 2nd December 1793, how many of them were males? | started a term on 2nd December 1793 refers to start = '1793-12-02'; male refers to gender_bio = 'M' | SELECT COUNT(T1.bioguide_id) FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'M' AND T2.start = '1793-12-02' | 6,045 | simple |
address | In the state where Lisa Murkowski is the representative, how many cities have zero employees? | zero employee refers to employees = 0 | SELECT COUNT(T3.city) FROM congress AS T1 INNER JOIN state AS T2 ON T1.abbreviation = T2.abbreviation INNER JOIN zip_data AS T3 ON T2.abbreviation = T3.state WHERE T1.first_name = 'Murkowski' AND T1.last_name = 'Lisa' AND T3.employees = 0 | 6,046 | simple |
books | What is the name of the publisher of the book "The Illuminati"? | "The Illuminati" is the title of the book; name of publisher refers to publisher_name | SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.title = 'The Illuminati' | 6,047 | simple |
simpson_episodes | Among the episodes aired on April of 2009, how many episodes won an award? | aired on refers to air_date, April refers to SUBSTR(air_date, 6, 2) = '04'; 2009 refers to SUBSTR (air_date, 0, 5) = '2009' | SELECT COUNT(T1.episode_id) FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.year, 1, 4) = '2009' AND T2.air_date LIKE '2009-04%'; | 6,048 | moderate |
works_cycles | What is the scrap reason for work order "57788"? | SELECT T2.Name FROM WorkOrder AS T1 INNER JOIN ScrapReason AS T2 ON T1.ScrapReasonID = T2.ScrapReasonID WHERE T1.WorkOrderID = 57788 | 6,049 | simple |
|
mondial_geo | In which city has the greatest population, what is its percentage to its country population? | SELECT T3.Name, CAST(T3.Population AS REAL) * 100 / T1.Population FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Country = T2.Country ORDER BY T3.Population DESC LIMIT 1 | 6,050 | simple |
|
bike_share_1 | Which city is Townsend at 7th Station located and how many bikes could it hold? | Townsend at 7th Station refers to city = 'Townsend at 7th Station'; number of bikes a station can hold refers to SUM(dock_count); | SELECT city, SUM(dock_count) FROM station WHERE name = 'Townsend at 7th' | 6,051 | simple |
retails | Provide the nation and region of the customer with the address of wH55UnX7 VI? | nation refers to n_name; region refers to r_name; address of wH55UnX7 VI refers to c_address = 'wH55UnX7 VI'; | SELECT T1.n_name, T3.r_name FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN region AS T3 ON T1.n_regionkey = T3.r_regionkey WHERE T2.c_address = 'wH55UnX7 VI' | 6,052 | simple |
public_review_platform | List all the businesses that closed at 8PM. | closed at 8PM refers to closing_time = '8PM'; | SELECT DISTINCT business_id FROM Business_Hours WHERE closing_time = '8PM' | 6,053 | simple |
mondial_geo | Which company falls under the category of an associated member? Please provide the organization's full name. | SELECT NAME FROM organization WHERE country IN ( SELECT country FROM politics WHERE dependent != '' ) | 6,054 | simple |
|
cars | Among the car models introduced in the market in 1970, how many of them have the USA as their origin country? | introduced in the market in 1970 refers to model_year = 1970; have the USA as origin country refers to country = 'USA' | SELECT COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T1.model_year = 1970 AND T2.country = 'USA' | 6,055 | simple |
hockey | What were the penalty minutes in 1923's Stanley Cup finals of the team that ranked second in that year? | teams refer to tmID; year = 1922; ranked second refers to rank = 2; penalty minutes refer to PIM; | SELECT T1.PIM FROM TeamsSC AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = '1923' AND T2.rank = 2 | 6,056 | simple |
computer_student | What is the average number of courses taught by a professor? | professor refers to professor = 1; average number of courses = divide(count(taughtBy.course_id), count(taughtBy.p_id) where professor = 1 ) | SELECT CAST(COUNT(T1.course_id) AS REAL) / COUNT(DISTINCT T2.p_id) AS num FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.professor = 1 | 6,057 | simple |
shipping | How many customers are manufacturer? | "manufacturer" is the cust_type | SELECT COUNT(*) FROM customer WHERE cust_type = 'manufacturer' | 6,058 | simple |
books | Which city does the address id 547 belong to? | SELECT city FROM address WHERE address_id = 547 | 6,059 | simple |
|
movie_3 | What is the description and film title of ID 996? | ID 996 refers to film_id = 996 | SELECT description, title FROM film_text WHERE film_id = 996 | 6,060 | simple |
european_football_1 | Which 2 Scottish teams scored 10 goals playing as a local team and in which seasons? | local team refers to HomeTeam; Scottish means belong to the country = 'Scotland'; scored 10 goals refer to FTHG = 10, which is short name for Final-time Away-team Goals; | SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.country = 'Scotland' AND T1.FTHG = 10 | 6,061 | simple |
shipping | Identify the full name of the driver who delivered a shipment to the city of New York in February 2016. | "New York" is the city_name; in February 2016 refers to ship_date LIKE '2016-02%'; full 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 WHERE T2.city_name = 'New York' AND T1.ship_date LIKE '2016-02%' | 6,062 | moderate |
shipping | Who is the driver that transported the lightest weight of shipment? Provide the full name of the driver. | lightest weight refers to Min(weight); full name refers to first_name, last_name | SELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id ORDER BY T1.weight ASC LIMIT 1 | 6,063 | simple |
student_loan | List at least 10 students who have no payment due and are enlisted in Fire Department organization. | no payment due refers to bool = 'neg'; organization refers to organ; organ = 'fire_department'; | SELECT T1.name FROM no_payment_due AS T1 INNER JOIN enlist AS T2 ON T2.name = T1.name WHERE T1.bool = 'neg' AND T2.organ = 'fire_department' LIMIT 10 | 6,064 | simple |
mondial_geo | For island area less than 200, list the island name and city it belongs to. | SELECT DISTINCT T3.Name, T1.Name FROM city AS T1 INNER JOIN locatedOn AS T2 ON T1.Name = T2.City INNER JOIN island AS T3 ON T3.Name = T2.Island WHERE T3.Area < 200 | 6,065 | simple |
|
works_cycles | How many Vista cards expired before the year 2007? | Vista Card refers to CardType = 'Vista'; expire before the year 2007 refers to ExpYear< = 2006;
| SELECT COUNT(CreditCardID) FROM CreditCard WHERE CardType = 'Vista' AND ExpYear < 2007 | 6,066 | simple |
menu | How many dishes have appeared on the menu in less than 5 years? | appeared on the menu in less than 5 years = SUBTRACT(last_appeared, first_appeared) < 5; | SELECT COUNT(*) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.last_appeared - T1.first_appeared < 5 | 6,067 | simple |
mental_health_survey | How many questions in 2014's survey had more than 200 answers? | 2014 refer to SurveyID; COUNT(QuestionID) where COUNT(AnswerText) > 200 | SELECT COUNT(QuestionID) FROM Answer WHERE SurveyID LIKE 2014 GROUP BY QuestionID ORDER BY COUNT(QuestionID) > 200 LIMIT 1 | 6,068 | simple |
mondial_geo | What is the maximal elevation of the summit of the shortest mountain that can be found in the island of Madagaskar? Indicate what type of mountain it is. | The elevation of the summit refers to height | SELECT T3.Height, T3.Type FROM island AS T1 INNER JOIN mountainOnIsland AS T2 ON T1.Name = T2.Island INNER JOIN mountain AS T3 ON T3.Name = T2.Mountain WHERE T1.Name = 'Madagaskar' ORDER BY T3.Height DESC LIMIT 1 | 6,069 | moderate |
legislator | Please list the current official YouTube usernames of all the current female legislators. | official YouTube usernames refers to youtube; female refers to gender_bio = 'F' | SELECT T2.youtube FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T1.gender_bio = 'F' | 6,070 | simple |
ice_hockey_draft | What is the percentage of Swedish players in playoffs games in the 1997 - 2000 season? | percentage = MULTIPLY(DIVIDE(SUM(nation = 'Sweden'), COUNT(ELITEID) WHERE SEASON = '1997-2000'), 100); Swedish refers to nation = 'Sweden'; players refers to PlayerName; playoffs games refers to GAMETYPE = 'Playoffs'; 1997-2000 season refers to 3 consecutive SEASONs : '1997-1998', '1998-1999', '1999-2000'; | SELECT DISTINCT CAST(COUNT(CASE WHEN T1.nation = 'Sweden' THEN T1.ELITEID ELSE NULL END) OVER (PARTITION BY T2.SEASON) AS REAL) * 100 / COUNT(T1.ELITEID) OVER (PARTITION BY T2.SEASON) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.SEASON IN ('1997-1998', '1998-1999', '1999-2000') | 6,071 | challenging |
retail_world | Indicate category name of soft drinks, coffees, teas, beers, and ales in description list. | Soft drinks, coffees, teas, beers, and ales' is Description of CategoryName | SELECT CategoryName FROM Categories WHERE Description = 'Soft drinks, coffees, teas, beers, and ales' | 6,072 | simple |
shakespeare | In the year 1500s, how many tragedies did Shakespeare write? | year 1500s refers to Date between 1500 and 1599; tragedies refers to GenreType = 'Tragedy' | SELECT COUNT(id) FROM works WHERE GenreType = 'Tragedy' AND Date BETWEEN 1500 AND 1599 | 6,073 | simple |
retail_world | What is the family name of the employee who shipped the order 10521 to CACTU? | order 10521 refers to OrderID = 10521; CustomerID = 'CACTU'; family name refers to LastName; | SELECT T1.LastName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.OrderID = 10521 AND T2.CustomerID = 'CACTU' | 6,074 | simple |
retail_world | Which region has the most territories? | region refers to RegionDescription; most territories refers to Max(Count(TerritoryID)) | SELECT T2.RegionID FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID GROUP BY T2.RegionID ORDER BY COUNT(T1.TerritoryID) DESC LIMIT 1 | 6,075 | simple |
video_games | Provide any five games and release year under the sports genre. | game refers to game_name; under the sports genre refers to genre_name = 'Sports' | SELECT T3.game_name, T1.release_year FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T4.genre_name = 'Sports' LIMIT 5 | 6,076 | moderate |
professional_basketball | Which team had more than one player who grabbed more than 600 rebounds in 2011? Give the full name of the team. | more than one player refers to count(playerID) > 1; grabbed more than 600 rebounds refers to rebounds > 600; in 2011 refers to 2011; full name refers to teams.name | SELECT T1.tmID FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 2011 AND T2.rebounds > 600 | 6,077 | simple |
superstore | Calculate the average sales of ""Sharp AL-1530CS Digital Copier in the east and the west superstore. | Sharp AL-1530CS Digital Copier' is the "Product Name"; average sales = AVG(Sales) | SELECT AVG(T1.Sales) FROM west_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` WHERE T3.`Product Name` = 'Sharp AL-1530CS Digital Copier' | 6,078 | moderate |
works_cycles | Among the companies to which Adventure Works Cycles purchases parts or other goods, what is the profit on net obtained from the vendor who has an above average credit rating? Kindly indicate each names of the vendor and the corresponding net profits. | above average credit rating refers to CreditRating = 3; profit on net = subtract(LastReceiptCost, StandardPrice); | SELECT T2.Name, T1.LastReceiptCost - T1.StandardPrice FROM ProductVendor AS T1 INNER JOIN Vendor AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.CreditRating = 3 | 6,079 | moderate |
synthea | How many conditions did Tyree Eichmann have? | conditions refer to DESCRIPTION from conditions; | SELECT COUNT(DISTINCT T2.DESCRIPTION) FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Tyree' AND T1.last = 'Eichmann' | 6,080 | simple |
public_review_platform | How many reviews of businesses that are still open received an uber rating on the funny vote? | businesses that still open refers to active = 'true'; business received an uber rating on the funny vote refers to review_votes_funny = 'Uber' | SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T2.review_votes_funny = 'Uber' AND T1.active = 'true' | 6,081 | simple |
codebase_comments | What is the comment format of method number 50 with the solution path "managedfusion_managedfusion\ManagedFusion.sln"? | comment format refers to CommentIsXml; method number refers to Method_100k.Id; Method_100k.Id = 50; solution path refers to Path; Path = 'managedfusion_managedfusion\ManagedFusion.sln'; | SELECT CASE WHEN T2.CommentIsXml = 0 THEN 'isNotXMLFormat' WHEN T2.CommentIsXml = 1 THEN 'isXMLFormat' END format FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Id = 50 AND T1.Path = 'managedfusion_managedfusionManagedFusion.sln' | 6,082 | moderate |
hockey | Among the players who were born in July and August, how many of them got in the Hall of Fame? | born in July and August refers to birthMon IN('7','8') | SELECT COUNT(T1.playerID) FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID WHERE T1.birthMon IN (7, 8) | 6,083 | simple |
soccer_2016 | How many times did K Goel played as a player only? | K Goel refers to Player_Name = 'K Goel'; played as a player only refers to Role_Id = 3 | SELECT COUNT(T1.Match_Id) FROM Player_Match AS T1 INNER JOIN Player AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T1.Role_Id = T3.Role_Id WHERE T2.Player_Name = 'K Goel' AND T3.Role_Id = 3 | 6,084 | simple |
software_company | Please list the occupations of the customers over 40 and have sent a true response to the incentive mailing sent by the marketing department. | over 40 refers to age > 40; RESPONSE = 'true'; | SELECT DISTINCT T1.OCCUPATION FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T1.age > 40 AND T2.RESPONSE = 'true' | 6,085 | simple |
synthea | Name the patients who had an allergy to soy. | allergy to soy refers to allergies where DESCRIPTION = 'Allergy to soya'; | SELECT T1.first, T1.last FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Allergy to soya' | 6,086 | simple |
beer_factory | How many stars did Urijah Faber rate for Frostie? | stars refers to StarRating; Frostie refers to BrandName = 'Frostie'; | SELECT T2.StarRating FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeerbrand AS T3 ON T2.BrandID = T3.BrandID WHERE T1.First = 'Urijah' AND T1.Last = 'Faber' AND T3.BrandName = 'Frostie' | 6,087 | simple |
beer_factory | What is the precise location of the place where Tommy Kono made a purchase in 2014? | precise location = Latitude, Longitude; in 2014 refers to TransactionDate LIKE '2014%'; | SELECT DISTINCT T1.Latitude, T1.Longitude FROM geolocation AS T1 INNER JOIN `transaction` AS T2 ON T2.LocationID = T1.LocationID INNER JOIN customers AS T3 ON T3.CustomerID = T2.CustomerID WHERE T3.First = 'Tommy' AND T3.Last = 'Kono' AND T2.TransactionDate LIKE '2014%' | 6,088 | moderate |
hockey | Please list the first 3 teams that got the most penalty minutes in 2006. | the first 3 teams that got the most penalty minutes refer to name where MAX(PIM) limit to 3; year = 2006; | SELECT name FROM Teams WHERE year = 2006 GROUP BY tmID, name ORDER BY SUM(PIM) DESC LIMIT 3 | 6,089 | simple |
european_football_1 | In how many matches in the Seria A division did both teams have equal goals? | Seria A is a name of division; equal goals refers to FTR = 'D', where D stands for draft; | SELECT COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Seria A' AND T1.FTR = 'D' | 6,090 | simple |
movie_platform | Who is the director that directed the highest number of movies in the 70s? If there are multiple directors with the same amount of movies, list all of their names and indicate the highest rating score that those movies got from the users. | highest number of movies COUNT(T1.movie_id); in the 70s refers to movie_release_year between 1970 and 1979 | SELECT T2.director_name, T1.rating_score FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year BETWEEN 1970 AND 1979 GROUP BY T2.director_id ORDER BY COUNT(T2.movie_id) DESC LIMIT 1 | 6,091 | challenging |
address | Among the cities with alias Ponce, what is the percentage of cities with a country level FIPS code of less than 20? | DIVIDE(COUNT(county_fips < 20), COUNT(county_fips)) as percentage where alias = 'Ponce'; | SELECT CAST(COUNT(CASE WHEN T2.county_fips < 20 THEN T2.zip_code ELSE NULL END) AS REAL) * 100 / COUNT(T2.zip_code) FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.alias = 'Ponce' | 6,092 | moderate |
mondial_geo | Provide the population of the city of the 'World Tourism Organization' headquarter. | SELECT T2.Population FROM organization AS T1 INNER JOIN city AS T2 ON T1.City = T2.Name WHERE T1.Name = 'World Tourism Organization' | 6,093 | simple |
|
college_completion | List the basic of the institution in 2012 with race of all male students. | in 2012 refers to year = '2012'; male refers to gender = 'M'; all students refer to race = 'X'. | SELECT DISTINCT T1.basic, T2.race FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.year = 2012 AND T2.gender = 'M' AND t2.race = 'X' | 6,094 | simple |
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 | 6,095 | simple |
image_and_language | What are the bounding boxes of the object samples with a predicted relation class of "by" in image no.1? | bounding boxes of the object samples refers to (x, y, W, H); predicted relation class of "by" refers to PRED_CLASS = 'by'; image no.1 refers to IMG_ID = 1 | SELECT T3.X, T3.Y, T3.W, T3.H FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.OBJ1_SAMPLE_ID = T3.OBJ_CLASS_ID WHERE T2.IMG_ID = 1 AND T1.PRED_CLASS = 'by' | 6,096 | moderate |
movie_3 | What percentage of films are horror films? | horror' is a name of a category; calculation = DIVIDE(SUM(name = 'Horror'), COUNT(film_id)) * 100 | SELECT CAST(SUM(IIF(T2.name = 'Horror', 1, 0)) AS REAL) * 100 / COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id | 6,097 | moderate |
movies_4 | Who is the main actor in the "Pirates of the Caribbean: At World's End" movie? | main actor refers to person_name where Min(cast_order); "Pirates of the Caribbean: At World's End" refers to title = 'Pirates of the Caribbean: At World''s End' | SELECT T3.person_name FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End' ORDER BY T2.cast_order LIMIT 1 | 6,098 | moderate |
bike_share_1 | Which bicycle is the least used bike. Check if the start and end station are from the same city and calculate the total duration travelled by the bicycle in hours for a trip made within the same city. | least used bike refers to bike_id with MIN(COUNT(main_trip.id)); start station refers to start_station_name; end station refers to end_station_name; total duration in hour = DIVIDE(duration, 3600) AS hour; | SELECT T2.bike_id, T2.start_station_name, T2.end_station_name, T1.city , CAST(T2.duration AS REAL) / 3600 FROM station AS T1 INNER JOIN trip AS T2 ON T1.name = T2.start_station_name GROUP BY T2.bike_id ORDER BY COUNT(T2.id) DESC LIMIT 1 | 6,099 | moderate |
Subsets and Splits