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
card_games
Among the cards with converted mana cost higher than 5 in the set Coldsnap, how many of them have unknown power?
card set Coldsnap refers to name = 'Coldsnap'; converted mana cost higher than 5 refers to convertedManaCost > 5; unknown power refers to power = '*' or T1.power is null
SELECT SUM(CASE WHEN T1.power LIKE '%*%' OR T1.power IS NULL THEN 1 ELSE 0 END) FROM cards AS T1 INNER JOIN sets AS T2 ON T2.code = T1.setCode WHERE T2.name = 'Coldsnap' AND T1.convertedManaCost > 5
479
moderate
toxicology
Please list top five molecules that have double bonds in alphabetical order.
double bond refers to bond_type = ' = ';
SELECT DISTINCT T.molecule_id FROM bond AS T WHERE T.bond_type = '=' ORDER BY T.molecule_id LIMIT 5
225
simple
card_games
How many artists have designed a card with a black border color and is available in both "arena" and "mtgo" printing type?
available in both "arena" and "mtgo" refers to availability like '%arena,mtgo%'
SELECT COUNT(CASE WHEN availability LIKE '%arena,mtgo%' THEN 1 ELSE NULL END) FROM cards
458
simple
student_club
What county did Sherri Ramsey grew up?
SELECT T2.county FROM member AS T1 INNER JOIN zip_code AS T2 ON T1.zip = T2.zip_code WHERE T1.first_name = 'Sherri' AND T1.last_name = 'Ramsey'
1,329
simple
formula_1
Which country is the constructor which got 1 point in the race No. 24 from?
race number refers to raceId;
SELECT T2.nationality FROM constructorResults AS T1 INNER JOIN constructors AS T2 ON T2.constructorId = T1.constructorId WHERE T1.raceId = 24 AND T1.points = 1
858
simple
formula_1
What is the full name and date of birth of Austrian drivers born between 1981 and 1991?
Full name refers to forname, surname; Date of birth refers to dob; year(dob) BETWEEN '1981' AND '1991'; Austrian is a nationality
SELECT forename, surname, dob FROM drivers WHERE nationality = 'Austrian' AND STRFTIME('%Y', dob) BETWEEN '1981' AND '1991'
991
simple
formula_1
In which Formula_1 race was the lap record for the Austrian Grand Prix Circuit set?
lap record means the fastest time recorded which refers to time
WITH fastest_lap_times AS ( SELECT T1.raceId, T1.FastestLapTime, (CAST(SUBSTR(T1.FastestLapTime, 1, INSTR(T1.FastestLapTime, ':') - 1) AS REAL) * 60) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, ':') + 1, INSTR(T1.FastestLapTime, '.') - INSTR(T1.FastestLapTime, ':') - 1) AS REAL)) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, '.') + 1) AS REAL) / 1000) as time_in_seconds FROM results AS T1 WHERE T1.FastestLapTime IS NOT NULL ) SELECT T2.name FROM races AS T2 INNER JOIN circuits AS T3 on T2.circuitId = T3.circuitId INNER JOIN results AS T1 on T2.raceId = T1.raceId INNER JOIN ( SELECT MIN(fastest_lap_times.time_in_seconds) as min_time_in_seconds FROM fastest_lap_times INNER JOIN races AS T2 on fastest_lap_times.raceId = T2.raceId INNER JOIN circuits AS T3 on T2.circuitId = T3.circuitId WHERE T2.name = 'Austrian Grand Prix') AS T4 ON (CAST(SUBSTR(T1.FastestLapTime, 1, INSTR(T1.FastestLapTime, ':') - 1) AS REAL) * 60) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, ':') + 1, INSTR(T1.FastestLapTime, '.') - INSTR(T1.FastestLapTime, ':') - 1) AS REAL)) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, '.') + 1) AS REAL) / 1000) = T4.min_time_in_seconds WHERE T2.name = 'Austrian Grand Prix'
1,015
moderate
financial
Which district has the most accounts with loan contracts finished with no problems?
status = 'A' refers to loan contracts finished with no problems
SELECT T1.district_id FROM district AS T1 INNER JOIN account AS T2 ON T1.district_id = T2.district_id INNER JOIN loan AS T3 ON T2.account_id = T3.account_id WHERE T3.status = 'A' GROUP BY T1.district_id ORDER BY COUNT(T2.account_id) DESC LIMIT 1
163
moderate
card_games
Lists all types of cards in German.
German refer to language; all types refer to the union of subtypes and supertypes where subtypes is not null AND supertypes is not null
SELECT T1.subtypes, T1.supertypes FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T1.uuid = T2.uuid WHERE T2.language = 'German' AND T1.subtypes IS NOT NULL AND T1.supertypes IS NOT NULL
407
moderate
financial
What proportion of customers who have accounts at the Prague branch are female?
Female refers to gender = 'F'; Percentage of female clients in Prague branch = count[female clients with accounts in Prague branch / count(clients with accounts in Prague branch)] * 100%; A3 may contain information about Prague
SELECT CAST(SUM(T2.gender = 'F') AS REAL) / COUNT(T2.client_id) * 100 FROM district AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id WHERE T1.A3 = 'Prague'
185
moderate
debit_card_specializing
What was the product id of the transaction happened at 2012/8/23 21:20:00?
'2012/8/23 21:20:00' can refer to date = '2012-08-23' AND T1.time = '21:20:00' in the database
SELECT T1.ProductID FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T1.Date = '2012-08-23' AND T1.Time = '21:20:00'
1,519
simple
financial
Please list the accounts whose district is Tabor that are eligible for loans.
District refers to column A2; when the account type = 'OWNER', it's eligible for loans
SELECT T2.account_id 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.A2 = 'Tabor'
148
moderate
superhero
What is the power ID of cryokinesis?
power ID refers to superpower.id; cryokinesis refers to power_name = 'cryokinesis';
SELECT id FROM superpower WHERE power_name = 'Cryokinesis'
803
simple
california_schools
Which active district has the highest average score in Reading?
SELECT T1.District FROM schools AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds WHERE T1.StatusType = 'Active' ORDER BY T2.AvgScrRead DESC LIMIT 1
15
simple
card_games
What is the border color of card "Ancestor's Chosen"?
Ancestor's Chosen' is the name of card;
SELECT DISTINCT borderColor FROM cards WHERE name = 'Ancestor''s Chosen'
358
simple
card_games
What are the cards for set OGW? State the colour for these cards.
set OGW refers to setCode = 'OGW';
SELECT id, colors FROM cards WHERE id IN ( SELECT id FROM set_translations WHERE setCode = 'OGW' )
387
simple
thrombosis_prediction
Provide the ID and age of patient with lactate dehydrogenase (LDH) between 100-300 index above the normal range.
age refers to SUBTRACT(year(current_timestamp), year(Birthday)); lactate dehydrogenase (LDH) between 100-300 index above the normal range refers to LDH between 600 and 800;
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 T2.LDH > 600 AND T2.LDH < 800
1,211
moderate
thrombosis_prediction
How many patients with a normal Ig A level came to the hospital after 1990/1/1?
normal Ig A level refers to IGA BETWEEN 80 AND 500; came to the hospital after 1990/1/1 refers to YEAR(`First Date`) > = 1990;
SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.IGA BETWEEN 80 AND 500 AND T1.`First Date` > '1990-01-01'
1,254
moderate
debit_card_specializing
How much did the KAM customers consume in total in May 2013?
May 2013 refers to yearmonth.date = 201305
SELECT SUM(T2.Consumption) FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.Date = '201305' AND T1.Segment = 'KAM'
1,489
simple
formula_1
In which country can I find the circuit with the highest altitude?
highest altitude refers to max(alt)
SELECT country FROM circuits ORDER BY alt DESC LIMIT 1
913
simple
thrombosis_prediction
Which is the youngest patient with an abnormal anti-ribonuclear protein level? Please list his or her date of birth.
youngest patient refers to MAX(Birthday); abnormal anti-ribonuclear protein level refers to RNP NOT IN('-', '+-'); date of birth refers to Birthday;
SELECT T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.RNP != '-' OR '+-' ORDER BY T1.Birthday DESC LIMIT 1
1,266
moderate
financial
The average unemployment ratio of 1995 and 1996, which one has higher percentage?
A12 refers to unemploymant rate 1995; A13 refers to unemploymant rate 1996
SELECT DISTINCT IIF(AVG(A13) > AVG(A12), '1996', '1995') FROM district
91
simple
student_club
Mention the category of events which were held at MU 215.
held at MU 215 refers to location = 'MU 215'
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,418
simple
codebase_community
What are the name of badges that users who have the lowest reputation obtained?
lowest reputation refers to Min(Reputation); user refers to UserId
SELECT T2.Name FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE T1.Reputation = (SELECT MIN(Reputation) FROM users)
621
simple
student_club
What is the most popular size of t-shirt ordered by the club members?
most popular size of t-shirt ordered refers to MAX(COUNT(t_shirt_size))
SELECT t_shirt_size FROM member GROUP BY t_shirt_size ORDER BY COUNT(t_shirt_size) DESC LIMIT 1
1,402
simple
card_games
What are the card numbers that don't have multiple faces on a single card and have the subtypes Angel and Wizard?
don't have multiple faces on a single card side is null
SELECT id FROM cards WHERE subtypes = 'Angel,Wizard' AND side IS NULL
425
simple
codebase_community
Among the tags with tag ID below 15, how many of them have 20 count of posts and below?
ID below 15 refers to Id < 15; have 20 count of posts and below refers to Count < = 20;
SELECT COUNT(id) FROM tags WHERE Count <= 20 AND Id < 15
703
simple
card_games
What was the expansion type for the set which card "Samite Pilgrim" in it?
expansion type refers to type; card "Samite Pilgrim" refers to name = 'Samite Pilgrim'
SELECT type FROM sets WHERE code IN ( SELECT setCode FROM cards WHERE name = 'Samite Pilgrim' )
503
simple
card_games
What are the cards in set 10E with converted mana of 5 have translation and what are the languages?
set 10E refers to setCode = '10E'; converted mana of 5 refers to convertedManaCost = 5;
SELECT id, language FROM set_translations WHERE id = ( SELECT id FROM cards WHERE convertedManaCost = 5 ) AND setCode = '10E'
388
simple
codebase_community
What is the location of the owner of the post "Eliciting priors from experts"?
Owner refers to OwnerUserId; 'Eliciting priors from experts' is the Title of post
SELECT T2.Location FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T1.Title = 'Eliciting priors from experts'
548
simple
student_club
Which event has the lowest cost?
event refers to event_name where MIN(cost)
SELECT T1.event_name 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 ORDER BY T3.cost LIMIT 1
1,389
simple
toxicology
What percentage of bonds have the most common combination of atoms' elements?
DIVIDE(COUNT(bond_id), COUNT(atom_id where MAX(COUNT(atom_id)) ))
SELECT CAST((SELECT COUNT(T1.atom_id) FROM connected AS T1 INNER JOIN bond AS T2 ON T1.bond_id = T2.bond_id GROUP BY T2.bond_type ORDER BY COUNT(T2.bond_id) DESC LIMIT 1 ) AS REAL) * 100 / ( SELECT COUNT(atom_id) FROM connected )
254
moderate
thrombosis_prediction
For all patients with triglyceride (TG) level beyond the normal range, how many are age more than 50 years?
triglyceride (TG) level beyond the normal range refers to TG > = 200; more than 50 years of age = SUBTRACT(year(current_timestamp), year(Birthday)) > 50;
SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TG >= 200 AND STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) > 50
1,229
moderate
financial
List the loan ID, district and average salary for loan with duration of 60 months.
A3 refers to regions; A11 refers to average salary
SELECT T3.loan_id, T2.A2, T2.A11 FROM account AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN loan AS T3 ON T1.account_id = T3.account_id WHERE T3.duration = 60
124
simple
codebase_community
What is the name of tags used by John Stauffer's?
DisplayName = 'John Stauffer';
SELECT T3.Tags 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 = 'John Salvatier'
630
simple
debit_card_specializing
In 2012, who had the least consumption in LAM?
Year 2012 can be presented as Between 201201 And 201212, which means between January and December in 2012
SELECT T1.CustomerID FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Segment = 'LAM' AND T2.date BETWEEN 201201 AND 201212 GROUP BY T1.CustomerID ORDER BY SUM(T2.Consumption) ASC LIMIT 1
1,472
moderate
card_games
What's the list of all types for the card "Molimo, Maro-Sorcerer"?
card "Molimo, Maro-Sorcerer" refers to name = 'Molimo, Maro-Sorcerer'; list of all types refers to subtypes,supertypes
SELECT DISTINCT subtypes, supertypes FROM cards WHERE name = 'Molimo, Maro-Sorcerer'
456
simple
toxicology
Is the molecule with the most double bonds carcinogenic?
double bond refers to bond_type = ' = '; label = '+' mean molecules are carcinogenic
SELECT T1.label FROM molecule AS T1 INNER JOIN ( SELECT T.molecule_id, COUNT(T.bond_type) FROM bond AS T WHERE T.bond_type = '=' GROUP BY T.molecule_id ORDER BY COUNT(T.bond_type) DESC LIMIT 1 ) AS T2 ON T1.molecule_id = T2.molecule_id
244
moderate
codebase_community
What is the display name of the user who has obtained the most number of badges?
who obtained the most number of badges refers to UserID with Max(Count(Id))
SELECT T2.DisplayName FROM badges AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id GROUP BY T2.DisplayName ORDER BY COUNT(T1.Id) DESC LIMIT 1
554
simple
student_club
How many student have the position of president?
'President' is a position of Student Club
SELECT COUNT(member_id) FROM member WHERE position = 'President'
1,377
simple
superhero
Calculate the average height of all neutral superheroes.
SELECT AVG(T1.height_cm) FROM superhero AS T1 INNER JOIN alignment AS T2 ON T1.alignment_id = T2.id WHERE T2.alignment = 'Neutral'
842
simple
thrombosis_prediction
Please list the disease names of the patients that have a proteinuria level higher than normal.
disease names refers to Diagnosis; proteinuria level higher than normal refers to `U-PRO` > = 30;
SELECT T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`U-PRO` >= 30
1,249
simple
formula_1
What is his number of the driver who finished 0:01:54 in the Q3 of qualifying race No.903?
race number refers to raceId;
SELECT T2.number FROM qualifying AS T1 INNER JOIN drivers AS T2 ON T2.driverId = T1.driverId WHERE T1.raceId = 903 AND T1.q3 LIKE '1:54%'
861
simple
debit_card_specializing
Which SME customer consumed the least in June 2012?
June 2012 refers to yearmonth.date = '201206'
SELECT T1.CustomerID FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.Date = '201206' AND T1.Segment = 'SME' GROUP BY T1.CustomerID ORDER BY SUM(T2.Consumption) ASC LIMIT 1
1,497
simple
european_football_2
What is the preferred foot when attacking of the player with the lowest potential?
preferred foot when attacking refers to preferred_foot; lowest potential refers to MIN(potential);
SELECT preferred_foot FROM Player_Attributes WHERE potential IS NOT NULL ORDER BY potential ASC LIMIT 1
1,022
simple
toxicology
Name the atoms' elements that form bond TR000_2_3.
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 T2.element FROM connected AS T1 INNER JOIN atom AS T2 ON T1.atom_id = T2.atom_id WHERE T1.bond_id = 'TR000_2_3'
307
challenging
california_schools
Please list the phone numbers of the schools with the top 3 SAT excellence rate.
Excellence rate = NumGE1500 / NumTstTakr
SELECT T1.Phone FROM schools AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds ORDER BY CAST(T2.NumGE1500 AS REAL) / T2.NumTstTakr DESC LIMIT 3
13
simple
superhero
In superheroes with weight less than 100, list the full name of the superheroes with brown eyes.
weight less than 100 refers to weight_kg < 100
SELECT T1.full_name FROM superhero AS T1 INNER JOIN colour AS T2 ON T1.eye_colour_id = T2.id WHERE T1.weight_kg < 100 AND T2.colour = 'Brown'
839
simple
formula_1
List out top 3 German drivers who were born from 1980-1990 and have the earliest lap time.
born from 1980-1990 refers to year(dob) between 1980 and 1990; earliest lap time refers to Min(time);
SELECT T2.driverId FROM pitStops AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId WHERE T2.nationality = 'German' AND STRFTIME('%Y', T2.dob) BETWEEN '1980' AND '1990' ORDER BY T1.time LIMIT 3
970
moderate
formula_1
Among the drivers who participated in the French Grand Prix, who has the slowest time in the 3rd lap.
slowest time refers to Max(time);
SELECT T1.driverId FROM lapTimes AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T2.name = 'French Grand Prix' AND T1.lap = 3 ORDER BY T1.time DESC LIMIT 1
985
simple
toxicology
How many of the single bond type molecules are non-carcinogenic?
label = '-' means molecules are non-carcinogenic; single bond refers to bond_type = '-';
SELECT COUNT(DISTINCT T2.molecule_id) FROM bond AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '-' AND T1.bond_type = '-'
278
simple
formula_1
Which constructor has the highest point?
SELECT T2.name FROM constructorStandings AS T1 INNER JOIN constructors AS T2 on T1.constructorId = T2.constructorId ORDER BY T1.points DESC LIMIT 1
949
simple
codebase_community
Describe the last accessed date and location of the users who received the outliers badge.
Outliers is the name of the badge;
SELECT T1.LastAccessDate, T1.Location FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE T2.Name = 'outliers'
650
simple
codebase_community
Identify the total views on the post 'Computer Game Datasets'. Name the user who posted it last time.
views refer to ViewCount; Name the user refers to DisplayName; Text = 'Computer Game Datasets';
SELECT T2.ViewCount, T3.DisplayName FROM postHistory AS T1 INNER JOIN posts AS T2 ON T1.PostId = T2.Id INNER JOIN users AS T3 ON T2.LastEditorUserId = T3.Id WHERE T1.Text = 'Computer Game Datasets'
685
moderate
california_schools
Which county reported the most number of school closure in the 1980s with school wonership code belonging to Youth Authority Facilities (CEA)?
Youth Authority Facilities (CEA) refers to SOC = 11; 1980s = years between 1980 and 1989
SELECT County FROM schools WHERE strftime('%Y', ClosedDate) BETWEEN '1980' AND '1989' AND StatusType = 'Closed' AND SOC = 11 GROUP BY County ORDER BY COUNT(School) DESC LIMIT 1
68
moderate
codebase_community
In comments with 0 score, how many of the posts have view count lower than 5?
view count lower than 5 refers to ViewCount < 5;
SELECT COUNT(T1.Id) FROM comments AS T1 INNER JOIN posts AS T2 ON T1.PostId = T2.Id WHERE T2.ViewCount < 5 AND T2.Score = 0
709
simple
card_games
Which card name in the set 'Journey into Nyx Hero's Path' has the highest converted mana cost.
set 'Journey into Nyx Hero's Path' refers to name = 'Journey into Nyx Hero''s Path'
SELECT T1.name FROM cards AS T1 INNER JOIN sets AS T2 ON T2.code = T1.setCode WHERE T2.name = 'Journey into Nyx Hero''s Path' ORDER BY T1.convertedManaCost DESC LIMIT 1
501
moderate
california_schools
Which different county has the most number of closed schools? Please provide the name of each school as well as the closure date.
Closure date and closed date are synonyms; 'Closed' was mentioned in schools.StatusType.
SELECT DISTINCT County, School, ClosedDate FROM schools WHERE County = ( SELECT County FROM schools WHERE StatusType = 'Closed' GROUP BY County ORDER BY COUNT(School) DESC LIMIT 1 ) AND StatusType = 'Closed' AND school IS NOT NULL
49
moderate
california_schools
What is the free rate for students between the ages of 5 and 17 at the school run by Kacey Gibson?
Eligible free rates for students aged 5-17 = `Free Meal Count (Ages 5-17)` / `Enrollment (Ages 5-17)`
SELECT CAST(T2.`Free Meal Count (Ages 5-17)` AS REAL) / T2.`Enrollment (Ages 5-17)` FROM schools AS T1 INNER JOIN frpm AS T2 ON T1.CDSCode = T2.CDSCode WHERE T1.AdmFName1 = 'Kacey' AND T1.AdmLName1 = 'Gibson'
34
moderate
superhero
What is Abomination's eye colour?
Abomination refers to superhero_name = 'Abomination'; eye colour refers to colour.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 WHERE T1.superhero_name = 'Abomination'
831
simple
student_club
Where is Amy Firth's hometown?
hometown refers to city, county, state
SELECT T2.city, T2.county, T2.state FROM member AS T1 INNER JOIN zip_code AS T2 ON T1.zip = T2.zip_code WHERE T1.first_name = 'Amy' AND T1.last_name = 'Firth'
1,364
simple
financial
What is the amount of debt that client number 992 has, and how is this client doing with payments?
SELECT T3.amount, T3.status FROM client AS T1 INNER JOIN account AS T2 ON T1.district_id = T2.district_id INNER JOIN loan AS T3 ON T2.account_id = T3.account_id WHERE T1.client_id = 992
176
simple
card_games
List out the set name of the set code "ALL".
SELECT name FROM sets WHERE code = 'ALL'
439
simple
codebase_community
Describe the post title which got positive comments and display names of the users who posted those comments.
positive comments refer to Score > 60;
SELECT T1.Title, T2.UserDisplayName FROM posts AS T1 INNER JOIN comments AS T2 ON T2.PostId = T2.Id WHERE T1.Score > 60
646
simple
student_club
Which college do most of the members go to?
college most members go refers to MAX(COUNT(major.college))
SELECT T2.college FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id GROUP BY T2.major_id ORDER BY COUNT(T2.college) DESC LIMIT 1
1,367
simple
superhero
What is the colour of Apocalypse's skin?
Apocalypse refers to superhero_name = 'Apocalypse'; colour of skin refers to colour where skin_colour_id = colour.id
SELECT T2.colour FROM superhero AS T1 INNER JOIN colour AS T2 ON T1.skin_colour_id = T2.id WHERE T1.superhero_name = 'Apocalypse'
722
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
863
simple
superhero
Provide the name of superhero with superhero ID 294.
name of superhero refers to superhero_name; superhero ID 294 refers to superhero.id = 294;
SELECT superhero_name FROM superhero WHERE id = 294
804
simple
card_games
How many card border with black color ? List out the card id.
border with black color refers to borderColor = 'black'
SELECT id FROM cards WHERE borderColor = 'black' GROUP BY id
435
simple
european_football_2
Among the players with an overall rating between 60 to 65, how many players whose going to be in all of your attack moves instead of defensing?
overall_rating > = 60 AND overall_rating < 65; players whose going to be in all of your attack moves instead of defensing refers to defensive_work_rate = 'low';
SELECT COUNT(id) FROM Player_Attributes WHERE overall_rating BETWEEN 60 AND 65 AND defensive_work_rate = 'low'
1,023
moderate
superhero
Among the superheroes from Marvel Comics, how many of them have blue eyes?
the superheroes from Marvel Comics refers to publisher_name = 'Marvel Comics'; blue eyes refers to colour = 'Blue' and eye_colour_id = colour.id
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 = 'Blue'
728
moderate
codebase_community
What is the percentage difference of student badges given during 2010 and 2011?
"Students" is the Name of badge;  during 2010 refers to Year(Date) = 2010; 2011 refers to Year(Date) = 2011; percentage difference = Subtract (Divide(Count(Name where Year(Date) = 2010), Count (Name)) *100, Divide(Count(Name where Year(Date) = 2011), Count(Name)) * 100)
SELECT CAST(SUM(IIF(STRFTIME('%Y', Date) = '2010', 1, 0)) AS REAL) * 100 / COUNT(Id) - CAST(SUM(IIF(STRFTIME('%Y', Date) = '2011', 1, 0)) AS REAL) * 100 / COUNT(Id) FROM badges WHERE Name = 'Student'
598
challenging
financial
What was the growth rate of the total amount of loans across all accounts for a male client between 1996 and 1997?
Growth rate = (sum of amount_1997 - sum of amount_1996) / (sum of amount_1996) * 100%; Male refers to gender = 'M'
SELECT CAST((SUM(CASE WHEN STRFTIME('%Y', T1.date) = '1997' THEN T1.amount ELSE 0 END) - SUM(CASE WHEN STRFTIME('%Y', T1.date) = '1996' THEN T1.amount ELSE 0 END)) AS REAL) * 100 / SUM(CASE WHEN STRFTIME('%Y', T1.date) = '1996' THEN T1.amount ELSE 0 END) FROM loan AS T1 INNER JOIN account AS T2 ON T1.account_id = T2.account_id INNER JOIN disp AS T3 ON T3.account_id = T2.account_id INNER JOIN client AS T4 ON T4.client_id = T3.client_id WHERE T4.gender = 'M' AND T3.type = 'OWNER'
169
challenging
student_club
What is the total amount of money spent for food?
total amount of money spent refers to SUM(spent); spent for food refers to category = 'Food'
SELECT SUM(spent) FROM budget WHERE category = 'Food'
1,380
simple
card_games
Name the cards that were illustrated by Aaron Boyd.
Aaron Boyd' is artist;
SELECT DISTINCT name FROM cards WHERE artist = 'Aaron Boyd'
373
simple
toxicology
Please list top three elements of the toxicology of the molecule TR000 in alphabetical order.
TR000 is the molecule id; 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 = 'TR000' ORDER BY T.element LIMIT 3
220
challenging
california_schools
Between San Diego and Santa Barbara, which county offers the most number of schools that does not offer physical building? Indicate the amount.
'Does not offer physical building' means Virtual = F in the database.
SELECT County, COUNT(Virtual) FROM schools WHERE (County = 'San Diego' OR County = 'Santa Barbara') AND Virtual = 'F' GROUP BY County ORDER BY COUNT(Virtual) DESC LIMIT 1
79
moderate
student_club
What is the total budgeted amount for all category in "October Speaker" event?
total budgeted amount refers to SUM(amount) where event_name = 'October Speaker'
SELECT SUM(T2.amount) FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.event_name = 'October Speaker'
1,337
simple
student_club
Which student has been entrusted to manage the budget for the Yearly Kickoff?
'Yearly Kickoff' is an event name;
SELECT T4.first_name, T4.last_name 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 INNER JOIN member AS T4 ON T3.link_to_member = T4.member_id WHERE T1.event_name = 'Yearly Kickoff'
1,387
moderate
superhero
Give the publisher ID of Star Trek.
Star Trek is the publisher_name;
SELECT id FROM publisher WHERE publisher_name = 'Star Trek'
745
simple
toxicology
What are the bond IDs that have the same atom ID 2 of TR000_2?
TR000_2 is the atom id; atom ID 2 refers to atom_id2
SELECT T.bond_id FROM connected AS T WHERE T.atom_id2 = 'TR000_2'
224
simple
toxicology
How many connections does the atom 19 have?
connections refers to bond_id; atom 19 refers to atom_id like 'TR%_19';
SELECT COUNT(T.bond_id) FROM connected AS T WHERE SUBSTR(T.atom_id, -2) = '19'
239
simple
thrombosis_prediction
For the patients whose total cholesterol is higher than normal, how many of them have a negative measure of degree of coagulation?
total cholesterol is higher than normal refers to `T-CHO` > = 250; negative measure of degree of coagulation refers to KCT = '-' ;
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.`T-CHO` >= 250 AND T3.KCT = '-'
1,297
moderate
codebase_community
How many positive comments are there on the list?
Positive comment refers to score > 60
SELECT COUNT(id) FROM comments WHERE score > 60
607
simple
formula_1
State code numbers of top 3 yougest drivers. How many Netherlandic drivers among them?
youngest driver refers to Max (year(dob)); Netherlandic and Dutch refer to the same country
SELECT COUNT(*) FROM ( SELECT T1.nationality FROM drivers AS T1 ORDER BY JULIANDAY(T1.dob) DESC LIMIT 3) AS T3 WHERE T3.nationality = 'Dutch'
967
simple
card_games
How many of the banned cards are white border?
banned card refers to status = 'Banned'; white border refers to borderColor = 'white';
SELECT COUNT(T1.id) FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T2.status = 'Banned' AND T1.borderColor = 'white'
383
simple
toxicology
Which non-carcinogenic molecules consisted more than 5 atoms?
label = '-' means molecules are non-carcinogenic; molecules consisted more than 5 atoms refers to COUNT(molecule_id) > 5
SELECT T.molecule_id FROM ( SELECT T1.molecule_id, COUNT(T2.atom_id) FROM molecule AS T1 INNER JOIN atom AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.label = '-' GROUP BY T1.molecule_id HAVING COUNT(T2.atom_id) > 5 ) t
327
moderate
student_club
List the full name of all the members of the Student_Club who attended the "Laugh Out Loud" event.
full name of members refers to first_name, last_name; 'Laugh Out Loud' is an event name;
SELECT T1.first_name, T1.last_name FROM member AS T1 INNER JOIN attendance AS T2 ON T1.member_id = T2.link_to_member INNER JOIN event AS T3 ON T2.link_to_event = T3.event_id WHERE T3.event_name = 'Laugh Out Loud'
1,327
moderate
california_schools
What are the webpages for the Los Angeles County school that has between 2,000 and 3,000 test takers?
SELECT T2.Website FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T1.NumTstTakr BETWEEN 2000 AND 3000 AND T2.County = 'Los Angeles'
38
simple
toxicology
Determine the bond type that is formed in the chemical compound containing element Tellurium.
Tellurium refers to element = 'te'; double bond refers to bond_type = ' = '; single bond refers to bond_type = '-'; triple bond refers to bond_type = '#';
SELECT DISTINCT T2.bond_type FROM atom AS T1 INNER JOIN bond AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.element = 'te'
284
moderate
thrombosis_prediction
The oldest SJS patient's medical laboratory work was completed on what date, and what age was the patient when they initially arrived at the hospital?
The oldest patient refers to MAX(Birthday); 'SJS' refers to diagnosis; (SUBTRACT(year(`First Date`)), year(Birthday)); age of the patients when they initially arrived at the hospital refers to year(Birthday)
SELECT T1.Date, STRFTIME('%Y', T2.`First Date`) - STRFTIME('%Y', T2.Birthday) FROM Laboratory AS T1 INNER JOIN Patient AS T2 ON T1.ID = T2.ID WHERE T2.Diagnosis = 'SJS' AND T2.Birthday IS NOT NULL ORDER BY T2.Birthday ASC LIMIT 1
1,168
challenging
codebase_community
How many users from India have the teacher badges?
"India" is the Location; "Teacher" is the Name of badge
SELECT COUNT(T1.Id) FROM badges AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T2.Location = 'India' AND T1.Name = 'Teacher'
597
simple
student_club
Calculate the percentage of zip codes that are PO boxes.
DIVIDE(SUM(type = 'PO Box'), COUNT(zip_code)) * 100
SELECT CAST(SUM(CASE WHEN type = 'PO box' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(zip_code) FROM zip_code
1,446
simple
thrombosis_prediction
How many male patients have elevated total bilirubin count?
male refers to SEX = 'M'; elevated means above the normal range; total bilirubin above the normal range refers to `T-BIL` > '2.0'
SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`T-BIL` >= 2.0 AND T1.SEX = 'M'
1,172
simple
superhero
Identify the heaviest superhero in DC Comics.
heaviest refers to MAX(weight_kg); DC Comics refers to publisher_name = 'DC Comics'; superhero refers to superhero_name;
SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'DC Comics' ORDER BY T1.weight_kg DESC LIMIT 1
826
simple
debit_card_specializing
Please list the product descriptions of the transactions taken place in the gas stations in the Czech Republic.
Gas station in the Czech Republic implies that Country = CZE
SELECT T3.Description FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID INNER JOIN products AS T3 ON T1.ProductID = T3.ProductID WHERE T2.Country = 'CZE'
1,506
moderate
european_football_2
What is the average height of players born between 1990 and 1995?
average height = DIVIDE(SUM(height), COUNT(id)); players born between 1990 and 1995 refers to birthday > = '1990-01-01 00:00:00' AND birthday < '1996-01-01 00:00:00';
SELECT SUM(height) / COUNT(id) FROM Player WHERE SUBSTR(birthday, 1, 4) BETWEEN '1990' AND '1995'
1,033
simple
card_games
What is the percentage of the cards with a converted mana cost of 7 in the set Coldsnap?
converted mana cost of 7 refers to convertedManaCost = 7; card set Coldsnap refers to name = 'Coldsnap'; percentage = DIVIDE(SUM(convertedManaCost = 7), SUM(convertedManaCost))*100
SELECT CAST(SUM(CASE WHEN T1.convertedManaCost = 7 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.id) FROM cards AS T1 INNER JOIN sets AS T2 ON T2.code = T1.setCode WHERE T2.name = 'Coldsnap'
486
moderate
thrombosis_prediction
Please list the IDs of the patients with no thrombosis and an abnormal level of creatinine phosphokinase.
no thrombosis refers to Thrombosis = 0 ; abnormal level of creatinine phosphokinase refers to CPK < 250;
SELECT DISTINCT T1.ID FROM Laboratory AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T2.Thrombosis = 0 AND T1.CPK < 250
1,301
simple
codebase_community
How many votes were made in 2010?
YEAR(CreationDate) = 2010;
SELECT COUNT(id) FROM votes WHERE STRFTIME('%Y', CreationDate) = '2010'
626
simple