db_id
stringclasses 11
values | question
stringlengths 23
286
| evidence
stringlengths 0
591
| SQL
stringlengths 29
1.45k
| question_id
int64 0
1.53k
| difficulty
stringclasses 3
values |
---|---|---|---|---|---|
student_club | In the College of Agriculture and Applied Sciences, how many majors are under the department of School of Applied Sciences, Technology and Education? | SELECT COUNT(major_id) FROM major WHERE department = 'School of Applied Sciences, Technology AND Education' AND college = 'College of Agriculture AND Applied Sciences' | 1,425 | simple |
|
superhero | List the name of superheroes with flight power. | name of superheroes refers to superhero_name; flight power refers to power_name = 'Flight'; | SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN hero_power AS T2 ON T1.id = T2.hero_id INNER JOIN superpower AS T3 ON T2.power_id = T3.id WHERE T3.power_name = 'Flight' | 771 | simple |
formula_1 | Which citizenship do the vast majority of the drivers hold? | Citizenship of majority of drivers = MAX(nationality); citizenship and nationality are synonyms
| SELECT nationality FROM drivers GROUP BY nationality ORDER BY COUNT(driverId) DESC LIMIT 1 | 997 | simple |
financial | List account ID and account opening date for accounts from 'Prachatice'. | A2 refers to the names of districts. | SELECT T1.account_id, T1.date FROM account AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.A2 = 'Prachatice' | 121 | simple |
thrombosis_prediction | For patient born between 1936-1956, how many male patients have creatinine phosphokinase beyond the normal range? | born between 1936-1956 refers to year(Birthday) BETWEEN '1936' AND '1956'; male patients refers to sex = 'M'; creatinine phosphokinase beyond the normal range refers to CPK > = 250; | SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', T1.Birthday) BETWEEN '1936' AND '1956' AND T1.SEX = 'M' AND T2.CPK >= 250 | 1,231 | challenging |
card_games | How many cards in the set Coldsnap have a black border color? | card set Coldsnap refers to name = 'Coldsnap'; black border color refers to borderColor = 'black' | SELECT SUM(CASE WHEN T1.borderColor = 'black' THEN 1 ELSE 0 END) FROM cards AS T1 INNER JOIN sets AS T2 ON T2.code = T1.setCode WHERE T2.name = 'Coldsnap' | 475 | simple |
card_games | What is the percentage of the set of cards that have Chinese Simplified as the language and are only available for online games? | are only available for online games refers to isOnlineOnly = 1; percentage = DIVIDE(COUNT(isOnlineOnly = 1),COUNT(isOnlineOnly))*100 | SELECT CAST(SUM(CASE WHEN T2.language = 'Chinese Simplified' AND T1.isOnlineOnly = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM sets AS T1 INNER JOIN set_translations AS T2 ON T1.code = T2.setCode | 433 | moderate |
card_games | What is the name of set number 5 and its translation? | set number 5 refers to id = 5 | SELECT T1.name, T2.translation FROM sets AS T1 INNER JOIN set_translations AS T2 ON T1.code = T2.setCode WHERE T2.id = 5 GROUP BY T1.name, T2.translation | 428 | simple |
thrombosis_prediction | How many patients with severe thrombosis have a normal prothrombin time? | severe thrombosis refers to Thrombosis = 2 or 1; normal prothrombin time refers to PT < 14; | SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T2.PT < 14 AND T3.Thrombosis < 3 AND T3.Thrombosis > 0 | 1,311 | moderate |
thrombosis_prediction | Sort in descending order all patients by birthday for male patient with albumin not within range. | male = SEX = 'M'; albumin not within range refers to ALB < = 3.5 or ALB > = 5.5 | SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'M' AND (T2.ALB <= 3.5 OR T2.ALB >= 5.5) ORDER BY T1.Birthday | 1,216 | simple |
codebase_community | Write all comments made by user 'A Lion.' | "A Lion" is the DisplayName of user; comment refers to Text | SELECT T2.Text FROM users AS T1 INNER JOIN comments AS T2 ON T1.Id = T2.UserId WHERE T1.DisplayName = 'A Lion' | 577 | simple |
toxicology | Identify whether the chemical compound that contains Calcium is carcinogenic. | calcium refers to element = 'ca'; label = '+' mean molecules are carcinogenic; label = '-' means molecules are non-carcinogenic; | SELECT T2.label AS flag_carcinogenic FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.element = 'ca' | 283 | moderate |
california_schools | What is the administrator's email address of the chartered school with the fewest students enrolled in grades 1 through 12? | Charted school means `Charter School (Y/N)` = 1 in the table frpm; Students enrolled in grades 1 through 12 refers to `Enrollment (K-12)` | SELECT T2.AdmEmail1 FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T1.`Charter School (Y/N)` = 1 ORDER BY T1.`Enrollment (K-12)` ASC LIMIT 1 | 35 | moderate |
financial | Please list the account types that are not eligible for loans, and the average income of residents in the district where the account is located exceeds $8000 but is no more than $9000. | A11 represents the average salary; Salary and income share the similar meanings; when the account type = 'OWNER', it's eligible for loans | SELECT T3.type FROM district AS T1 INNER JOIN account AS T2 ON T1.district_id = T2.district_id INNER JOIN disp AS T3 ON T2.account_id = T3.account_id WHERE T3.type != 'OWNER' AND T1.A11 BETWEEN 8000 AND 9000 | 149 | challenging |
formula_1 | Please give the link of the website that shows more information about the circuits the Spanish Grand Prix used in 2009. | link of the website refers to url | SELECT T1.url FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T2.year = 2009 AND T2.name = 'Spanish Grand Prix' | 925 | simple |
european_football_2 | What is the long passing score of the oldest player? | long passing score refers to long_passing; oldest player refers to oldest birthday; | SELECT t2.long_passing FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id ORDER BY t1.birthday ASC LIMIT 1 | 1,090 | simple |
formula_1 | Show me the season page of year when the race No. 901 took place. | race number refers to raceId; | SELECT T2.url FROM races AS T1 INNER JOIN seasons AS T2 ON T2.year = T1.year WHERE T1.raceId = 901 | 875 | simple |
codebase_community | What is the display name of the user who acquired the highest amount of badges? | highest amount of badges refers to MAX(COUNT(Name)); | SELECT T1.DisplayName FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId GROUP BY T1.DisplayName ORDER BY COUNT(T1.Id) DESC LIMIT 1 | 668 | simple |
student_club | Mention the zip code of member who incurred less than 50USD. | incurred less than 50USD refers to cost < 50 | SELECT T1.zip FROM member AS T1 INNER JOIN expense AS T2 ON T1.member_id = T2.link_to_member WHERE T2.cost < 50 | 1,413 | simple |
student_club | With the biggest budget for the "Food", what was the remaining of it? | remaining of budget refers to remaining, biggest budget for 'Food' refers to MAX(budget.amount) where category = 'Food' | SELECT remaining FROM budget WHERE category = 'Food' AND amount = ( SELECT MAX(amount) FROM budget WHERE category = 'Food' ) | 1,343 | simple |
california_schools | Between 1/1/2000 to 12/31/2005, how many directly funded schools opened in the county of Stanislaus? | Directly funded schools refers to FundingType = 'Directly Funded' | SELECT COUNT(School) FROM schools WHERE strftime('%Y', OpenDate) BETWEEN '2000' AND '2005' AND County = 'Stanislaus' AND FundingType = 'Directly funded' | 66 | simple |
formula_1 | Which was Lewis Hamilton first race? What was his points recorded for his first race event? | first race refers to min(Year) | SELECT T1.name, T2.points FROM races AS T1 INNER JOIN driverStandings AS T2 ON T2.raceId = T1.raceId INNER JOIN drivers AS T3 ON T3.driverId = T2.driverId WHERE T3.forename = 'Lewis' AND T3.surname = 'Hamilton' ORDER BY T1.year ASC LIMIT 1 | 906 | moderate |
student_club | List the last name of the members of the club that attended the women's soccer event. | members of the club refers to position = 'Member'; 'Women's Soccer' is event name; | SELECT T3.last_name FROM attendance AS T1 INNER JOIN event AS T2 ON T2.event_id = T1.link_to_event INNER JOIN member AS T3 ON T1.link_to_member = T3.member_id WHERE T2.event_name = 'Women''s Soccer' AND T3.position = 'Member' | 1,431 | moderate |
codebase_community | Among the users who obtained the "Organizer" badges, calculate the percentage of users who are teenagers. | "Organizer" is the Name of badge; teenager refers to Age BETWEEN 13 AND 18; percentage = Divide (Count(UserId where Age BETWEEN 13 AND 18), Count(UserId)) *100 | SELECT CAST(SUM(IIF(T2.Age BETWEEN 13 AND 18, 1, 0)) AS REAL) * 100 / COUNT(T1.Id) FROM badges AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T1.`Name` = 'Organizer' | 615 | moderate |
thrombosis_prediction | What is the highest total bilirubin level recorded? List out the patient details with ID, sex and birthday with that index. | the highest total bilirubin refers to MAX(T-BIL) | SELECT T2.`T-BIL`, T1.ID, T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID ORDER BY T2.`T-BIL` DESC LIMIT 1 | 1,224 | simple |
financial | For the first client who opened his/her account in Prague, what is his/her account ID? | A3 stands for region names | SELECT T1.account_id FROM account AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.A3 = 'Prague' ORDER BY T1.date ASC LIMIT 1 | 114 | simple |
california_schools | What is the website for the schools under the administrations of Mike Larson and Dante Alvarez? | SELECT Website FROM schools WHERE (AdmFName1 = 'Mike' AND AdmLName1 = 'Larson') OR (AdmFName1 = 'Dante' AND AdmLName1 = 'Alvarez') | 59 | simple |
|
thrombosis_prediction | For all patients with normal uric acid (UA), what is the average UA index based on their latest laboratory examination result? | uric acid (UA) with normal range refers to UA < 8.0 and SEX = 'M' or UA < 6.5 and SEX = 'F'; average UA index refers to AVG(UA) | SELECT AVG(T2.UA) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE (T2.UA > 6.5 AND T1.SEX = 'F') OR (T2.UA > 8.0 AND T1.SEX = 'M') AND T2.Date = ( SELECT MAX(Date) FROM Laboratory ) | 1,219 | moderate |
codebase_community | Which post by Harvey Motulsky has the most views? Please give the id and title of this post. | DisplayName = 'Harvey Motulsky'; the most views refer to MAX(ViewCount); | SELECT T2.Id, T2.Title FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId WHERE T1.DisplayName = 'Harvey Motulsky' ORDER BY T2.ViewCount DESC LIMIT 1 | 678 | simple |
california_schools | What is the Percent (%) Eligible Free (K-12) in the school administered by an administrator whose first name is Alusine. List the district code of the school. | Percent (%) Eligible Free (K-12) = `Free Meal Count (K-12)` / `Enrollment (K-12)` * 100% | SELECT T1.`Free Meal Count (K-12)` * 100 / T1.`Enrollment (K-12)`, T1.`District Code` FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.AdmFName1 = 'Alusine' | 85 | moderate |
card_games | What are the foiled cards that are incredibly powerful when paired with non foiled cards? List the IDs. | Incredibly powerful refers to both cardKingdomFoilId and cardKingdomId IS NOT Null; | SELECT id FROM cards WHERE cardKingdomId IS NOT NULL AND cardKingdomFoilId IS NOT NULL | 378 | simple |
student_club | State the category of events were held at MU 215. | 'MU 215' is the location of event | SELECT T2.category FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.location = 'MU 215' | 1,422 | simple |
financial | What is the gender of the oldest client who opened his/her account in the highest average salary branch? | Earlier birthdate refers to older age; A11 refers to average salary | SELECT T2.gender FROM district AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id ORDER BY T1.A11 DESC, T2.birth_date ASC LIMIT 1 | 107 | simple |
debit_card_specializing | Which country has more "value for money" gas stations? Please give a total number of "value for money" gas stations in each country. | SELECT Country , ( SELECT COUNT(GasStationID) FROM gasstations WHERE Segment = 'Value for money' ) FROM gasstations WHERE Segment = 'Value for money' GROUP BY Country ORDER BY COUNT(GasStationID) DESC LIMIT 1 | 1,491 | simple |
|
superhero | Please list the full names of all the superheroes with over 15 super powers. | 15 super powers refers to COUNT(full_name) > 15 | SELECT DISTINCT T1.full_name FROM superhero AS T1 INNER JOIN hero_power AS T2 ON T1.id = T2.hero_id GROUP BY T1.full_name HAVING COUNT(T2.power_id) > 15 | 720 | simple |
superhero | Identify superheroes who can control wind and list their names in alphabetical order. | superheroes refers to superhero_name; can control wind refers to power_name = 'Wind Control'; | SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN hero_power AS T2 ON T1.id = T2.hero_id INNER JOIN superpower AS T3 ON T2.power_id = T3.id WHERE T3.power_name = 'Wind Control' ORDER BY T1.superhero_name | 824 | moderate |
thrombosis_prediction | How many female patients were given an APS diagnosis? | female refers to SEX = 'F'; 'APS' refers to diagnosis | SELECT COUNT(ID) FROM Patient WHERE SEX = 'F' AND Diagnosis = 'APS' | 1,198 | simple |
thrombosis_prediction | Please provide the diagnosis of patients with ALT glutamic pylvic transaminase beyond the normal range by ascending order of their date of birth. | ALT glutamic pylvic transaminase beyond the normal range refers to GPT > 60; ascending order of their date of birth refers to MAX(Birthday) | SELECT DISTINCT T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GPT > 60 ORDER BY T1.Birthday ASC | 1,209 | moderate |
card_games | In duels, what are the top 10 cards with the highest uncoverted mana cost? | duels refer to format = 'duel'; the highest uncoverted mana cost refers to MAX(manaCost) | SELECT DISTINCT name FROM cards WHERE uuid IN ( SELECT uuid FROM legalities WHERE format = 'duel' ) ORDER BY manaCost DESC LIMIT 0, 10 | 514 | simple |
financial | For accounts in 1993 with statement issued after transaction, list the account ID, district name and district region. | Records about district names could be found in A2; A3 contains the information about regions. 'POPLATEK PO OBRATU' stands for issuance after transaction | SELECT T1.account_id, T2.A2, T2.A3 FROM account AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.frequency = 'POPLATEK PO OBRATU' AND STRFTIME('%Y', T1.date)= '1993' | 119 | moderate |
card_games | What's the unconverted mana cost of the card "Ancestor's Chosen"? | card "Ancestor's Chosen" refers to name = 'Ancestor`s Chosen' | SELECT DISTINCT manaCost FROM cards WHERE name = 'Ancestor''s Chosen' | 453 | simple |
european_football_2 | Which player has the strongest overall strength? | overall strength refers to overall_rating; strongest overall strength refers to MAX(overall_rating); | SELECT t1.player_name FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id ORDER BY t2.overall_rating DESC LIMIT 1 | 1,083 | simple |
student_club | What is the total expense for the Yearly Kickoff? | 'Baseball game' is an event name; total expense refers to SUM(cost) | SELECT SUM(T3.cost) FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event INNER JOIN expense AS T3 ON T2.budget_id = T3.link_to_budget WHERE T1.event_name = 'Yearly Kickoff' | 1,386 | simple |
financial | How many accounts who have region in Prague are eligible for loans? | A3 contains the data of region | SELECT COUNT(T1.account_id) FROM account AS T1 INNER JOIN loan AS T2 ON T1.account_id = T2.account_id INNER JOIN district AS T3 ON T1.district_id = T3.district_id WHERE T3.A3 = 'Prague' | 90 | simple |
formula_1 | From 2000 to 2005, what percentage of drivers who were born before 1985 and the lap numbers were over 50? | born before 1985 refers to year(dob)<1985; in 2000 to 2005 refers to year between 2000 and 2005; percentage = Divide(COUNT(driverId where year (dob) <1985 and laps >50),COUNT(DriverID where year between 2000 and 2005) *100; | SELECT CAST(SUM(IIF(STRFTIME('%Y', T3.dob) < '1985' AND T1.laps > 50, 1, 0)) AS REAL) * 100 / COUNT(*) FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId INNER JOIN drivers AS T3 on T1.driverId = T3.driverId WHERE T2.year BETWEEN 2000 AND 2005 | 962 | challenging |
debit_card_specializing | Which gas station has the highest amount of revenue? | SELECT GasStationID FROM transactions_1k GROUP BY GasStationID ORDER BY SUM(Price) DESC LIMIT 1 | 1,527 | simple |
|
codebase_community | What are the post history type IDs for post ID 3720 and how many unique users have commented on the post? | SELECT T1.PostHistoryTypeId, (SELECT COUNT(DISTINCT UserId) FROM comments WHERE PostId = 3720) AS NumberOfUsers FROM postHistory AS T1 WHERE T1.PostId = 3720 | 599 | simple |
|
codebase_community | How many votes were made by Harlan? | DisplayName = 'Harlan'; | SELECT COUNT(T1.Id) FROM users AS T1 INNER JOIN postHistory AS T2 ON T1.Id = T2.UserId INNER JOIN votes AS T3 ON T3.PostId = T2.PostId WHERE T1.DisplayName = 'Harlan' | 632 | simple |
student_club | List emails of people who paid more than 20 dollars from 9/10/2019 to 11/19/2019. | expense_date BETWEEN '2019-09-10' and '2019-11-19'; cost > 20 | SELECT DISTINCT T1.email FROM member AS T1 INNER JOIN expense AS T2 ON T1.member_id = T2.link_to_member WHERE date(SUBSTR(T2.expense_date, 1, 10)) BETWEEN '2019-09-10' AND '2019-11-19' AND T2.cost > 20 | 1,440 | moderate |
card_games | List the expansion type of the set "Huitième édition". | the set "Huitième édition" refers to translation = 'Huitième édition'; expansion type refers to type | SELECT type FROM sets WHERE code IN ( SELECT setCode FROM set_translations WHERE translation = 'Huitième édition' ) | 497 | simple |
superhero | What are the race and alignment of Cameron Hicks? | Cameron Hicks refers to superhero_name = 'Cameron Hicks'; | SELECT T2.race, T3.alignment FROM superhero AS T1 INNER JOIN race AS T2 ON T1.race_id = T2.id INNER JOIN alignment AS T3 ON T1.alignment_id = T3.id WHERE T1.superhero_name = 'Cameron Hicks' | 787 | simple |
european_football_2 | Calculate the percentage of players who prefer left foot, who were born between 1987 and 1992. | players who prefer left foot refers to preferred_foot = 'left'; percentage of players who prefer left foot = DIVIDE(MULTIPLY((SUM(preferred_foot = 'left'), 1.0)), COUNT(player_fifa_api_id)); born between 1987 and 1992 refers to birthday BETWEEN '1987-01-01 00:00:00'AND '1992-12-31 00:00:00'; | SELECT CAST(COUNT(CASE WHEN t2.preferred_foot = 'left' THEN t1.id ELSE NULL END) AS REAL) * 100 / COUNT(t1.id) percent FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE SUBSTR(t1.birthday, 1, 4) BETWEEN '1987' AND '1992' | 1,037 | challenging |
toxicology | List out the atom id that belongs to the TR346 molecule and how many bond type can be created by this molecule? | SELECT T1.atom_id, COUNT(DISTINCT T2.bond_type) FROM atom AS T1 INNER JOIN bond AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.molecule_id = 'TR346' GROUP BY T1.atom_id, T2.bond_type | 309 | simple |
|
card_games | State the set code of the set with release date of 07/13/2007? | SELECT T2.setCode FROM sets AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.code WHERE T1.releaseDate = '2007-07-13' | 441 | simple |
|
superhero | Among the superheroes with height from 170 to 190, list the names of the superheroes with no eye color. | height from 170 to 190 refers to height_cm BETWEEN 170 AND 190; no eye color refers to eye_colour_id = 1 | SELECT DISTINCT T1.superhero_name FROM superhero AS T1 INNER JOIN colour AS T2 ON T1.eye_colour_id = T2.id WHERE T1.height_cm BETWEEN 170 AND 190 AND T2.colour LIKE 'No Colour' | 753 | moderate |
student_club | What was Brent Thomason's major? | major refers to major_name | SELECT T2.major_name FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.first_name = 'Brent' AND T1.last_name = 'Thomason' | 1,351 | simple |
thrombosis_prediction | For the patient who was born on 1959/2/18, what is the decrease rate for his/her total cholesterol from November to December in 1981? | born on 1959/2/18 refers to Birthday = '1959-02-18'; calculation = SUBTRACT(SUM(Birthday = '1959-02-18' and Date like '1981-11-%' THEN `T-CHO`), SUM(Birthday = '1959-02-18' and Date like '1981-12-%' THEN `T-CHO`)) | SELECT CAST((SUM(CASE WHEN T2.Date LIKE '1981-11-%' THEN T2.`T-CHO` ELSE 0 END) - SUM(CASE WHEN T2.Date LIKE '1981-12-%' THEN T2.`T-CHO` ELSE 0 END)) AS REAL) / SUM(CASE WHEN T2.Date LIKE '1981-12-%' THEN T2.`T-CHO` ELSE 0 END) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Birthday = '1959-02-18' | 1,185 | challenging |
formula_1 | Which drivers who were born in 1971 and has the fastest lap time on the race? Give id and code of these drivers. | born in 1971 refers to year(dob) = 1971; has the fastest lap time refers to fastestLapTime has values | SELECT T2.driverId, T2.code FROM results AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId WHERE STRFTIME('%Y', T2.dob) = '1971' AND T1.fastestLapTime IS NOT NULL | 972 | moderate |
formula_1 | What is the fastest lap number of the champion in 2009? | in 2009 refers to year = 2009; Only the time of the champion shows in the format of "hour: minutes: seconds.millionsecond" | SELECT T1.fastestLap FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T2.year = 2009 AND T1.time LIKE '_:%:__.___' | 959 | simple |
codebase_community | Among the posts owned by csgillespie, how many of them are root posts? | "csgillespie" is the DisplayName of user; root post refers to ParentId IS Null | SELECT COUNT(T1.Id) FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T2.DisplayName = 'csgillespie' AND T1.ParentId IS NULL | 545 | simple |
student_club | What department offers the major that Pierce and Guidi took? | SELECT T2.department FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.last_name = 'Pierce' OR T1.last_name = 'Guidi' | 1,336 | simple |
|
formula_1 | List all races in 2017 and the hosting country order by date of the event. | SELECT DISTINCT T2.name, T1.country FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T2.year = 2017 ORDER BY T2.date ASC | 907 | simple |
|
card_games | What is the most common visual frame effects among the incredibly powerful foils? | when both cardKingdomFoilId and cardKingdomId are not null, this foil is incredibly powerful; most common visual frame effects refers to MAX(frameEffects) | SELECT frameEffects FROM cards WHERE cardKingdomFoilId IS NOT NULL AND cardKingdomId IS NOT NULL GROUP BY frameEffects ORDER BY COUNT(frameEffects) DESC LIMIT 1 | 511 | moderate |
formula_1 | What is the location coordinates of the circuits for Australian grand prix? | coordinates refers to (lat, lng); | SELECT DISTINCT T1.lat, T1.lng FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T2.name = 'Australian Grand Prix' | 854 | simple |
card_games | For all cards illustrated by Jim Pavelec. and describe the text of the ruling of these cards. Do these cards have missing or degraded properties and values. | all cards illustrated by Jim Pavelec refers to artist = 'Jim Pavelec'; the text of the ruling refers to text; cards have missing or degraded properties and values if hasContentWarning = 1 else it doesn't have; | SELECT T2.text , CASE WHEN T1.hasContentWarning = 1 THEN 'YES' ELSE 'NO' END FROM cards AS T1 INNER JOIN rulings AS T2 ON T2.uuid = T1.uuid WHERE T1.artist = 'Jim Pavelec' | 494 | challenging |
formula_1 | How many races in the year 2010 are held on grand prixs outside Asia and Europe? | SELECT COUNT(T3.raceId) FROM circuits AS T1 INNER JOIN races AS T3 ON T3.circuitID = T1.circuitId WHERE T1.country NOT IN ( 'Bahrain', 'China', 'Singapore', 'Japan', 'Korea', 'Turkey', 'UAE', 'Malaysia', 'Spain', 'Monaco', 'Azerbaijan', 'Austria', 'Belgium', 'France', 'Germany', 'Hungary', 'Italy', 'UK' ) AND T3.year = 2010 | 852 | moderate |
|
toxicology | Which toxic element can be found in the molecule TR151? | element = 'cl' means Chlorine; element = 'c' means Carbon; element = 'h' means Hydrogen; element = 'o' means Oxygen, element = 's' means Sulfur; element = 'n' means Nitrogen, element = 'p' means Phosphorus, element = 'na' means Sodium, element = 'br' means Bromine, element = 'f' means Fluorine; element = 'i' means Iodine; element = 'sn' means Tin; element = 'pb' means Lead; element = 'te' means Tellurium; element = 'ca' means Calcium | SELECT DISTINCT T.element FROM atom AS T WHERE T.molecule_id = 'TR151' | 290 | challenging |
superhero | What is the eye clolour of the heaviest superhero? | the heaviest superhero refers to MAX(weight_kg); eye colour refers to colour where eye_colour_id = colour.id; | SELECT T2.colour FROM superhero AS T1 INNER JOIN colour AS T2 ON T1.eye_colour_id = T2.id ORDER BY T1.weight_kg DESC LIMIT 1 | 759 | simple |
european_football_2 | What is the name of the football league in the country of Netherlands? | name of the football league refers to League.name; | SELECT t2.name FROM Country AS t1 INNER JOIN League AS t2 ON t1.id = t2.country_id WHERE t1.name = 'Netherlands' | 1,056 | simple |
european_football_2 | Find the average number of long-shot done by Ahmed Samir Farag. | average number of long shot = DIVIDE(SUM(long_shots), COUNT(player_fifa_api_id)); | SELECT CAST(SUM(t2.long_shots) AS REAL) / COUNT(t2.`date`) FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.player_name = 'Ahmed Samir Farag' | 1,039 | simple |
codebase_community | Mention the display name and location of the user who owned the excerpt post with hypothesis-testing tag. | user who owned the excerpt post with hypothesis-testing tag refers to OwnerUserId WHERE TagName = 'hypothesis-testing'; | SELECT T3.DisplayName, T3.Location FROM tags AS T1 INNER JOIN posts AS T2 ON T1.ExcerptPostId = T2.Id INNER JOIN users AS T3 ON T3.Id = T2.OwnerUserId WHERE T1.TagName = 'hypothesis-testing' | 654 | moderate |
codebase_community | Which post by slashnick has the most answers count? State the post ID. | most answers count refers to MAX(AnswerCount); DisplayName = 'slashnick'; | SELECT T2.PostId FROM users AS T1 INNER JOIN postHistory AS T2 ON T1.Id = T2.UserId INNER JOIN posts AS T3 ON T2.PostId = T3.Id WHERE T1.DisplayName = 'slashnick' ORDER BY T3.AnswerCount DESC LIMIT 1 | 633 | moderate |
european_football_2 | Which of these players performs the best in crossing actions, Alexis, Ariel Borysiuk or Arouna Kone? | player who perform best in crossing actions refers to MAX(crossing); | SELECT t1.player_name, t2.crossing FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.player_name IN ('Alexis', 'Ariel Borysiuk', 'Arouna Kone') ORDER BY t2.crossing DESC LIMIT 1 | 1,085 | moderate |
financial | Who placed the order with the id 32423? | SELECT T3.client_id FROM `order` AS T1 INNER JOIN account AS T2 ON T1.account_id = T2.account_id INNER JOIN client AS T3 ON T2.district_id = T3.district_id WHERE T1.order_id = 32423 | 164 | simple |
|
formula_1 | What's the location coordinates of Silverstone Circuit? | coordinates refers to (lat, lng) | SELECT lat, lng FROM circuits WHERE name = 'Silverstone Circuit' | 910 | simple |
card_games | Among the sets in the block "Ice Age", how many of them have an Italian translation? | sets in the block "Ice Age" refers to block = 'Ice Age'; Italian translation refers to language = 'Italian' | SELECT COUNT(DISTINCT T1.id) FROM sets AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.code WHERE T1.block = 'Ice Age' AND T2.language = 'Italian' AND T2.translation IS NOT NULL | 472 | moderate |
toxicology | What are the atoms of the triple bond with the molecule "TR447"? | TR447 is the molecule id; triple bond refers to bond_type = '#'; | SELECT T2.atom_id, T2.atom_id2 FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id INNER JOIN bond AS T3 ON T2.bond_id = T3.bond_id WHERE T3.bond_type = '#' AND T3.molecule_id = 'TR447' | 248 | simple |
thrombosis_prediction | Please list the ID of the patient whose RF is normal and who is older than 60. | RF is normal refers to RF < 20; older than 60 = SUBTRACT((YEAR(CURDATE()), YEAR(Birthday))) > 60; | SELECT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.RF < 20 AND STRFTIME('%Y', DATE('now')) - STRFTIME('%Y', T1.Birthday) > 60 | 1,260 | simple |
european_football_2 | How many players whose first names are Adam and weigh more than 170? | team names refers to team_long_name; speed class refers to buildUpPlaySpeedClass; buildUpPlaySpeedClass = 'Fast'; | SELECT COUNT(id) FROM Player WHERE weight > 170 AND player_name LIKE 'Adam%' | 1,061 | simple |
card_games | List the artists who illustrated cards with black borders which are available only in arena. | black borders refers to BorderColor = 'black'; available only in arena refers to availability = 'arena' | SELECT DISTINCT artist FROM cards WHERE availability = 'arena' AND BorderColor = 'black' | 524 | simple |
formula_1 | State the race and year of race in which Michael Schumacher had his fastest lap. | fastest lap refers to min(milliseconds) | SELECT T1.name, T1.year FROM races AS T1 INNER JOIN lapTimes AS T2 ON T2.raceId = T1.raceId INNER JOIN drivers AS T3 ON T3.driverId = T2.driverId WHERE T3.forename = 'Michael' AND T3.surname = 'Schumacher' ORDER BY T2.milliseconds ASC LIMIT 1 | 904 | moderate |
financial | How often does account number 3 request an account statement to be released? What was the aim of debiting 3539 in total? | k_symbol refers to the purpose of payments | SELECT T1.frequency, T2.k_symbol FROM account AS T1 INNER JOIN `order` AS T2 ON T1.account_id = T2.account_id WHERE T1.account_id = 3 AND T2.amount = 3539 | 173 | simple |
student_club | What is the name and major of members who had to spend more than a hundred dollars on an expense? | full name refers to first_name, last_name; major of members refers to major_name; spend more than a hundred dollars on an expense refers to cost > 100 | SELECT DISTINCT T1.first_name, T1.last_name, T2.major_name FROM member AS T1 INNER JOIN major AS T2 ON T2.major_id = T1.link_to_major INNER JOIN expense AS T3 ON T1.member_id = T3.link_to_member WHERE T3.cost > 100 | 1,449 | moderate |
student_club | What city and state did the President of the Student_Club grow up? | 'President' is a position of Student Club; | SELECT T2.city, T2.state FROM member AS T1 INNER JOIN zip_code AS T2 ON T1.zip = T2.zip_code WHERE T1.position = 'President' | 1,333 | simple |
toxicology | What elements are in the TR004_8_9 bond atoms? | TR004_8_9 bond atoms refers to bond_id = 'TR004_8_9'; element = 'cl' means Chlorine; element = 'c' means Carbon; element = 'h' means Hydrogen; element = 'o' means Oxygen, element = 's' means Sulfur; element = 'n' means Nitrogen, element = 'p' means Phosphorus, element = 'na' means Sodium, element = 'br' means Bromine, element = 'f' means Fluorine; element = 'i' means Iodine; element = 'sn' means Tin; element = 'pb' means Lead; element = 'te' means Tellurium; element = 'ca' means Calcium | SELECT DISTINCT T1.element FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id WHERE T2.bond_id = 'TR004_8_9' | 206 | challenging |
debit_card_specializing | Is it true that more SMEs pay in Czech koruna than in euros? If so, how many more? | Amount of more SMEs = Total of SMEs uses Czech Koruna - Total of SMEs uses Euro | SELECT SUM(Currency = 'CZK') - SUM(Currency = 'EUR') FROM customers WHERE Segment = 'SME' | 1,486 | simple |
debit_card_specializing | What was the average monthly consumption of customers in SME for the year 2013? | Average Monthly consumption = AVG(Consumption) / 12; Year 2013 can be presented as Between 201301 And 201312, which means between January and December in 2013 | SELECT AVG(T2.Consumption) / 12 FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE SUBSTRING(T2.Date, 1, 4) = '2013' AND T1.Segment = 'SME' | 1,473 | moderate |
toxicology | What are the atoms that can bond with the atom that has the element lead? | atom that has the element lead refers to atom_id where element = 'pb' | SELECT T2.atom_id, T2.atom_id2 FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id WHERE T1.element = 'pb' | 252 | simple |
card_games | How many null power cards contain info about the triggered ability | null power cards refers to power is NULL; unknown power cards refers to power is null or power = '*' | SELECT T2.text FROM cards AS T1 INNER JOIN rulings AS T2 ON T1.uuid = T2.uuid WHERE (T1.power IS NULL OR T1.power LIKE '%*%') AND T2.text LIKE '%triggered ability%' | 408 | moderate |
formula_1 | What is Eddie Irvine's average points scored in year 2000? | average points = AVG(points where year = 2000) | SELECT AVG(T2.points) FROM drivers AS T1 INNER JOIN driverStandings AS T2 ON T2.driverId = T1.driverId INNER JOIN races AS T3 ON T3.raceId = T2.raceId WHERE T1.forename = 'Eddie' AND T1.surname = 'Irvine' AND T3.year = 2000 | 905 | simple |
card_games | When was the ruling for the card 'Reminisce' created? | Reminisce refers to name = 'Reminisce'; when created is the date | SELECT T2.date FROM cards AS T1 INNER JOIN rulings AS T2 ON T2.uuid = T1.uuid WHERE T1.name = 'Reminisce' | 485 | simple |
student_club | Among the members, how many of them have an extra large t-shirt size? | among the members refers to position = 'Member'; extra large t-shirt size refers to t_shirt_size = 'X-Large' | SELECT COUNT(member_id) FROM member WHERE position = 'Member' AND t_shirt_size = 'X-Large' | 1,424 | simple |
formula_1 | Find the full name, Wiki Pedia page link, and date of birth of German drivers born between 1971 and 1985. List it in descending order of date of birth. | FFull name refers to forname+surname; Nationality refers to German; Date of birth refers to dob; year(dob) BETWEEN '1971' AND '1985' | SELECT forename, surname, url, dob FROM drivers WHERE nationality = 'German' AND STRFTIME('%Y', dob) BETWEEN '1971' AND '1985' ORDER BY dob DESC | 992 | moderate |
european_football_2 | For the teams with normal build-up play dribbling class in 2014, List the names of the teams with less than average chance creation passing, in descending order of chance creation passing. | normal build-up play dribbling class refers to buildUpPlayDribblingClass = 'Normal'; in 2014 refers to date > = '2014-01-01 00:00:00' AND date < = '2014-01-31 00:00:00'; names of the teams refers to team_long_name; less than average chance creation passing = DIVIDE(SUM(chanceCreationPassing), COUNT(id)) > chanceCreationPassing; | SELECT t3.team_long_name FROM Team AS t3 INNER JOIN Team_Attributes AS t4 ON t3.team_api_id = t4.team_api_id WHERE t4.buildUpPlayDribblingClass = 'Normal' AND t4.chanceCreationPassing < ( SELECT CAST(SUM(t2.chanceCreationPassing) AS REAL) / COUNT(t1.id) FROM Team AS t1 INNER JOIN Team_Attributes AS t2 ON t1.team_api_id = t2.team_api_id WHERE t2.buildUpPlayDribblingClass = 'Normal' AND SUBSTR(t2.`date`, 1, 4) = '2014') ORDER BY t4.chanceCreationPassing DESC | 1,041 | challenging |
california_schools | What is the ratio of merged Unified School District schools in Orange County to merged Elementary School District schools? | Elementary School District refers to DOC = 52; Unified School District refers to DOC = 54. | SELECT CAST(SUM(CASE WHEN DOC = 54 THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN DOC = 52 THEN 1 ELSE 0 END) FROM schools WHERE StatusType = 'Merged' AND County = 'Orange' | 48 | moderate |
codebase_community | Which user ID has the lowest view? | lowest views refers to Min(Views) | SELECT Id FROM users WHERE Views = ( SELECT MIN(Views) FROM users ) | 590 | simple |
formula_1 | Paul di Resta was in the No. 853 race, what percent faster did he finish in the 853rd race than the next race for the fastest lap speed? | race number refers to raceId; DIVIDE(SUBTRACT(fastestLapSpeed(raceId = 853), (fastestLapSpeed (raceId = 854)), (fastestLapSpeed(raceId = 853)) as percentage | SELECT (SUM(IIF(T2.raceId = 853, T2.fastestLapSpeed, 0)) - SUM(IIF(T2.raceId = 854, T2.fastestLapSpeed, 0))) * 100 / SUM(IIF(T2.raceId = 853, T2.fastestLapSpeed, 0)) FROM drivers AS T1 INNER JOIN results AS T2 ON T2.driverId = T1.driverId WHERE T1.forename = 'Paul' AND T1.surname = 'di Resta' | 880 | challenging |
thrombosis_prediction | How many female patients born in 1964 were admitted to the hospital? List them by ID. | female refers to SEX = 'F'; born in 1964 refers to YEAR(Birthday) = 1964; admitted to the hospital refers to Admission = '+' | SELECT ID FROM Patient WHERE STRFTIME('%Y', Birthday) = '1964' AND SEX = 'F' AND Admission = '+' | 1,188 | simple |
thrombosis_prediction | For all female patient with total protein (TP) beyond the normal index, what is the deviation of their TP idex from the normal. | female refers to SEX = 'F'; total protein (TP) beyond the normal index refers to TP > 8.5;
deviation of TP index from normal refers to SUBTRACT(TP, 8.5) | SELECT T2.TP - 8.5 FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'F' AND T2.TP > 8.5 | 1,215 | moderate |
formula_1 | How many times the circuits were held in Austria? Please give their location and coordinates. | location coordinates refers to (lat,lng); | SELECT DISTINCT location, lat, lng FROM circuits WHERE country = 'Austria' | 978 | simple |
Subsets and Splits