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 |
---|---|---|---|---|---|
video_games | Provide the genre name of the genre ID 3. | genre ID 3 refers to genre.id = 3 | SELECT T.genre_name FROM genre AS T WHERE T.id = 3 | 0 | simple |
professional_basketball | For team who has more home won than home lost more than 80%, list the team name and the offense points. | home won than home lost more than 80% refers to Divide(Subtract(homeWon, homeLost), games) > 0.8; offense point refers to o_fgm | SELECT name, o_pts FROM teams WHERE CAST((homeWon - homeLost) AS REAL) * 100 / games > 80 | 1 | simple |
cars | List the car's name with a price worth greater than 85% of the average price of all cars. | car's name refers to car_name; a price worth greater than 85% of the average price of all cars refers to price > multiply(avg(price), 0.85) | SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price * 100 > ( SELECT AVG(price) * 85 FROM price ) | 2 | simple |
beer_factory | List down the brand names of root beer that gained a 5-star rating from a customer's review in 2013. Calculate the unit profit available to wholesalers for each brand. | 5-star rating refers to StarRating = 5; in 2013 refers to ReviewDate LIKE '2013%'; unit profit available to wholesalers = SUBTRACT(CurrentRetailPrice, WholesaleCost); | SELECT T1.BrandName, T1.CurrentRetailPrice - T1.WholesaleCost AS result FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T2.StarRating = 5 AND T2.ReviewDate BETWEEN '2013-01-01' AND '2013-12-31' | 3 | challenging |
food_inspection_2 | How many taverns failed in July 2010? | tavern refers to facility_type = 'Tavern'; failed refers to results = 'Fail'; in July 2010 refers to inspection_date like '2010-07%' | SELECT COUNT(DISTINCT T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y-%m', T2.inspection_date) = '2010-07' AND T2.results = 'Fail' AND T1.facility_type = 'Restaurant' | 4 | simple |
ice_hockey_draft | List out the name of players who weight 190 lbs. | name of players refers to PlayerName; weight 190 lbs refers to weight_in_lbs = 190; | SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_lbs = 190 | 5 | simple |
shipping | Who was the customer of shipment no.1275? Give the customer's name. | shipment no. 1275 refers to ship_id = 1275; customer name refers to cust_name | SELECT T1.cust_name FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T2.ship_id = '1275' | 6 | simple |
chicago_crime | Where is the coordinate (41.66236555, -87.63470194) located? Give the name of the district. | coordinate (41.66236555, -87.63470194) refers to latitude = '41.66236555' AND longitude = '-87.63470194'; name of the district refers to district_name | SELECT T2.district_name FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T1.longitude = '-87.63470194' AND T1.latitude = '41.66236555' | 7 | simple |
olympics | What is the average age of the athletes from the United States of America who competed in the 2016 Summer Olympics? | AVG(age) where games_name = '2016 Summer' and region_name = 'USA'; | 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 = '2016 Summer' AND T4.region_name = 'USA' | 8 | moderate |
movie_3 | Please list the titles of all the films that the customer RUTH MARTINEZ has rented. | SELECT T4.title FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T1.first_name = 'RUTH' AND T1.last_name = 'MARTINEZ' | 9 | simple |
|
bike_share_1 | For the rides that started at Market at 10th station and ended at South Van Ness at Market station in August of 2013, which day had the coldest temperature? | started at refers to start_station_name; start_station_name = 'Market at 10th'; ended at refers to end_station_name; end_station_name = 'South Van Ness at Market'; in August of 2013 refers to start_date BETWEEN '8/1/2013 0:00' AND '8/31/2013 12:59'; day that had the coldest temperature refers to MIN(min_temperature_f); | SELECT T1.start_date FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code AND T2.date = SUBSTR(CAST(T1.start_date AS TEXT), 1, INSTR(T1.start_date, ' ') - 1) WHERE T2.date LIKE '8/%/2013' AND T1.start_station_name = 'Market at 10th' AND T1.end_station_name = 'South Van Ness at Market' AND T2.min_temperature_f = ( SELECT MIN(T2.min_temperature_f) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code AND T2.date = SUBSTR(CAST(T1.start_date AS TEXT), 1, INSTR(T1.start_date, ' ') - 1) WHERE T2.date LIKE '8/%/2013' AND T1.start_station_name = 'Market at 10th' AND T1.end_station_name = 'South Van Ness at Market' ) | 10 | challenging |
bike_share_1 | At what date and time did San Jose Diridon Caltrain Station have most bikes available. | San Jose Diridon Caltrain Station is the name of the station; most bikes available refers to MAX(bikes_available); | SELECT T2.time FROM station AS T1 INNER JOIN status AS T2 ON T2.station_id = T1.id WHERE T1.name = 'San Jose Diridon Caltrain Station' AND T2.bikes_available = ( SELECT MAX(T2.bikes_available) FROM station AS T1 INNER JOIN status AS T2 ON T2.station_id = T1.id WHERE T1.name = 'San Jose Diridon Caltrain Station' ) | 11 | moderate |
movielens | Among the movies from France, how many of them are drama? | France a one country | SELECT COUNT(T1.movieid) FROM movies2directors AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'France' AND T1.genre = 'drama' | 12 | simple |
books | Please list the titles of all the books that Lucas Wyldbore has ordered. | SELECT T1.title FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T4.first_name = 'Lucas' AND T4.last_name = 'Wyldbore' | 13 | moderate |
|
social_media | List down the text of tweets posted by unknown gender users. | unknown gender user refers to Gender = 'Unknown' | SELECT T1.text FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Unknown' | 14 | simple |
talkingdata | What is the age group of most OPPO users? | age group refers to group; most OPPO users refers to MAX(COUNT(phone_brand = 'OPPO')); OPPO users refers to phone_brand = 'OPPO'; | SELECT T.`group` FROM ( SELECT T1.`group`, COUNT(T1.`group`) AS num 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' GROUP BY T1.`group` ) AS T ORDER BY T.num DESC LIMIT 1 | 15 | moderate |
book_publishing_company | List all employees who are at the maximum level in their job designation. | maximum level in their job designation refers to job_lvl = MAX(max_lvl) | SELECT T1.fname, T1.lname FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.job_lvl = T2.max_lvl | 16 | simple |
olympics | Among the Olympic games held in Los Angeles, what is the name of the Olympic game that has the most number of competitors? | Los Angeles refers to city_name = 'Lost Angeles'; the Olympic game refers to games_name; the most number of competitors refers to MAX(COUNT(games_name)); | SELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN games_city AS T3 ON T2.games_id = T3.games_id INNER JOIN city AS T4 ON T3.city_id = T4.id WHERE T4.city_name = 'Los Angeles' GROUP BY T1.id ORDER BY COUNT(T2.person_id) DESC LIMIT 1 | 17 | challenging |
retails | List all the dates of the urgent orders. | date refers to o_orderdate; urgent order refers to o_orderpriority = '1-URGENT' | SELECT o_orderdate FROM orders WHERE o_orderpriority = '1-URGENT' | 18 | simple |
student_loan | For the students who have been absent from school for the longest time, how many months have they been absent? | absent from school for the longest time refers to MAX(month) | SELECT MAX(month) FROM longest_absense_from_school | 19 | simple |
world_development_indicators | Name the country with fastest growth in adjusted net national income in 1980 and state the currency used by this country. | fastest growth refers to MAX(Value); IndicatorName = 'Adjusted net national income (annual % growth)'; Year = '1980'; currency refers to CurrencyUnit; | SELECT T2.countryname, T1.CurrencyUnit FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IndicatorName = 'Adjusted net national income (annual % growth)' AND T2.Year = 1980 AND T1.CurrencyUnit != '' ORDER BY T2.Value DESC LIMIT 1 | 20 | moderate |
chicago_crime | Among all the incidents with no arrest made, what is the percentage of them having a generic description of "BATTERY" in the IUCR classification? | incident with no arrest made refers to arrest = 'FALSE'; general description refers to primary_description; "BATTERY" is the primary_description; percentage = Divide (Count(iucr_no where primary_description = 'BATTERY'), Count(iucr_no)) * 100 | SELECT CAST(SUM(CASE WHEN T1.primary_description = 'BATTERY' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*)FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T2.arrest = 'FALSE' | 21 | challenging |
hockey | Please list the name of the person who was in the Hall of Fame in the year 1978. | SELECT name FROM HOF WHERE year = 1978 | 22 | simple |
|
cs_semester | What is the name of the course with the highest satisfaction from students? | sat refers to student's satisfaction degree with the course where sat = 5 stands for the highest satisfaction; | SELECT DISTINCT T2.name FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.sat = 5 | 23 | simple |
legislator | How many years had Jr. John Conyers served in total? | Jr. John Conyers is an official_full_name; years served refers to SUM(SUBTRACT(END, start)) | SELECT SUM(CAST(T2.END - T2.start AS DATE)) AS sum FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'John Conyers, Jr.' | 24 | simple |
synthea | Among the white patients, what is the average body height of the patients? | white refers to race = 'white'; average body height = AVG(observations.VALUE WHERE observations.DESCRIPTION = 'Body Height'); body height refers to observations.DESCRIPTION = 'Body Height'; | SELECT AVG(T1.VALUE) FROM observations AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.race = 'white' AND T1.DESCRIPTION = 'Body Height' | 25 | simple |
shakespeare | Please give the title of the work of Shakespeare that has the most characters. | most characters refers to max(count(character_id)) | SELECT T.Title FROM ( SELECT T1.Title, COUNT(T3.character_id) AS num FROM works T1 INNER JOIN chapters T2 ON T1.id = T2.work_id INNER JOIN paragraphs T3 ON T2.id = T3.chapter_id INNER JOIN characters T4 ON T3.character_id = T4.id GROUP BY T3.character_id, T1.Title ) T ORDER BY T.num DESC LIMIT 1 | 26 | challenging |
address | In California, how many delivery receptacles are there in the community post office that has the highest number of delivery receptacles? | in California refers to name = 'California' and state = 'CA'; 'Community Post Office' is the Type | SELECT COUNT(*) FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T1.abbreviation = 'CA' AND T2.type LIKE '%Community Post Office%' AND T1.name = 'California' AND T2.state = 'CA' | 27 | moderate |
student_loan | Name all disabled students that are enrolled in SMC. | enrolled in SMC refers to school = 'smc'; | SELECT T2.name FROM enrolled AS T1 INNER JOIN disabled AS T2 ON T1.`name` = T2.`name` WHERE T1.school = 'smc' | 28 | simple |
airline | What are the air carriers of the flights that flew on August 25, 2018 that have departure delay of -5? | on August 25, 2018 refers to FL_DATE = '2018/8/25'; departure delay of -5 refers to DEP_DELAY = -5; | SELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T2.FL_DATE = '2018/8/25' GROUP BY T1.Description | 29 | simple |
bike_share_1 | In which city's station is a bike borrowed on trip ID4069? | bike is borrowed from refers to start_station_id; | SELECT T2.city FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.id = 4069 | 30 | simple |
regional_sales | In 2019, how many orders were shipped by the sales team with the highest number of orders in the said year? Provide the name of the sales team. | shipped refers to ShipDate; in 2019 refers to shipped in 2019 refers to SUBSTR(ShipDate, -2) = '19'; order in the said year refers to SUBSTR(OrderDate, -2) = '19'; highest number of order refers to Max(Count(OrderNumber)) | SELECT COUNT(T1.OrderNumber), T2.`Sales Team` FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T1.OrderDate LIKE '%/%/19' AND T1.ShipDate LIKE '%/%/19' GROUP BY T2.`Sales Team` ORDER BY COUNT(T1.OrderNumber) DESC LIMIT 1 | 31 | challenging |
bike_share_1 | What is the average duration of a bike trip made on the day with the hottest temperature ever in 2014? | average duration = DIVIDE(SUM(duration), COUNT(id)); hottest temperature refers to max_temperature_f; in 2014 refers to date LIKE '%2014'; | SELECT AVG(T1.duration) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.date LIKE '%2014%' AND T1.start_station_name = '2nd at Folsom' AND T2.max_temperature_f = ( SELECT max_temperature_f FROM weather ORDER BY max_temperature_f DESC LIMIT 1 ) | 32 | moderate |
university | What are the names of the criteria under Center for World University Rankings? | names of the criteria refers to criteria_name; under Center for World University Rankings refers to system_name = 'Center for World University Rankings'; | SELECT T2.criteria_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T1.system_name = 'Center for World University Rankings' | 33 | simple |
works_cycles | Names the Sales Representative with the highest year to date sales. | Highest year to date sales refers to Max(SalesYTD); | SELECT T2.FirstName, T2.MiddleName, T2.LastName FROM SalesPerson AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T1.SalesYTD DESC LIMIT 1 | 34 | simple |
image_and_language | What is the relationship between object sample no. 25 and object sample no. 2 on image no. 1? | relationship refers to PRED_CLASS; object sample no. 25 and object sample no. 2 refers to OBJ1_SAMPLE_ID = 25 and OBJ2_SAMPLE_ID = 2; image no. 1 refers to IMG_ID = 1 | SELECT T2.PRED_CLASS FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.IMG_ID = 1 AND T1.OBJ1_SAMPLE_ID = 25 AND T1.OBJ2_SAMPLE_ID = 2 | 35 | simple |
retails | Which part is ordered in a bigger amount in order no.1, "burnished seashell gainsboro navajo chocolate" or "salmon white grey tan navy"? | amount refers to sum(l_quantity); order no.1 refers to l_orderkey = 1; "burnished seashell gainsboro navajo chocolate" or "salmon white grey tan navy" refers to p_name IN ('salmon white grey tan navy', 'burnished seashell gainsboro navajo chocolate') | SELECT T.p_name FROM ( SELECT T2.p_name, SUM(T1.l_quantity) AS num FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T2.p_name IN ('salmon white grey tan navy', 'burnished seashell gainsboro navajo chocolate') GROUP BY T1.l_partkey ) AS T ORDER BY T.num DESC LIMIT 1 | 36 | challenging |
works_cycles | Among the active male employees, how many of them are paid with the highest frequency? | active status of employees refers to CurrentFlag = 1; Male refers to Gender = 'M'; highest frequency refers to PayFrequency = 2; | SELECT COUNT(T1.BusinessEntityID) FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.CurrentFlag = 1 AND T2.Gender = 'M' AND T1.PayFrequency = 2 | 37 | simple |
chicago_crime | Please list the names of all the neighborhoods in the community area with the most population. | name of neighborhood refers to neighborhood_name; the most population refers to max(population) | SELECT T1.neighborhood_name FROM Neighborhood AS T1 INNER JOIN Community_Area AS T2 ON T2.community_area_no = T2.community_area_no ORDER BY T2.population DESC LIMIT 1 | 38 | simple |
professional_basketball | How many All Star players who played in the 1973 season were black? | 1973 season refers to season_id = 1973; black refers to race = 'B' | SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.season_id = 1973 AND T1.race = 'B' | 39 | simple |
food_inspection_2 | How many employees are living in Hoffman Estates, IL? | in Hoffman Estates refers to city = 'Hoffman Estates'; IL refers to state = 'IL' | SELECT COUNT(employee_id) FROM employee WHERE state = 'IL' AND city = 'Hoffman Estates' | 40 | simple |
public_review_platform | List any five of user ID who became elite user in 2006. | year_id = '2006'; | SELECT user_id FROM Elite WHERE year_id = 2006 LIMIT 5 | 41 | simple |
image_and_language | State the name of the object class that has in most images. | object class that has in most images refers to OBJ_CLASS where MAX(COUNT(OBJ_CLASS_ID)); | SELECT OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID GROUP BY T2.OBJ_CLASS ORDER BY COUNT(T1.OBJ_CLASS_ID) DESC LIMIT 1 | 42 | simple |
shakespeare | How many "all" character names have the "all" abbreviation? | character names refers to CharName;"all" abbreviation refers to Abbrev = 'all' | SELECT COUNT(id) FROM characters WHERE Abbrev = 'All' | 43 | simple |
book_publishing_company | List the title, price and publication date for all sales with 'ON invoice' payment terms. | publication date refers to pubdate; payment terms refers to payterms; payterms = 'ON invoice' | SELECT T2.title, T2.price, T2.pubdate FROM sales AS T1 INNER JOIN titles AS T2 ON T1.title_id = T2.title_id WHERE T1.payterms = 'ON invoice' | 44 | simple |
talkingdata | Please list the categories of the app users who are not active when event no.2 happened. | not active refers to is_active = 0; event no. refers to event_id; event_id = 2; | SELECT DISTINCT T1.category FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id INNER JOIN app_events AS T3 ON T2.app_id = T3.app_id WHERE T3.event_id = 2 AND T3.is_active = 0 | 45 | simple |
beer_factory | Among the transactions, what percentage is done by using a visa card? | visa card refers to CreditCardType = 'Visa'; percentage = MULTIPLY(DIVIDE(SUM(CreditCardType = 'Visa'), COUNT(TransactionID)), 1.0); | SELECT CAST(COUNT(CASE WHEN CreditCardType = 'Visa' THEN TransactionID ELSE NULL END) AS REAL) * 100 / COUNT(TransactionID) FROM `transaction` | 46 | simple |
public_review_platform | Please list the businesses names whose length of user review is long with business id from 1 to 20. | businesses names refers to business_id; length of user review is long refers to review_length = 'Long'; business_id BETWEEN 1 AND 20; | 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 'Long' AND T3.category_id BETWEEN 1 AND 20 GROUP BY T4.category_name | 47 | moderate |
student_loan | List out the number of female students who enlisted in the air force. | enlisted in the air force refers to organ = 'air_force'; | SELECT COUNT(name) FROM enlist WHERE organ = 'air_force' AND name NOT IN ( SELECT name FROM male ) | 48 | simple |
food_inspection_2 | What is the full name of the employee who was responsible for the most inspection in March 2016? | full name refers to first_name, last_name; the most inspection refers to max(count(employee_id)); in March 2016 refers to inspection_date like '2016-03%' | SELECT T3.first_name, T3.last_name FROM ( SELECT T1.employee_id, COUNT(T1.inspection_id) FROM inspection AS T1 WHERE strftime('%Y-%m', T1.inspection_date) = '2016-03' GROUP BY T1.employee_id ORDER BY COUNT(T1.inspection_id) DESC LIMIT 1 ) AS T2 INNER JOIN employee AS T3 ON T2.employee_id = T3.employee_id | 49 | moderate |
world_development_indicators | List out the name and indicator code of high income: nonOECD countries | high income: non-OECD' refer to IncomeGroup; | SELECT DISTINCT T1.CountryCode, T2.CountryName FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IncomeGroup = 'High income: nonOECD' | 50 | simple |
menu | Among the menus that include baked apples with cream, who is the sponsor of the menu with the highest price? | baked apples with cream is a name of dish; highest price refers to MAX(price); | SELECT T4.sponsor FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id INNER JOIN Menu AS T4 ON T4.id = T1.menu_id WHERE T3.name = 'Baked apples with cream' AND T3.id = 107 ORDER BY T2.price DESC LIMIT 1 | 51 | moderate |
car_retails | Among the customers of empolyee 1370, who has the highest credit limit?Please list the full name of the contact person. | Employee 1370 refers to employeeNumber = '1370'; | SELECT t2.contactFirstName, t2.contactLastName FROM employees AS t1 INNER JOIN customers AS t2 ON t1.employeeNumber = t2.salesRepEmployeeNumber WHERE t1.employeeNumber = '1370' ORDER BY t2.creditLimit DESC LIMIT 1 | 52 | moderate |
public_review_platform | Calculate the difference between running business in Glendale City and Mesa City. | running business refers to business where active = 'true'; | SELECT SUM(CASE WHEN city = 'Glendale' THEN 1 ELSE 0 END) - SUM(CASE WHEN city = 'Mesa' THEN 1 ELSE 0 END) AS diff FROM Business WHERE active = 'true' | 53 | simple |
books | Among the books published by Birlinn in 2008, how many books have pages around 600 to 700? | "Birlinn" is the publisher_name; books have pages around 600 to 700 refers to num_pages BETWEEN 600 AND 700; in 2008 refers to SUBSTR(publication_date, 1, 4) = '2008' | SELECT COUNT(*) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Birlinn' AND STRFTIME('%Y', T1.publication_date) = '2008' AND T1.num_pages BETWEEN 600 AND 700 | 54 | simple |
professional_basketball | How many total minutes has the Brooklyn-born player, known by the name of Superman, played during all of his NBA All-Star seasons? | "Brooklyn" is the birthCity of player; known by the name of Superman refers to nameNick like '%Superman%'; total minutes refers to Sum(minutes) | SELECT SUM(T2.minutes) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCity = 'Brooklyn' AND T1.nameNick LIKE '%Superman%' | 55 | moderate |
movie_3 | How many films in English are for adults only? | English is a name of a language; for adults only refers to rating = 'NC-17' | SELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T2.name = 'English' AND T1.rating = 'NC-17' | 56 | simple |
retails | Of the orders with a lower delivery priority, how many have an urgent priority order? | an urgent priority order refers to o_orderkey where o_orderpriority = '1-URGENT'; earlier orderdate have higher priority in delivery; lower delivery priority refers to MAX(o_orderdate); | SELECT COUNT(o_orderkey) FROM orders WHERE o_orderpriority = '1-URGENT' GROUP BY o_orderdate ORDER BY o_orderdate DESC LIMIT 1 | 57 | simple |
talkingdata | Among the HTC users, calculate the percentage of female users who are over 80. | HTC refers to phone_brand = 'HTC'; percentage = DIVIDE(SUM(gender = 'F' AND age > 80), COUNT(device_id)); female refers to gender = 'F'; over 80 refers to age > 80 | SELECT SUM(IIF(T1.gender = 'F' AND T1.age > 80, 1, 0)) / COUNT(T1.device_id) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'HTC' | 58 | moderate |
disney | Among Frank Welker's voice-acted movies, list the movie titles and the total gross when the estimated inflation rate was less than 2. | Frank Welker refers to voice-actor = 'Frank Welker'; estimated inflation rate was less than 2 can be computed as follows DIVIDE(inflation_adjusted_gross, total_gross) as percentage < 2; | SELECT T1.movie_title, T1.total_gross FROM movies_total_gross AS T1 INNER JOIN `voice-actors` AS T2 ON T1.movie_title = T2.movie WHERE T2.`voice-actor` = 'Frank Welker' AND CAST(REPLACE(trim(T1.inflation_adjusted_gross, '$'), ',', '') AS REAL) * 1.0 / CAST(REPLACE(trim(T1.total_gross, '$'), ',', '') AS REAL) * 1.0 < 2 | 59 | challenging |
food_inspection_2 | How many employees have salary greater than 70000 but fail the inspection? | salary greater than 70000 refers to salary > 70000; fail the inspection refers to results = 'Fail' | SELECT COUNT(DISTINCT T1.employee_id) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.results = 'Fail' AND T1.salary > 70000 | 60 | simple |
retails | What is the total quantity of the part "hot spring dodger dim light" ordered in all orders? | total quantity refers to sum(l_quantity); part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light' | SELECT SUM(T1.p_partkey) FROM part AS T1 INNER JOIN lineitem AS T2 ON T1.p_partkey = T2.l_partkey WHERE T1.p_name = 'hot spring dodger dim light' | 61 | simple |
image_and_language | Name the object element that is described as being scattered on image no. 10. | Name the object element refers to OBJ_CLASS; scattered refers to ATT_CLASS = 'scattered'; image no. 10 refers to IMG_ID = 10 | SELECT T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID INNER JOIN IMG_OBJ_ATT AS T3 ON T1.IMG_ID = T3.IMG_ID INNER JOIN ATT_CLASSES AS T4 ON T3.ATT_CLASS_ID = T4.ATT_CLASS_ID WHERE T4.ATT_CLASS = 'scattered' AND T1.IMG_ID = 10 GROUP BY T2.OBJ_CLASS | 62 | moderate |
synthea | What is the difference between average glucose reading for patients in the 20s and 50s? | sum(case when t2.DATE-t1.birthdate between 20 and 29 then t2.VALUE else 0 end)/count(case when t2.DATE-t1.birthdate between 20 and 29 then t2.PATIENT else null end)-sum(case when t2.DATE-t1.birthdate between 50 and 59 then t2.VALUE else 0 end)/count(case when t2.DATE-t1.birthdate between 50 and 59 then t2.PATIENT else null end) | SELECT SUM(CASE WHEN ROUND((strftime('%J', T2.DATE) - strftime('%J', T1.birthdate)) / 365) BETWEEN 20 AND 30 THEN T2.VALUE ELSE 0 END) / COUNT(CASE WHEN ROUND((strftime('%J', T2.DATE) - strftime('%J', T1.birthdate)) / 365) BETWEEN 20 AND 30 THEN T2.PATIENT END) - SUM(CASE WHEN ROUND((strftime('%J', T2.DATE) - strftime('%J', T1.birthdate)) / 365) BETWEEN 50 AND 60 THEN T2.VALUE ELSE 0 END) / COUNT(CASE WHEN ROUND((strftime('%J', T2.DATE) - strftime('%J', T1.birthdate)) / 365) BETWEEN 50 AND 60 THEN T2.PATIENT END) AS difference FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Glucose' | 63 | challenging |
movie_platform | Was user 39115684 a trialist when he or she rated the movie "A Way of Life"? | A Way of Life' refers to movie_title; user 39115684 refers to userid = 39115684; the user was a trialist when he rated the movie refers to user_trialist = 1; | SELECT T1.user_trialist FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.user_id = 39115684 | 64 | simple |
retail_world | In 1996, how many orders were from customers in the UK? | in 1996 refers to YEAR (OrderDate) = 1996; 'UK' is the Country; | SELECT COUNT(T1.CustomerID) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE STRFTIME('%Y', T2.OrderDate) = '1996' AND T1.Country = 'UK' | 65 | simple |
restaurant | Identify all the restaurants in Marin County by their id. | SELECT T1.id_restaurant FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'marin county' | 66 | simple |
|
world_development_indicators | Among the countries with note on the series code SM.POP.TOTL, how many of them are in the low-income group? | countries refer to Countrycode; low-income group refers to incomegroup = 'Low income'; with notes refers to description IS NOT NULL; series code SM.POP.TOTL refers to Seriescode = 'SM.POP.TOTL' | SELECT COUNT(T1.Countrycode) FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Seriescode = 'SM.POP.TOTL' AND T1.IncomeGroup = 'Low income' | 67 | simple |
cookbook | How many calories does the recipe "Raspberry Chiffon Pie" contain? | Raspberry Chiffon Pie refers to title | SELECT T2.calories FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Raspberry Chiffon Pie' | 68 | simple |
simpson_episodes | Which crew member of the simpson 20s is the oldest? | oldest refers to Min(birthdate) | SELECT name FROM Person WHERE birthdate IS NOT NULL ORDER BY birthdate ASC LIMIT 1; | 69 | simple |
olympics | What is the average height of the male Olympic competitors from Finland? | DIVIDE(SUM(height), COUNT(id)) where region_name = 'Finland' and gender = 'M'; | SELECT AVG(T3.height) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Finland' AND T3.gender = 'M' | 70 | simple |
chicago_crime | What was the major type of crime that happened in the Rogers Park community area? | "Rogers Park" is the community_area_name; major type of crime refers to title | SELECT T1.fbi_code_no, T1.title FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no INNER JOIN Community_Area AS T3 ON T2.community_area_no = T3.community_area_no WHERE T3.community_area_name = 'Rogers Park' GROUP BY T1.fbi_code_no, T1.title | 71 | simple |
retails | How many countries are there in the region whose comment description is "asymptotes sublate after the r." | r_comment = 'asymptotes sublate after the r'; countries refer to n_nationkey; | SELECT COUNT(T1.n_nationkey) FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_comment = 'asymptotes sublate after the r' | 72 | simple |
law_episode | What are the names of the two people who won an award for their role as directors? | won an award refers to result = 'Winner'; role as director refers to role = 'director' | SELECT T1.name FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.Result = 'Winner' AND T2.role = 'director' | 73 | simple |
world | In which continent does the country with the smallest surface area belongs? | smallest surface area refers to MIN(smallest surface area); | SELECT Continent FROM Country ORDER BY SurfaceArea LIMIT 1 | 74 | simple |
beer_factory | Tell the number of reviews given by James House. | FALSE; | SELECT COUNT(T2.CustomerID) FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'James' AND T1.Last = 'House' | 75 | simple |
legislator | How many percent of senators were from class 1? | senator refers to type = 'sen'; class 1 refers to class = 1; calculation = MULTIPLY(DIVIDE(COUNT(class = 1 then bioguide), COUNT(bioguide)), 1.0) | SELECT CAST(SUM(CASE WHEN class = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM `historical-terms` WHERE type = 'sen' | 76 | simple |
college_completion | What is the ratio of Asian male graduates to Asian female graduates from Harvard University in 2013? | ratio = MULTIPLY(DIVIDE(SUM(grad_cohort WHERE Gender = 'M'), SUM( grad_cohort WHERE Gender = 'F')), 1.0); Asian refers to race = 'A'; female refers to gender = 'F'; graduates refers to grad_cohort; male refers to gender = 'M'; Harvard University refers to chronname = 'Harvard University'; in 2013 refers to year = 2013; | SELECT CAST(SUM(CASE WHEN T2.Gender = 'M' THEN T2.grad_cohort ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.Gender = 'F' THEN T2.grad_cohort ELSE 0 END) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T1.chronname = 'Harvard University' AND T2.year = 2013 AND T2.race = 'A' | 77 | challenging |
software_company | List down the geographic identifier with an income that ranges from 2100 to 2500. | geographic identifier with an income that ranges from 2100 to 2500 refers to GEOID where INCOME_K BETWEEN 2100 AND 2500; | SELECT GEOID FROM Demog WHERE INCOME_K >= 2100 AND INCOME_K <= 2500 | 78 | simple |
social_media | Please list the texts of all the tweets posted by male users from Buenos Aires. | "Buenos Aires" is the City; male user refers to Gender = 'Male' | SELECT T1.text FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID INNER JOIN user AS T2 ON T2.UserID = T1.UserID INNER JOIN user AS T3 ON T1.UserID = T3.UserID WHERE T2.City = 'Buenos Aires' AND T3.Gender = 'Male' | 79 | moderate |
authors | Name the title, year and keyword of the paper which were written by the author ID of 661002 with the affiliation of "Scientific Computing and Imaging Institute, University of Utah, UT 84112, USA" organization. | "661002" is the AuthorId; "Scientific Computing and Imaging Institute, University of Utah, UT 84112, USA" is the Affiliation organization | SELECT T2.Title, T2.Year, T2.Keyword FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T1.AuthorId = 661002 AND T1.Affiliation = 'Scientific Computing and Imaging Institute, University of Utah, UT 84112, USA' | 80 | moderate |
app_store | List apps whose rating is 3.9 and state the translated review of each app. | lowest rating refers to Rating = 1; | SELECT T1.App, T2.Translated_Review FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Rating = 3.9 | 81 | simple |
works_cycles | What is the person's business ID with a vista credit card number "11113366963373"? | business id refers to BusinessEntityID | SELECT T2.BusinessEntityID FROM CreditCard AS T1 INNER JOIN PersonCreditCard AS T2 ON T1.CreditCardID = T2.CreditCardID WHERE T1.CardNumber = 11113366963373 | 82 | simple |
car_retails | To whom does Steve Patterson report? Please give his or her full name. | reportsTO' is the leader of the 'employeeNumber'; | SELECT t2.firstName, t2.lastName FROM employees AS t1 INNER JOIN employees AS t2 ON t2.employeeNumber = t1.reportsTo WHERE t1.firstName = 'Steve' AND t1.lastName = 'Patterson' | 83 | simple |
app_store | For the Honkai Impact 3rd App, what is the highest sentiment polarity score and what genre does it belong to? | highest sentiment polarity score refers to MAX(Sentiment_Polarity); | SELECT MAX(T2.Sentiment_Polarity), T1.Genres FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Honkai Impact 3rd' AND T2.Sentiment_Polarity > 0.5 GROUP BY T1.Genres | 84 | moderate |
movie_3 | What are the names of the movies which Laura Brody starred in? | name of movie refers to title | SELECT T3.title 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 T1.first_name = 'Laura' AND T1.last_name = 'Brody' | 85 | simple |
beer_factory | What is the precise location of all paying customers with American Express? | precise location refers to Latitude, Longitude; American Express refers to CreditCardType = 'American Express'; | SELECT DISTINCT T2.Latitude, T2.Longitude FROM `transaction` AS T1 INNER JOIN geolocation AS T2 ON T1.LocationID = T2.LocationID WHERE T1.CreditCardType = 'American Express' | 86 | simple |
car_retails | Where's Foon Yue Tseng's office located at? Give the detailed address. | Detailed address comprises addressLine1 and addressLine2; | SELECT T1.addressLine1, T1.addressLine2 FROM offices AS T1 INNER JOIN employees AS T2 ON T1.officeCode = T2.officeCode WHERE T2.firstName = 'Foon Yue' AND T2.lastName = 'Tseng' | 87 | simple |
ice_hockey_draft | How many players were drafted by Arizona Coyotes whose height reaches 195 centimeters? | drafted by Arizona Coyotes refers to overallby = 'Arizona Coyotes'; height reaches 195 centimeters refers to height_in_cm = 195; | SELECT COUNT(T2.ELITEID) FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height WHERE T2.overallby = 'Arizona Coyotes' AND T1.height_in_cm = 195 | 88 | simple |
hockey | Please list the awards won by coaches who were born in 1952. | born in 1977 refers to birthYear = '1977' | SELECT T2.award FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T1.birthYear = 1952 | 89 | simple |
talkingdata | How many male users are active in the events held on 5/1/2016? | male refers to gender = 'M'; active refers to is_active = 1; on 5/1/2016 refers to timestamp LIKE '2016-05-01%'; | SELECT COUNT(T3.gender) FROM app_events AS T1 INNER JOIN events_relevant AS T2 ON T2.event_id = T1.event_id INNER JOIN gender_age AS T3 ON T3.device_id = T2.device_id WHERE T1.is_active = 1 AND T3.gender = 'M' AND T2.timestamp LIKE '2016-05-01%' | 90 | moderate |
retail_world | Among the products ordered in order no. 10248, which product has the biggest ratio of units on order to units in stock? | order no. refers to OrderID; biggest ratio = MAX(DIVIDE(UnitsOnOrder, UnitsInStock)); | SELECT T1.ProductName FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T2.OrderID = 10248 ORDER BY T1.UnitsOnOrder / T1.UnitsInStock DESC LIMIT 1 | 91 | simple |
retails | In which country do most of the customers come from? | country refers to n_name; most of the customers refer to MAX(COUNT(c_custkey)); | SELECT T.n_name FROM ( SELECT T2.n_name, COUNT(T1.c_custkey) AS num FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey GROUP BY T2.n_name ) AS T ORDER BY T.num DESC LIMIT 1 | 92 | simple |
mondial_geo | Which nation has the highest GDP? Please give the nation's full name. | SELECT T1.Name FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country ORDER BY T2.GDP DESC LIMIT 1 | 93 | simple |
|
retail_world | Indicate the category name of the product name with the highest units on order. | SELECT T2.CategoryName FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.UnitsOnOrder = ( SELECT MAX(T1.UnitsOnOrder) FROM Products ) | 94 | simple |
|
authors | List author name for articles that are preprinted but not published. | articles that are preprinted but not published refers to Year = 0 | SELECT T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Year = 0 | 95 | simple |
video_games | What year were the first game released? | year the first game was released refers to MIN(release_year); | SELECT T.release_year FROM game_platform AS T ORDER BY T.release_year ASC LIMIT 1 | 96 | simple |
video_games | Among the games published by 10TACLE Studios, how many of them are puzzles? | published by 10TACLE Studios refers to publisher_name = '10TACLE Studios'; puzzle refers to genre_name = 'Puzzle' | SELECT 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 T4.genre_name = 'Puzzle' AND T3.publisher_name = '10TACLE Studios' | 97 | moderate |
disney | Who is the voice actor of the hero character from the movie The Little Mermaid? | The Little Mermaid refers to movie_title = 'The Little Mermaid'; | SELECT T2.`voice-actor` FROM characters AS T1 INNER JOIN `voice-actors` AS T2 ON T2.movie = T1.movie_title WHERE T1.movie_title = 'The Little Mermaid' AND T2.character = T1.hero | 98 | simple |
music_platform_2 | What is the percentage of the podcast that are categorized in four or more categories? | categorized in 4 or more refers to Count(category) > 4; percentage = Divide(Count(podcast_id(count(category) > 4)), Count(podcast_id)) * 100 | SELECT COUNT(T1.podcast_id) FROM ( SELECT podcast_id FROM categories GROUP BY podcast_id HAVING COUNT(category) >= 4 ) AS T1 | 99 | simple |
End of preview. Expand
in Dataset Viewer.
- StreamBench paper link: https://arxiv.org/abs/2406.08747 (The links for the original raw datasets on StreamBench can be found in Appendix F)
- If you find our work helpful, please cite as:
@article{wu2024streambench,
title={StreamBench: Towards Benchmarking Continuous Improvement of Language Agents},
author={Wu, Cheng-Kuang and Tam, Zhi Rui and Lin, Chieh-Yen and Chen, Yun-Nung and Lee, Hung-yi},
journal={arXiv preprint arXiv:2406.08747},
year={2024}
}
- Downloads last month
- 296