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 |
---|---|---|---|---|---|
superhero | How many superheroes did DC Comics publish? | superheroes that DC Comics published refers to publisher_name = 'DC Comics' | SELECT COUNT(T1.id) FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'DC Comics' | 731 | simple |
card_games | Among the cards with a white border color, how many of them have unknown power? | unknown power refers to power = '*' or power is null | SELECT SUM(CASE WHEN power LIKE '%*%' OR power IS NULL THEN 1 ELSE 0 END) FROM cards WHERE borderColor = 'white' | 454 | simple |
codebase_community | How many users were adult? | adult refers to user where Age BETWEEN 19 and 65; | SELECT COUNT(id) FROM users WHERE Age BETWEEN 19 AND 65 | 627 | simple |
codebase_community | List out all post that are related to post ID 61217 and what is the popularity of this post? | post related refers to RelatedPostId; popularity refers to ViewCount | SELECT T1.ViewCount FROM posts AS T1 INNER JOIN postLinks AS T2 ON T1.Id = T2.PostId WHERE T2.PostId = 61217 | 600 | simple |
financial | How many credit card withdrawals were recorded after 1995? | Operation = 'VYBER KARTOU' means credit card withdrawals | SELECT COUNT(account_id) FROM trans WHERE STRFTIME('%Y', date) > '1995' AND operation = 'VYBER KARTOU' | 170 | simple |
toxicology | What is the percentage of element chlorine in carcinogenic molecules? | chlorine refers to element = 'cl'; label = '+' mean molecules are carcinogenic; percentage = DIVIDE(SUM(element = 'pb'); COUNT(molecule_id)) as percentage where label = '+' | SELECT CAST(COUNT( CASE WHEN T1.element = 'cl' THEN T1.element ELSE NULL END) AS REAL) * 100 / COUNT(T1.element) FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '+' | 273 | moderate |
financial | How many female clients' accounts are in the region of South Bohemia? | Female refers to gender = 'F'; A3 contains the region 'south Bohemia' | SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.gender = 'F' AND T2.A3 = 'south Bohemia' | 147 | simple |
student_club | Among the students majored in interior design, who have attended the Community Theater event? | majored in music refers to major_name = 'Interior Design'; 'Community Theater' is the event name; | SELECT T2.first_name, T2.last_name FROM major AS T1 INNER JOIN member AS T2 ON T1.major_id = T2.link_to_major INNER JOIN attendance AS T3 ON T2.member_id = T3.link_to_member INNER JOIN event AS T4 ON T3.link_to_event = T4.event_id WHERE T4.event_name = 'Community Theater' AND T1.major_name = 'Interior Design' | 1,382 | moderate |
toxicology | Which molecule does the atom TR001_10 belong to? Please state whether this molecule is carcinogenic or not. | TR001_10 is the atom id; label = '+' mean molecules are carcinogenic | SELECT T2.molecule_id , IIF(T2.label = '+', 'YES', 'NO') AS flag_carcinogenic FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.atom_id = 'TR001_10' | 237 | moderate |
california_schools | What is the lowest grade for the District Special Education Consortia School with National Center for Educational Statistics school district identification number of 613360? | District Special Education Consortia School refers to EdOpsCode = 'SPECON'. | SELECT MIN(T1.`Low Grade`) FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.NCESDist = 613360 AND T2.EdOpsCode = 'SPECON' | 74 | moderate |
superhero | List the hero ID of superheroes have intellegence as their power. | hero ID refers to superhero.id; have intelligence as their power refers to power_name = 'Intelligence'; | SELECT T1.hero_id FROM hero_power AS T1 INNER JOIN superpower AS T2 ON T1.power_id = T2.id WHERE T2.power_name = 'Intelligence' | 843 | simple |
superhero | How many gold-eyed superheroes did Marvel Comics publish? | gold-eyed refers to colour = 'Gold' where eye_colour_id = colour.id; superheroes that Marvel Comics published refers to publisher_name = 'Marvel Comics' | SELECT COUNT(T1.id) FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id INNER JOIN colour AS T3 ON T1.eye_colour_id = T3.id WHERE T2.publisher_name = 'Marvel Comics' AND T3.colour = 'Gold' | 733 | moderate |
thrombosis_prediction | For the patient with the highest lactate dehydrogenase in the normal range, when was his or her data first recorded? | highest lactate dehydrogenase in the normal range refers to MAX(LDH < 500); when the data first recorded refers to MIN(First Date); | SELECT T1.`First Date` FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.LDH < 500 ORDER BY T2.LDH DESC LIMIT 1 | 1,284 | moderate |
financial | Which districts have transactions greater than USS$10,000 in 1997? | SELECT T1.district_id FROM account AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN trans AS T3 ON T1.account_id = T3.account_id WHERE STRFTIME('%Y', T3.date) = '1997' GROUP BY T1.district_id HAVING SUM(T3.amount) > 10000 | 141 | simple |
|
thrombosis_prediction | How many patients diagnosed with SLE have a normal white blood cell level? | diagnosed with SLE refers to Diagnosis = 'SLE'; normal white blood cell level refers to WBC between 3.5 and 9.0; | SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Diagnosis = 'SLE' AND T2.WBC BETWEEN 3.5 AND 9 | 1,306 | simple |
superhero | List the skin colour of the superheroes with 100 attribute value. | skin colour refers to colour.colour where skin_colour_id = colour.id; 100 attribute value refers to attribute_value = 100; | SELECT DISTINCT T2.colour FROM superhero AS T1 INNER JOIN colour AS T2 ON T1.skin_colour_id = T2.id INNER JOIN hero_attribute AS T3 ON T1.id = T3.hero_id WHERE T3.attribute_value = 100 | 814 | moderate |
codebase_community | Which user made a post titled 'Understanding what Dassault iSight is doing?' and how much is the reputation of the user? | "Understanding what Dassault iSight is doing?" is the Title of post; user refers to DisplayName; | SELECT T1.DisplayName, T1.Reputation FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId WHERE T2.Title = 'Understanding what Dassault iSight is doing?' | 578 | moderate |
formula_1 | How many drivers from the USA participated in the 2008 Australian Grand Prix? | from the USA refers to nationality = 'American' | SELECT COUNT(*) FROM drivers AS T1 INNER JOIN results AS T2 ON T1.driverId = T2.driverId INNER JOIN races AS T3 ON T3.raceId = T2.raceId WHERE T3.name = 'Australian GrAND Prix' AND T1.nationality = 'American' AND T3.year = 2008 | 939 | moderate |
debit_card_specializing | How many percent of LAM customer consumed more than 46.73? | Percentage of LAM customer consumed more than 46.73 = (Total no. of LAM customers who consumed more than 46.73 / Total no. of LAM customers) * 100%. | SELECT CAST(SUM(IIF(T2.Consumption > 46.73, 1, 0)) AS FLOAT) * 100 / COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Segment = 'LAM' | 1,490 | moderate |
superhero | In superheroes with missing weight data, calculate the difference between the number of superheroes with blue eyes and no eye color. | missing weight data refers to weight_kg = 0 OR T1.weight_kg = NULL; difference = SUBTRACT(SUM(colour.id = 7), SUM(colour.id = 1)); blue eyes refers to eye_colour_id WHERE colour.id = 7; no eye color refers to eye_colour_id WHERE colour.id = 1; | SELECT SUM(CASE WHEN T2.id = 7 THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.id = 1 THEN 1 ELSE 0 END) FROM superhero AS T1 INNER JOIN colour AS T2 ON T1.eye_colour_id = T2.id WHERE T1.weight_kg = 0 OR T1.weight_kg is NULL | 819 | challenging |
card_games | What are the available printing types of the cards that doesn't have a text box created by Aleksi Briclot? | created by Aleksi Briclot refers to artist = 'Aleksi Briclot'; doesn't have a text box refers to isTextless = 1; available printing types refers to availability | SELECT DISTINCT availability FROM cards WHERE artist = 'Aleksi Briclot' AND isTextless = 1 | 508 | moderate |
codebase_community | User No.3025 gave a comment at 20:29:39 on 2014/4/23 to a post, how many favorite counts did that post get? | user no. 3025 refers to UserId = '3025'; comment at 20:29:39 on 2014/4/23 refers to CreationDate = '2014/4/23 20:29:39.0' | SELECT T1.FavoriteCount FROM posts AS T1 INNER JOIN comments AS T2 ON T1.Id = T2.PostId WHERE T2.CreationDate = '2014-04-23 20:29:39.0' AND T2.UserId = 3025 | 563 | moderate |
thrombosis_prediction | How many patients who underwent testing in 1997 had protein levels outside the normal range? | underwent testing in 1997 refers to YEAR(DATE) = '1997'; protein levels within the normal range refers to tp > 6 and tp < 8.5 | SELECT COUNT(ID) FROM Laboratory WHERE ALB <= 6.0 OR ALB >= 8.5 AND STRFTIME('%Y', Date) = '1997' | 1,199 | simple |
student_club | Indicate the cost of posters for 'September Speaker' event. | 'Posters' is the expense description; 'September Speaker' is an event name | SELECT 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 = 'September Speaker' AND T3.expense_description = 'Posters' | 1,401 | moderate |
formula_1 | How many French constructors have a lap number of over 50? | lap numbers of over 50 refers to laps > 50; | SELECT COUNT(DISTINCT T2.constructorId) FROM results AS T1 INNER JOIN constructors AS T2 on T1.constructorId = T2.constructorId WHERE T1.laps > 50 AND T2.nationality = 'French' | 953 | simple |
student_club | What was the cost for the "Posters" on 2019/9/4? | 'Poster' is an event description; on 2019/9/14 refers to event_date = '2019-09-04' | SELECT cost FROM expense WHERE expense_description = 'Posters' AND expense_date = '2019-09-04' | 1,342 | simple |
card_games | Among the cards in the set "Hauptset Zehnte Edition", how many of them are designed by Adam Rex? | card set "Hauptset Zehnte Edition" refers to translation = 'Hauptset Zehnte Edition'; designed by Adam refers to artist = 'Adam Rex' | SELECT COUNT(T1.id) FROM cards AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.setCode WHERE T2.translation = 'Hauptset Zehnte Edition' AND T1.artist = 'Adam Rex' | 466 | moderate |
financial | List all the withdrawals in cash transactions that the client with the id 3356 makes. | operation = 'VYBER' refers to withdrawal in cash | SELECT T4.trans_id FROM client AS T1 INNER JOIN disp AS T2 ON T1.client_id = T2.client_id INNER JOIN account AS T3 ON T2.account_id = T3.account_id INNER JOIN trans AS T4 ON T3.account_id = T4.account_id WHERE T1.client_id = 3356 AND T4.operation = 'VYBER' | 159 | simple |
california_schools | Among the schools with the average score in Math over 560 in the SAT test, how many schools are directly charter-funded? | SELECT COUNT(T2.`School Code`) FROM satscores AS T1 INNER JOIN frpm AS T2 ON T1.cds = T2.CDSCode WHERE T1.AvgScrMath > 560 AND T2.`Charter Funding Type` = 'Directly funded' | 9 | simple |
|
student_club | How many meeting events were held in 2020? | meeting events refers to type = 'Meeting'; held in 2020 refers to YEAR(event_date) = 2020 | SELECT COUNT(event_id) FROM event WHERE type = 'Meeting' AND SUBSTR(event_date, 1, 4) = '2020' | 1,379 | simple |
superhero | How many superheroes have blue eyes? | blue eyes refers to colour = 'Blue' and eye_colour_id = colour.id; | SELECT COUNT(T1.id) FROM superhero AS T1 INNER JOIN colour AS T2 ON T1.eye_colour_id = T2.id WHERE T2.colour = 'Blue' | 721 | simple |
thrombosis_prediction | Name the ID and age of patient with two or more laboratory examinations which show their hematoclit level exceeded the normal range. | age = SUBTRACT(year(current_timestamp), year(Birthday)); patient with two or more laboratory examinations refers to COUNT(ID) > 2; hematoclit level exceeded the normal range refers to HCT > = 52; | SELECT DISTINCT T1.ID, STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.ID IN ( SELECT ID FROM Laboratory WHERE HCT >= 52 GROUP BY ID HAVING COUNT(ID) >= 2 ) | 1,239 | challenging |
formula_1 | Which country is the oldest driver from? | oldest driver refers to min(dob) | SELECT nationality FROM drivers WHERE dob IS NOT NULL ORDER BY dob ASC LIMIT 1 | 915 | simple |
card_games | What proportion of cards do not have a text box with a normal layout? | do not have a text box refers to isTextless = 1; proportion refers to DIVIDE(COUNT(Textless = 1 and layout = 'normal'),COUNT(Textless))*100 | SELECT CAST(SUM(CASE WHEN isTextless = 1 AND layout = 'normal' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM cards | 424 | simple |
student_club | List the last name of members with a major in environmental engineering and include its department and college name. | 'Environmental Engineering' is the major name; | SELECT T2.last_name, T1.department, T1.college FROM major AS T1 INNER JOIN member AS T2 ON T1.major_id = T2.link_to_major WHERE T2.position = 'Member' AND T1.major_name = 'Environmental Engineering' | 1,426 | moderate |
formula_1 | Please list the year during which the race is held on circuits in Shanghai. | Shanghai is a name of location; | SELECT T2.year FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T1.location = 'Shanghai' | 848 | simple |
toxicology | Calculate the average number of oxygen atoms in single-bonded molecules. | single-bonded molecules refers to bond_type = '-' ; average number of oxygen atom = AVG(element = 'o') | SELECT AVG(oxygen_count) FROM (SELECT T1.molecule_id, COUNT(T1.element) AS oxygen_count FROM atom AS T1 INNER JOIN bond AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.bond_type = '-' AND T1.element = 'o' GROUP BY T1.molecule_id) AS oxygen_counts | 197 | moderate |
student_club | What is the event that has the highest attendance of the students from the Student_Club? | event with highest attendance refers to MAX(COUNT(link_to_event)) | SELECT T1.event_name FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event GROUP BY T1.event_name ORDER BY COUNT(T2.link_to_event) DESC LIMIT 1 | 1,318 | simple |
california_schools | Which state special schools have the highest number of enrollees from grades 1 through 12? | State Special Schools refers to DOC = 31; Grades 1 through 12 means K-12 | SELECT T2.School FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.DOC = 31 ORDER BY T1.`Enrollment (K-12)` DESC LIMIT 1 | 46 | simple |
card_games | How many types of cards does the artist Aaron Boyd illustrated about card art? | Aaron Boyd' is artist; | SELECT COUNT(type) FROM cards WHERE artist = 'Aaron Boyd' | 354 | simple |
card_games | Among the sets of cards that have an Italian translation, how many of them have a base set number of under 10? | Italian translation refers to language = 'Italian'; have a translation means translation is not null; base set number of under 10 refers to baseSetSize < 10 | SELECT COUNT(T1.id) FROM sets AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.code WHERE T2.translation IS NOT NULL AND T1.baseSetSize < 10 AND T2.language = 'Italian' | 474 | moderate |
formula_1 | In which race did the fastest 1st lap time was recorded? Please indicate the time in milliseconds. | fastest refers to Min(time); | SELECT T1.milliseconds FROM lapTimes AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T1.lap = 1 ORDER BY T1.time LIMIT 1 | 986 | simple |
student_club | What kind of expenses incurred by members who have X-Large in size of tee shirt? | kind of expenses refers to expense_description; t_shirt_size = 'X-Large' | SELECT T2.expense_description FROM member AS T1 INNER JOIN expense AS T2 ON T1.member_id = T2.link_to_member WHERE T1.t_shirt_size = 'X-Large' | 1,412 | simple |
codebase_community | For the post which got 1910 view counts, how many comments does it get? | SELECT COUNT(T1.Id) FROM posts AS T1 INNER JOIN comments AS T2 ON T1.Id = T2.PostId WHERE T1.ViewCount = 1910 | 562 | simple |
|
thrombosis_prediction | How many male patients have a normal level of both albumin and total protein? | male refers to Sex = 'M'; normal level of both albumin and total protein refers to ALB > 3.5 and ALB < 5.5 AND TP between 6.0 and 8.5; | SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'M' AND T2.ALB BETWEEN 3.5 AND 5.5 AND T2.TP BETWEEN 6.0 AND 8.5 | 1,291 | moderate |
california_schools | How many chartered schools located in the city of Hickman are owned by the Elementary School District? | Elementary School District refers to DOC = 52; Chartered schools refer to Charter = 1 in the table schools | SELECT COUNT(School) FROM schools WHERE DOC = 52 AND Charter = 1 AND City = 'Hickman' | 61 | simple |
debit_card_specializing | What percentage of KAM customers pay in euros? | Percentage of KAM uses Euro = (Total of KAM uses Euro / Total of KAM) * 100%. | SELECT CAST(SUM(Currency = 'EUR') AS FLOAT) * 100 / COUNT(CustomerID) FROM customers WHERE Segment = 'KAM' | 1,492 | simple |
card_games | What language is the set of 180 cards that belongs to the Ravnica block translated into? | set of 180 cards refers to baseSetSize = 180 | SELECT T2.language FROM sets AS T1 INNER JOIN set_translations AS T2 ON T1.code = T2.setCode WHERE T1.block = 'Ravnica' AND T1.baseSetSize = 180 | 414 | simple |
thrombosis_prediction | How many patients with a normal level of complement 3 have a P pattern observed in the sheet of ANA examination? | normal level of complement 3 refers to C3 > 35; have a P pattern observed in the sheet of ANA examination refers to ANA Pattern = 'P'; Should compute the number of distinct ones | SELECT COUNT(DISTINCT T1.ID) FROM Examination AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.C3 > 35 AND T1.`ANA Pattern` = 'P' | 1,262 | moderate |
formula_1 | How many drivers don't have a code? | don't have a code refers to code is null | SELECT COUNT(driverId) - COUNT(CASE WHEN code IS NOT NULL THEN code END) FROM drivers | 914 | simple |
codebase_community | When did "chl" cast its first vote in a post? | DisplayName = 'chl'; cast its first vote refers to MIN(CreationDate); | SELECT T2.CreationDate FROM users AS T1 INNER JOIN votes AS T2 ON T1.Id = T2.UserId WHERE T1.DisplayName = 'chl' ORDER BY T2.CreationDate LIMIT 1 | 669 | simple |
student_club | What is the highest amount of budget spend for an event? | highest amount of budget spend refers to MAX(spent) | SELECT MAX(spent) FROM budget | 1,378 | simple |
superhero | What is the percentage of blue female superheroes among all female superheroes? | percentage = MULTIPLY(DIVIDE(SUM(colour = 'Blue' WHERE gender = 'Female'), COUNT(gender = 'Female')), 100); blue refers to the color; female refers to gender = 'Female'; | SELECT CAST(COUNT(CASE WHEN T3.colour = 'Blue' THEN T1.id ELSE NULL END) AS REAL) * 100 / COUNT(T1.id) FROM superhero AS T1 INNER JOIN gender AS T2 ON T1.gender_id = T2.id INNER JOIN colour AS T3 ON T1.skin_colour_id = T3.id WHERE T2.gender = 'Female' | 775 | challenging |
california_schools | What is the number of SAT test takers of the schools with the highest FRPM count for K-12 students? | SELECT NumTstTakr FROM satscores WHERE cds = ( SELECT CDSCode FROM frpm ORDER BY `FRPM Count (K-12)` DESC LIMIT 1 ) | 8 | simple |
|
formula_1 | Which drivers born after 1975 have been ranked 2? Please give their forenames and surnames. | born after 1975 refers to year(dob) >1975; | SELECT T2.forename, T2.surname FROM results AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId WHERE STRFTIME('%Y', T2.dob) > '1975' AND T1.rank = 2 | 956 | simple |
california_schools | Which school in Contra Costa has the highest number of test takers? | SELECT sname FROM satscores WHERE cname = 'Contra Costa' AND sname IS NOT NULL ORDER BY NumTstTakr DESC LIMIT 1 | 22 | simple |
|
student_club | List out the full name and total cost that member id "rec4BLdZHS2Blfp4v" incurred? | full name refers to first_name, last name | SELECT T1.first_name, T1.last_name, SUM(T2.cost) FROM member AS T1 INNER JOIN expense AS T2 ON T1.member_id = T2.link_to_member WHERE T1.member_id = 'rec4BLdZHS2Blfp4v' | 1,410 | simple |
student_club | List out the type of events which have remaining budget more than 30 USD. | remaining budget more than 30 USD refers to remaining > 30 | SELECT T1.type FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T2.remaining > 30 | 1,417 | simple |
california_schools | Which schools served a grade span of Kindergarten to 9th grade in the county of Los Angeles and what is its Percent (%) Eligible FRPM (Ages 5-17)? | Percent (%) Eligible FRPM (Ages 5-17) can be acquired by `Free Meal Count (Ages 5-17)` / `Enrollment (Ages 5-17)` * 100% | SELECT T2.School, T1.`FRPM Count (Ages 5-17)` * 100 / T1.`Enrollment (Ages 5-17)` FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.County = 'Los Angeles' AND T2.GSserved = 'K-9' | 77 | moderate |
card_games | What is the language and flavor text of the card that has colorpie watermark? List out the type of this card. | SELECT DISTINCT T2.language, T2.flavorText FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T2.uuid = T1.uuid WHERE T1.watermark = 'colorpie' | 445 | simple |
|
codebase_community | Please list the display names of all the users who owns a post that is well-finished. | the post that is well-finished refers to ClosedDate IS NOT Null | SELECT T2.DisplayName FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T1.ClosedDate IS NOT NULL | 546 | simple |
financial | For the client who applied the biggest loan, what was his/her first amount of transaction after opened the account? | SELECT T2.amount FROM loan AS T1 INNER JOIN trans AS T2 ON T1.account_id = T2.account_id ORDER BY T1.amount DESC, T2.date ASC LIMIT 1 | 108 | simple |
|
thrombosis_prediction | Provide ID, sex and age of patient who has blood glucose (GLU) not within normal range but with total cholesterol(T-CHO) within normal range. | age = SUBTRACT(year(current_timestamp), year(Birthday)); blood glucose (GLU) not within normal range refers to GLU > = 180; total cholesterol(T-CHO) within normal range refers to `T-CHO` < 250; | SELECT DISTINCT T1.ID, T1.SEX , STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GLU >= 180 AND T2.`T-CHO` < 250 | 1,232 | challenging |
european_football_2 | What are the player api id of 10 heaviest players? | heaviest refers to MAX(weight) | SELECT player_api_id FROM Player ORDER BY weight DESC LIMIT 10 | 1,117 | simple |
student_club | List the event names which were budgeted for the food. | budgeted for food refers to category = 'Food' | SELECT T1.event_name FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T2.category = 'Food' | 1,463 | simple |
california_schools | What is the district code for the School that does not offer a magnet program in the city of Fresno? | When magent is equal to 0 in the database, it means ths school doesn't offer a magnet program. | SELECT T1.`District Code` FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.City = 'Fresno' AND T2.Magnet = 0 | 71 | simple |
debit_card_specializing | What's the nationality of the customer who spent 548.4 in 2012/8/24? | '2012/8/24' can be represented by '2012-08-24' | SELECT T2.Country FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T1.Date = '2012-08-24' AND T1.Price = 548.4 | 1,524 | simple |
superhero | List the full names of superheroes with missing weight. | missing weight refers to weight_kg = 0 OR weight_kg = NULL; | SELECT DISTINCT full_name FROM superhero WHERE full_name IS NOT NULL AND (weight_kg IS NULL OR weight_kg = 0) | 805 | simple |
thrombosis_prediction | How many patients who were female got white blood cells that were below 3.5? | female refers to SEX = 'F'; white blood cells that were below 3.5 refers to WBC < 3.5 | SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.WBC < 3.5 AND T1.SEX = 'F' | 1,203 | simple |
formula_1 | How many Australian drivers who were born in 1980? | born in 1980 refers to year(dob) = 1980; | SELECT COUNT(driverId) FROM drivers WHERE nationality = 'Australian' AND STRFTIME('%Y', dob) = '1980' | 969 | simple |
european_football_2 | What is the football player Francois Affolter header's finishing rate on 18/09/2014? | header's finishing rate refers to heading_accuracy; on 18/09/2014 refers to date = '2014-09-18 00:00:00'; | SELECT t2.heading_accuracy FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.player_name = 'Francois Affolter' AND SUBSTR(t2.`date`, 1, 10) = '2014-09-18' | 1,047 | moderate |
financial | How many male customers who were born between 1974 and 1976 have made a payment on their home in excess of $4000? | Man and male refers to gender = 'M'; 'SIPO' stands for household payment | SELECT COUNT(T1.account_id) FROM trans 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 STRFTIME('%Y', T3.birth_date) BETWEEN '1974' AND '1976' AND T3.gender = 'M' AND T1.amount > 4000 AND T1.k_symbol = 'SIPO' | 182 | moderate |
formula_1 | Which was the fastest lap for Lewis Hamilton in the 2008 Australian Grand Prix? | SELECT T1.fastestLap 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.name = 'Australian Grand Prix' AND T2.year = 2008 AND T3.forename = 'Lewis' AND T3.surname = 'Hamilton' | 936 | simple |
|
debit_card_specializing | How much more was customer 7 consuming in April 2013 than customer 5? | April 2013 refers to 201304 in the yearmonth.date | SELECT SUM(IIF(CustomerID = 7, Consumption, 0)) - SUM(IIF(CustomerID = 5, Consumption, 0)) FROM yearmonth WHERE Date = '201304' | 1,485 | simple |
toxicology | What are the elements of the toxicology and label of molecule TR060? | TR060 is the molecule id; label = '+' mean molecules are carcinogenic; label = '-' means molecules are non-carcinogenic; 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, T2.label FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.molecule_id = 'TR060' | 230 | challenging |
formula_1 | What's the finish time for the driver who ranked second in 2008's Australian Grand Prix? | finish time refers to time | SELECT T1.time FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T1.rank = 2 AND T2.name = 'Australian Grand Prix' AND T2.year = 2008 | 937 | simple |
toxicology | Identify all the atoms that are connected to the atoms of the TR181 molecule. | TR181 molecule refers to molecule_id = 'TR181' | SELECT T2.atom_id, T2.atom_id2 FROM atom AS T1 INNER JOIN connected AS T2 ON T2.atom_id = T1.atom_id WHERE T1.molecule_id = 'TR181' | 217 | simple |
codebase_community | Which user have only one post history per post and having at least 1000 views? | having at least 1000 view refers to Views > = 1000; user refers to UserId | SELECT T2.UserId 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 T3.ViewCount >= 1000 GROUP BY T2.UserId HAVING COUNT(DISTINCT T2.PostHistoryTypeId) = 1 | 595 | moderate |
codebase_community | What is the total score of the posts edited by Yevgeny and include the user's website URL. | "Yevgeny" is the DisplayName; edited refers to LastEditorUserId | SELECT SUM(T1.Score), T2.WebsiteUrl FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T2.DisplayName = 'Yevgeny' GROUP BY T2.WebsiteUrl | 583 | simple |
codebase_community | Describe the post history counts and last edit date of the post title "What is the best introductory Bayesian statistics textbook?" | SELECT T1.Id, T2.LastEditDate FROM postHistory AS T1 INNER JOIN posts AS T2 ON T1.PostId = T2.Id WHERE T2.Title = 'What is the best introductory Bayesian statistics textbook?' | 649 | simple |
|
california_schools | Please list the phone numbers of the direct charter-funded schools that are opened after 2000/1/1. | Charter schools refers to `Charter School (Y/N)` = 1 in the frpm | SELECT T2.Phone FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T1.`Charter Funding Type` = 'Directly funded' AND T1.`Charter School (Y/N)` = 1 AND T2.OpenDate > '2000-01-01' | 4 | moderate |
superhero | How many superheroes were published by Dark Horse Comics? | published by Dark Horse Comics refers to publisher_name = 'Dark Horse Comics'; | SELECT COUNT(T1.id) FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'Dark Horse Comics' | 768 | simple |
formula_1 | What is the best lap time recorded? List the driver and race with such recorded lap time. | the best lap time refers to min(time) | SELECT T2.milliseconds, T1.forename, T1.surname, T3.name FROM drivers AS T1 INNER JOIN lapTimes AS T2 ON T1.driverId = T2.driverId INNER JOIN races AS T3 ON T2.raceId = T3.raceId ORDER BY T2.milliseconds ASC LIMIT 1 | 894 | moderate |
thrombosis_prediction | What are the symptoms observed by the youngest patient to ever did a medical examination? Identify their diagnosis. | the youngest patient refers to MIN(BIRTHDAY); | SELECT T2.Symptoms, T1.Diagnosis FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T2.Symptoms IS NOT NULL ORDER BY T1.Birthday DESC LIMIT 1 | 1,166 | simple |
california_schools | What is the phone number of the school that has the highest number of test takers with an SAT score of over 1500? | SELECT T2.Phone FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode ORDER BY T1.NumGE1500 DESC LIMIT 1 | 7 | simple |
|
codebase_community | Give the total number of comments posted by user ID 13. | SELECT COUNT(Id) FROM comments WHERE UserId = 13 | 588 | simple |
|
european_football_2 | What is the short name of the football team Queens Park Rangers? | short name of the football team refers to team_short_name; Queens Park Rangers refers to team_long_name = 'Queens Park Rangers'; | SELECT team_short_name FROM Team WHERE team_long_name = 'Queens Park Rangers' | 1,043 | simple |
formula_1 | Please list the time each driver spent at the pit stop during the 2011 Australian Grand Prix. | time spent at pit stop refers to duration | SELECT T1.duration FROM pitStops AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T2.year = 2011 AND T2.name = 'Australian Grand Prix' | 1,009 | simple |
formula_1 | Who finished second in the San Marino Grand Prix in 2006? | finished second refers to position = 2; | SELECT T3.forename, T3.surname FROM races AS T1 INNER JOIN results AS T2 ON T2.raceId = T1.raceId INNER JOIN drivers AS T3 ON T3.driverId = T2.driverId WHERE T1.year = 2006 AND T1.name = 'San Marino Grand Prix' AND T2.position = 2 | 874 | simple |
thrombosis_prediction | List each patient's ID and blood glucose (GLU) index that were within normal range for patient's whose data was first recorded in 1991. | blood glucose (GLU) index that were within normal range refers to GLU < 180; data that was first recorded in 1991 refers to year(Description) > = 1991; | SELECT DISTINCT T1.ID, T2.GLU FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', T1.`First Date`) = '1991' AND T2.GLU < 180 | 1,233 | moderate |
superhero | What is the superpowers of the superhero has Helen Parr as their full name? | superpowers refers to power_name; Helen Parr is the full name of superhero; | SELECT T3.power_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 T1.full_name = 'Helen Parr' | 807 | simple |
formula_1 | How many drivers managed to finish the race in the 2008 Australian Grand Prix? | managed to finish the race refers to time is not null | SELECT COUNT(T2.driverId) FROM races AS T1 INNER JOIN results AS T2 ON T2.raceId = T1.raceId WHERE T1.name = 'Australian Grand Prix' AND T1.year = 2008 AND T2.time IS NOT NULL | 935 | simple |
european_football_2 | List the football team that has a build up play speed of 31, build up plan dribbling of 53, and build up play passing of 32. Only indicate the short name of the team. | build up play speed refers to buildUpPlaySpeed; buildUpPlaySpeed = 31; build up play dribbling refers to buildUpPlayDribbling; buildUpPlayDribbling = 53; build up play passing refers to buildUpPlayPassing; buildUpPlayPassing = 32; short name of the team refers to team_short_name; | SELECT DISTINCT t1.team_short_name FROM Team AS t1 INNER JOIN Team_Attributes AS t2 ON t1.team_api_id = t2.team_api_id WHERE t2.buildUpPlaySpeed = 31 AND t2.buildUpPlayDribbling = 53 AND t2.buildUpPlayPassing = 32 | 1,071 | challenging |
financial | How many accounts in Beroun were opened after 1996? | SELECT COUNT(account_id) FROM account AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE STRFTIME('%Y', T1.date) > '1996' AND T2.A2 = 'Beroun' | 183 | simple |
|
debit_card_specializing | Who is the top spending customer and how much is the average price per single item purchased by this customer? What currency was being used? | verage price per single item = price / amount | SELECT T2.CustomerID, SUM(T2.Price / T2.Amount), T1.Currency FROM customers AS T1 INNER JOIN transactions_1k AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.CustomerID = ( SELECT CustomerID FROM yearmonth ORDER BY Consumption DESC LIMIT 1 ) GROUP BY T2.CustomerID, T1.Currency | 1,531 | moderate |
codebase_community | What is the percentage of posts whose owners had a reputation of over 1000 in 2011? | DIVIDE(COUNT(Id where CreationDate = 2011 and Reputation > 1000), COUNT(Id) ) * 100 as percentage; | SELECT CAST(SUM(IIF(STRFTIME('%Y', T2.CreaionDate) = '2011' AND T1.Reputation > 1000, 1, 0)) AS REAL) * 100 / COUNT(T1.Id) FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId | 683 | moderate |
california_schools | What is the eligible free or reduced price meal rate for the top 5 schools in grades 1-12 with the highest free or reduced price meal count of the schools with the ownership code 66? | grades 1-12 means K-12; Eligible free or reduced price meal rate for K-12 = `FRPM Count (K-12)` / `Enrollment (K-12)` | SELECT CAST(T1.`FRPM Count (K-12)` AS REAL) / T1.`Enrollment (K-12)` FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.SOC = 66 ORDER BY T1.`FRPM Count (K-12)` DESC LIMIT 5 | 32 | moderate |
debit_card_specializing | How many transactions taken place in the gas station in the Czech Republic are with a price of over 1000? | Gas station in the Czech Republic implies that Country = 'CZE' | SELECT COUNT(T1.TransactionID) FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T2.Country = 'CZE' AND T1.Price > 1000 | 1,508 | simple |
card_games | Please provide the names of the artists who illustrated the card art in Phyrexian. | Phyrexian' is the language; name of artists refers to artist; | SELECT T1.artist FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T1.uuid = T2.uuid WHERE T2.language = 'Phyrexian' | 367 | simple |
financial | The transaction of 840 USD happened in 1998/10/14, when was this account opened? | SELECT T1.date FROM account AS T1 INNER JOIN trans AS T2 ON T1.account_id = T2.account_id WHERE T2.amount = 840 AND T2.date = '1998-10-14' | 104 | simple |