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
codebase_community
What is the badge name that user 'SilentGhost' obtained?
"SilentGhost" is the DisplayName of user;
SELECT T2.Name FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE T1.DisplayName = 'SilentGhost'
575
simple
formula_1
Which year has the most number of races?
the most number of races refers to max(round);
SELECT year FROM races GROUP BY year ORDER BY COUNT(round) DESC LIMIT 1
886
simple
superhero
How many superheroes didn't have any publisher?
didn't have any publisher refers to publisher.id = 1;
SELECT COUNT(T1.id) FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.id = 1
799
simple
card_games
Which cards are ranked 1st on EDHRec? List all of the cards name and its banned play format.
ranked 1st on EDHRec refers to edhrecRank = 1; banned refers to status = 'banned'; play format refers to format; cards name refers to name
SELECT T1.name, T2.format FROM cards AS T1 INNER JOIN legalities AS T2 ON T2.uuid = T1.uuid WHERE T1.edhrecRank = 1 AND T2.status = 'Banned' GROUP BY T1.name, T2.format
522
moderate
financial
Among the accounts who have loan validity more than 24 months, list out the accounts that have the lowest approved amount and have account opening date before 1997.
SELECT T1.account_id FROM loan AS T1 INNER JOIN account AS T2 ON T1.account_id = T2.account_id WHERE T1.duration > 24 AND STRFTIME('%Y', T2.date) < '1997' ORDER BY T1.amount ASC LIMIT 1
188
moderate
superhero
Provide the hair colour of the human superhero who is 185 cm tall.
185 cm tall refers to height_cm = 185; human superhero refers to race = 'human'; hair colour refers to colour where hair_colour_id = colour.id;
SELECT DISTINCT T3.colour FROM superhero AS T1 INNER JOIN race AS T2 ON T1.race_id = T2.id INNER JOIN colour AS T3 ON T1.hair_colour_id = T3.id WHERE T1.height_cm = 185 AND T2.race = 'Human'
758
moderate
california_schools
What is the unabbreviated mailing address of the school with the highest FRPM count for K-12 students?
SELECT T2.MailStreet FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode ORDER BY T1.`FRPM Count (K-12)` DESC LIMIT 1
3
simple
formula_1
Name the top 3 drivers and the points they scored in the 2017 Chinese Grand Prix.
SELECT T3.forename, T3.surname, 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 T1.name = 'Chinese Grand Prix' AND T1.year = 2017 ORDER BY T2.points DESC LIMIT 3
893
simple
european_football_2
Which country is the Belgium Jupiler League from?
Belgium Jupiler League refers to League.name = 'Belgium Jupiler League';
SELECT t1.name FROM Country AS t1 INNER JOIN League AS t2 ON t1.id = t2.country_id WHERE t2.name = 'Belgium Jupiler League'
1,081
simple
toxicology
Which type of label is the most numerous in atoms with hydrogen?
with hydrogen refers to element = 'h'; label most numerous in atoms refers to MAX(COUNT(label)); label = '+' mean molecules are carcinogenic; label = '-' means molecules are non-carcinogenic
SELECT T.label FROM ( SELECT T2.label, COUNT(T2.molecule_id) FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.element = 'h' GROUP BY T2.label ORDER BY COUNT(T2.molecule_id) DESC LIMIT 1 ) t
208
moderate
card_games
What is the Italian flavor text of the card "Ancestor's Chosen"?
Italian refers to language = 'Italian'; flavor text refers to flavorText; "Ancestor''s Chosen" refers to name = 'Ancestor''s Chosen'
SELECT T2.flavorText FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T2.uuid = T1.uuid WHERE T1.name = 'Ancestor''s Chosen' AND T2.language = 'Italian'
480
moderate
thrombosis_prediction
Lists all patients by ID who were diagnosed with Behcet's and had their exams between 01/01/197 and 12/31/1997.
'Behcet' refers to diagnosis; exam between 01/01/1997 and 12/31/1997 refers to YEAR(Description) > = '1997-1-1' AND YEAR(Description) < '1998-1-1'
SELECT ID FROM Examination WHERE `Examination Date` BETWEEN '1997-01-01' AND '1997-12-31' AND Diagnosis = 'Behcet'
1,186
moderate
california_schools
Please specify all of the schools and their related mailing zip codes that are under Avetik Atoian's administration.
SELECT School, MailZip FROM schools WHERE AdmFName1 = 'Avetik' AND AdmLName1 = 'Atoian'
54
simple
card_games
Lists the set code of all cards translated into Spanish.
Spanish refer to language; set code refers to setCode
SELECT setCode FROM set_translations WHERE language = 'Spanish'
400
simple
codebase_community
State the detailed content of the comment which was created on 7/19/2010 7:25:47 PM.
detailed content of the comment refers to Text; created on 7/19/2010 7:16:14 PM refers to CreationDate = '2010-07-19 19:16:14.0'
SELECT Text FROM comments WHERE CreationDate = '2010-07-19 19:16:14.0'
608
simple
student_club
Calculate the amount budgeted for 'April Speaker' event. List all the budgeted categories for said event in an ascending order based on their amount.
'April Speaker' is an event name; amount budgeted refers to budget; budget categories refers to category
SELECT SUM(T2.amount), T2.category FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.event_name = 'April Speaker' ORDER BY T2.amount
1,405
moderate
financial
Please provide the IDs of the 3 female clients with the largest loans.
Female refers to gender = 'F'
SELECT T1.client_id 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.gender = 'F' ORDER BY T3.amount DESC LIMIT 3
181
simple
codebase_community
Among the users who obtained the "Teacher" badge, calculate their percentage of users
"Teacher" is the Name of badge; percentage = Divide (Count(UserId where it's "Teacher"), Count(UserId)) * 100
SELECT CAST(COUNT(T1.Id) AS REAL) * 100 / (SELECT COUNT(Id) FROM users) FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE T2.Name = 'Teacher'
614
simple
student_club
Which student has the hometown of Lincolnton, North Carolina with the zip code of 28092? List their full name and position.
full name refers to first_name, last_name, hometown of Lincolnton, North Carolina refers to city = 'Lincolnton' AND state = 'North Carolina'
SELECT T1.first_name, T1.last_name, T1.position FROM member AS T1 INNER JOIN zip_code AS T2 ON T2.zip_code = T1.zip WHERE T2.city = 'Lincolnton' AND T2.state = 'North Carolina' AND T2.zip_code = 28092
1,469
moderate
codebase_community
Which is the most valuable post in 2010? Please give its id and the owner's display name.
the most valuable post in 2015 refers to MAX(FavoriteCount) where year(CreationDate) = 2010;
SELECT T2.OwnerUserId, T1.DisplayName FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId WHERE STRFTIME('%Y', T1.CreationDate) = '2010' ORDER BY T2.FavoriteCount DESC LIMIT 1
682
moderate
california_schools
What is the e-mail address of the administrator of the school located in the San Bernardino county, District of San Bernardino City Unified that opened between 1/1/2009 to 12/31/2010 whose school types are public Intermediate/Middle Schools and Unified Scools?
Intermediate/Middle Schools refers to SOC = 62; Unified School refers to DOC = 54; years between 2009 and 2010 can refer to 'between 1/1/2009 to 12/31/2010'
SELECT T2.AdmEmail1 FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.County = 'San Bernardino' AND T2.City = 'San Bernardino' AND T2.DOC = 54 AND strftime('%Y', T2.OpenDate) BETWEEN '2009' AND '2010' AND T2.SOC = 62
87
challenging
european_football_2
Locate players with vision scores of 90 and above, state the country of these players.
vision scores of 90 and above refers to vision > 89
SELECT DISTINCT t4.name FROM Player_Attributes AS t1 INNER JOIN Player AS t2 ON t1.player_api_id = t2.player_api_id INNER JOIN Match AS t3 ON t2.player_api_id = t3.home_player_8 INNER JOIN Country AS t4 ON t3.country_id = t4.id WHERE t1.vision > 89
1,127
moderate
card_games
Name the foreign name of the card that has boros watermark? List out the type of this card.
SELECT DISTINCT T1.name, T1.type FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T2.uuid = T1.uuid WHERE T1.watermark = 'boros'
444
simple
student_club
For all the club members from "Human Development and Family Studies" major, how many of them wear large size t-shirt?
'Human Development and Family Studies' is a major name; wear large size t-shirt refers to t_shirt_size = 'Large'
SELECT COUNT(T1.member_id) FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T2.major_name = 'Human Development AND Family Studies' AND T1.t_shirt_size = 'Large'
1,352
moderate
european_football_2
What are Alexis Blin's sprint speed, agility, and acceleration scores?
Alexis Blin's refers to player_name = 'Alexis Blin'
SELECT sprint_speed, agility, acceleration FROM Player_Attributes WHERE player_api_id IN ( SELECT player_api_id FROM Player WHERE player_name = 'Alexis Blin' )
1,140
simple
codebase_community
How much is the total bounty amount of the post titled about 'data'
About data means the title contains 'data'; total bounty Amount refers to Sum(BountyAmount)
SELECT SUM(T2.BountyAmount) FROM posts AS T1 INNER JOIN votes AS T2 ON T1.Id = T2.PostId WHERE T1.Title LIKE '%data%'
585
simple
superhero
How many superheroes with blonde hair are there?
superheroes with blonde hair refers to colour = 'Blond' where hair_colour_id = colour.id
SELECT COUNT(T1.id) FROM superhero AS T1 INNER JOIN colour AS T2 ON T1.hair_colour_id = T2.id WHERE T2.colour = 'Blond'
735
simple
student_club
How much did the Student_Club members spend on food in September Meeting?
amount spent refers to spent; spend on food in September Meeting refers to category = 'Food' where event_name = 'September Meeting'
SELECT T2.spent FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.event_name = 'September Meeting' AND T2.category = 'Food' AND SUBSTR(T1.event_date, 6, 2) = '09'
1,332
moderate
student_club
Among the events attended by more than 10 members of the Student_Club, how many of them are meetings?
meetings events refers to type = 'Meeting'; attended by more than 10 members refers to COUNT(event_id) > 10
SELECT COUNT(T1.event_id) FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event WHERE T1.type = 'Meeting' GROUP BY T1.type HAVING COUNT(T2.link_to_event) > 10
1,322
moderate
toxicology
How many molecules have a triple bond type?
triple bond refers to bond_type = '#';
SELECT COUNT(DISTINCT T.molecule_id) FROM bond AS T WHERE T.bond_type = '#'
238
simple
codebase_community
How many users from New York have a teacher and supporter badge?
"Supporter" and "Teachers" are both Name of badge; 'New York' is the Location; user refers to UserId
SELECT COUNT(DISTINCT T1.Id) FROM badges AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T1.Name IN ('Supporter', 'Teacher') AND T2.Location = 'New York'
593
simple
financial
List all ID and district for clients that can only have the right to issue permanent orders or apply for loans.
Only the owner accounts have the right to issue permanent orders or apply for loans
SELECT T3.client_id, T2.district_id, T2.A2 FROM account AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN disp AS T3 ON T1.account_id = T3.account_id WHERE T3.type = 'OWNER'
193
moderate
superhero
Please give the full name of the tallest hero published by Marvel Comics.
the tallest hero refers to MAX(height_cm); published by Marvel Comics refers to publisher_name = 'Marvel Comics'
SELECT T1.full_name FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'Marvel Comics' ORDER BY T1.height_cm DESC LIMIT 1
726
moderate
codebase_community
Please list the users' display names whose posts had over 20000 views in 2011.
had over 20000 views in 2011 refers to ViewCount > 20000 where YEAR(CreationDate) = 2011;
SELECT T1.DisplayName FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId WHERE STRFTIME('%Y', T2.CreaionDate) = '2011' AND T2.ViewCount > 20000
681
simple
financial
For the client who applied 98832 USD loan in 1996/1/3, when was his/her birthday?
SELECT T3.birth_date FROM loan 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.date = '1996-01-03' AND T1.amount = 98832
113
simple
superhero
Between DC and Marvel Comics, which publisher has published more superheroes? Find the difference in the number of superheroes they have published.
DC refers to publisher_name = 'DC Comics'; Marvel Comics refers to publisher_name = 'Marvel Comics'; calculation = SUBTRACT(SUM(publisher_name = 'Marvel Comics'), SUM(publisher_name = 'DC Comics'))
SELECT SUM(CASE WHEN T2.publisher_name = 'Marvel Comics' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.publisher_name = 'DC Comics' THEN 1 ELSE 0 END) FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id
744
challenging
formula_1
What's Lewis Hamilton's reference name?
reference name refers to driverRef
SELECT driverRef FROM drivers WHERE forename = 'Lewis' AND surname = 'Hamilton'
918
simple
european_football_2
In the 2015–2016 season, how many games were played in the Italian Serie A league?
In the 2015–2016 season refers to season = '2015/2016'
SELECT COUNT(t2.id) FROM League AS t1 INNER JOIN Match AS t2 ON t1.id = t2.league_id WHERE t1.name = 'Italy Serie A' AND t2.season = '2015/2016'
1,142
simple
codebase_community
How many users with more than 10 views created their account after the year 2013?
more than 10 views refers to Views > 10; created after the year 2013 refers to year (CreationDate) > 2013
SELECT COUNT(id) FROM users WHERE STRFTIME('%Y', CreationDate) > '2013' AND Views > 10
536
simple
formula_1
What is the average score of Lewis Hamilton among all the Turkish Grand Prix?
Average score = AVG(points)
SELECT AVG(T2.points) FROM drivers AS T1 INNER JOIN driverStandings AS T2 ON T1.driverId = T2.driverId INNER JOIN races AS T3 ON T3.raceId = T2.raceId WHERE T1.forename = 'Lewis' AND T1.surname = 'Hamilton' AND T3.name = 'Turkish Grand Prix'
995
moderate
formula_1
Please give the names of the races held on the circuits in Spain.
Spain is a name of country;
SELECT DISTINCT T2.name FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T1.country = 'Spain'
853
simple
codebase_community
What is the title of the post with the oldest post link?
the oldest post link refers to MIN(CreaionDate);
SELECT T1.Title FROM posts AS T1 INNER JOIN postLinks AS T2 ON T2.PostId = T1.Id ORDER BY T1.CreaionDate LIMIT 1
667
simple
card_games
Find all cards illustrated by Stephen Daniel and describe the text of the ruling of these cards. State if these cards have missing or degraded properties and values.
cards have missing or degraded properties and value refers to hasContentWarning = 1; 'Stephen Daniele' is artist;
SELECT T1.id, T2.text, T1.hasContentWarning FROM cards AS T1 INNER JOIN rulings AS T2 ON T1.uuid = T2.uuid WHERE T1.artist = 'Stephen Daniele'
347
moderate
student_club
List the name of events with less than average parking cost.
name of events refers to event_name; less than average parking cost refers to cost < DIVIDE(SUM(cost), COUNT(event_id)) where category = 'Parking'
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 WHERE T2.category = 'Parking' AND T3.cost < (SELECT AVG(cost) FROM expense)
1,453
moderate
thrombosis_prediction
What percentage of patients who were born in 1980 and were diagnosed with RA are women?
born in 1980 refers to YEAR(BIRTHDAY) = '1980'; 'RA' refers to diagnosis; women refers to SEX = 'F'; calculation = DIVIDE((SEX = 'F'), COUNT(SEX)) where YEAR(BIRTHDAY) = '1980' AND diagnosis = 'RA' MULTIPLY 100
SELECT CAST(SUM(CASE WHEN SEX = 'F' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(ID) FROM Patient WHERE Diagnosis = 'RA' AND STRFTIME('%Y', Birthday) = '1980'
1,201
moderate
codebase_community
How many users last accessed the website after 2014/9/1?
last accessed after 2014/9/1 refers to LastAccessDate > '2014-09-01 00:00:00'
SELECT COUNT(Id) FROM users WHERE date(LastAccessDate) > '2014-09-01'
533
simple
thrombosis_prediction
Provide list of patients and their diagnosis with triglyceride (TG) index greater than 100 of the normal range?
triglyceride (TG) index greater than 100 of the normal range refers to TG > 300;
SELECT T1.ID, T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TG > 300
1,228
simple
codebase_community
List out the age of users who located in Vienna, Austria obtained the badge?
"Vienna, Austria" is the Location
SELECT T1.Age FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE T1.Location = 'Vienna, Austria'
618
simple
student_club
How many majors are there in "College of Humanities and Social Sciences"?
SELECT COUNT(major_name) FROM major WHERE college = 'College of Humanities and Social Sciences'
1,345
simple
codebase_community
What is the name of badge that the user whose display name is "Pierre" obtained?
SELECT T2.Name FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE T1.DisplayName = 'Pierre'
612
simple
card_games
How many cards have infinite power?
infinite power refers to power = '*';
SELECT COUNT(*) FROM cards WHERE power = '*'
356
simple
california_schools
Which cities have the top 5 lowest enrollment number for students in grades 1 through 12?
K-12 refers to students in grades 1 through 12.
SELECT T2.City FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode GROUP BY T2.City ORDER BY SUM(T1.`Enrollment (K-12)`) ASC LIMIT 5
30
simple
toxicology
Find the percentage of atoms with single bond.
single bond refers to bond_type = '-'; percentage = DIVIDE(SUM(bond_type = '-'), COUNT(bond_id)) as percentage
SELECT CAST(COUNT(CASE WHEN T.bond_type = '-' THEN T.bond_id ELSE NULL END) AS REAL) * 100 / COUNT(T.bond_id) FROM bond t
324
simple
thrombosis_prediction
List the patient ID, sex and birthday who has abnormal white blood cell count. Group them by sex and list the patient by age in ascending order.
abnormal white blood cell count refers to WBC < = 3.5 or WBC > = 9.0;
SELECT DISTINCT T1.ID, T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.WBC <= 3.5 OR T2.WBC >= 9.0 GROUP BY T1.SEX,T1.ID ORDER BY T1.Birthday ASC
1,234
moderate
debit_card_specializing
What is the difference in the annual average consumption of the customers with the least amount of consumption paid in CZK for 2013 between SME and LAM, LAM and KAM, and KAM and SME?
annual average consumption of customer with the lowest consumption in each segment = total consumption per year / the number of customer with lowest consumption in each segment; Difference in annual average = SME's annual average - LAM's annual average; Difference in annual average = LAM's annual average - KAM's annual average; Year 2013 can be presented as Between 201301 And 201312; First 4 strings of Date represents the year.
SELECT CAST(SUM(IIF(T1.Segment = 'SME', T2.Consumption, 0)) AS FLOAT) / COUNT(T1.CustomerID) - CAST(SUM(IIF(T1.Segment = 'LAM', T2.Consumption, 0)) AS FLOAT) / COUNT(T1.CustomerID) , CAST(SUM(IIF(T1.Segment = 'LAM', T2.Consumption, 0)) AS FLOAT) / COUNT(T1.CustomerID) - CAST(SUM(IIF(T1.Segment = 'KAM', T2.Consumption, 0)) AS FLOAT) / COUNT(T1.CustomerID) , CAST(SUM(IIF(T1.Segment = 'KAM', T2.Consumption, 0)) AS FLOAT) / COUNT(T1.CustomerID) - CAST(SUM(IIF(T1.Segment = 'SME', T2.Consumption, 0)) AS FLOAT) / COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Currency = 'CZK' AND T2.Consumption = ( SELECT MIN(Consumption) FROM yearmonth ) AND T2.Date BETWEEN 201301 AND 201312
1,481
challenging
thrombosis_prediction
Among the patients whose total cholesterol is within the normal range, how many of them have a P pattern observed in the sheet of ANA examination?
total cholesterol is within the normal range refers to `T-CHO` < 250; P pattern observed in the sheet of ANA examination refers to ANA Pattern = 'P';
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 T3.`ANA Pattern` = 'P' AND T2.`T-CHO` < 250
1,298
moderate
toxicology
What are the toxicology elements associated with bond ID TR005_16_26?
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 T1.element FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id WHERE T2.bond_id = 'TR005_16_26'
277
challenging
student_club
Please list the phone numbers of the members who majored in business at the College of Agriculture and Applied Sciences.
'College of Agriculture and Applied Sciences' is the college; majored in business refers to major_name = 'Business'; phone numbers refers to phone
SELECT T1.phone FROM member AS T1 INNER JOIN major AS T2 ON T2.major_id = T1.link_to_major WHERE T2.major_name = 'Business' AND T2.college = 'College of Agriculture and Applied Sciences'
1,439
moderate
california_schools
Consider the average difference between K-12 enrollment and 15-17 enrollment of schools that are locally funded, list the names and DOC type of schools which has a difference above this average.
Difference between K-12 enrollment and 15-17 enrollment can be computed by `Enrollment (K-12)` - `Enrollment (Ages 5-17)`
SELECT T2.School, T2.DOC FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.FundingType = 'Locally funded' AND (T1.`Enrollment (K-12)` - T1.`Enrollment (Ages 5-17)`) > (SELECT AVG(T3.`Enrollment (K-12)` - T3.`Enrollment (Ages 5-17)`) FROM frpm AS T3 INNER JOIN schools AS T4 ON T3.CDSCode = T4.CDSCode WHERE T4.FundingType = 'Locally funded')
28
challenging
codebase_community
How many negative comments did Neil McGuigan get in his posts?
Negative comment refers to score < 60; DisplayName = 'Neil McGuigan';
SELECT COUNT(T3.Id) FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId INNER JOIN comments AS T3 ON T2.Id = T3.PostId WHERE T1.DisplayName = 'Neil McGuigan' AND T3.Score < 60
636
simple
european_football_2
From 2010 to 2015, what was the average overall rating of players who are higher than 170?
from 2010 to 2015 refers to strftime('%Y', date) BETWEEN '2010' AND '2015'; height > 170;
SELECT CAST(SUM(t2.overall_rating) AS REAL) / COUNT(t2.id) FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.height > 170 AND SUBSTR(t2.`date`, 1, 4) BETWEEN '2010' AND '2015'
1,068
moderate
student_club
Indicate the top source of funds received in September 2019 based on their amount.
top source funds refers to MAX(source) where date_received BETWEEN '2019-09-01' and '2019-09-30'
SELECT source FROM income WHERE date_received BETWEEN '2019-09-01' and '2019-09-30' ORDER BY source DESC LIMIT 1
1,392
simple
student_club
How many members did attend the event 'Community Theater' in 2019?
event 'Community Theater' in 2019 refers to event_name = 'Community Theater' where YEAR(event_date) = 2019
SELECT COUNT(T2.link_to_member) FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event WHERE T1.event_name = 'Community Theater' AND SUBSTR(T1.event_date, 1, 4) = '2019'
1,395
moderate
codebase_community
What are the titles of the top 5 posts with the highest popularity?
Higher view count means the post has higher popularity; the highest popularity refers to MAX(ViewCount);
SELECT Title FROM posts ORDER BY ViewCount DESC LIMIT 5
658
simple
codebase_community
How many elders obtained the "Supporter" badge?
"Supporter" is the Name of badge;  elders refers to Age > 65
SELECT COUNT(T1.Id) FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE T1.Age > 65 AND T2.Name = 'Supporter'
623
simple
toxicology
What is the percentage of carbon in double-bond molecules?
carbon refers to element = 'c'; double-bond molecules refers to bond_type = ' = '; percentage = DIVIDE(SUM(element = 'c'), COUNT(atom_id))
SELECT CAST(COUNT(DISTINCT CASE WHEN T1.element = 'c' THEN T1.atom_id ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT T1.atom_id) FROM atom AS T1 INNER JOIN bond AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.bond_type = '='
201
moderate
thrombosis_prediction
How old was the patient who had the highest hemoglobin count at the time of the examination, and what is the doctor's diagnosis?
How old the patient refers to SUBTRACT(year(`Examination Date`), year(Birthday)); the highest hemoglobin count refers to MAX(HGB)
SELECT STRFTIME('%Y', T2.Date) - STRFTIME('%Y', T1.Birthday), T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID ORDER BY T2.HGB DESC LIMIT 1
1,175
moderate
toxicology
Of all the carcinogenic molecules, which one has the most double bonds?
label = '+' mean molecules are carcinogenic; double bond refers to bond_type = ' = ';
SELECT T.molecule_id FROM ( SELECT T3.molecule_id, COUNT(T1.bond_type) FROM bond AS T1 INNER JOIN molecule AS T3 ON T1.molecule_id = T3.molecule_id WHERE T3.label = '+' AND T1.bond_type = '=' GROUP BY T3.molecule_id ORDER BY COUNT(T1.bond_type) DESC LIMIT 1 ) AS T
250
moderate
european_football_2
Among the players with finishing rate of 1, pick the eldest player and state the player's name.
eldest player refers to MAX(SUBTRACT(datetime(CURRENT_TIMESTAMP,'localtime'),datetime(birthday))); finishing rate of 1 refers to finishing = 1
SELECT DISTINCT t1.player_name FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t2.finishing = 1 ORDER BY t1.birthday ASC LIMIT 1
1,125
moderate
thrombosis_prediction
When is the laboratory examination of patient '48473' where his/her AST glutamic oxaloacetic transaminase (GOT) index is above the normal range.
AST glutamic oxaloacetic transaminase (GOT) index is above the normal range refers to GOT > = 60; when refers to DATE
SELECT Date FROM Laboratory WHERE ID = 48473 AND GOT >= 60
1,206
simple
codebase_community
Give the only one comment text of the post with parent id 107829.
one comment refers to CommentCount = '1'
SELECT T2.Text FROM posts AS T1 INNER JOIN comments AS T2 ON T1.Id = T2.PostId WHERE T1.ParentId = 107829 AND T1.CommentCount = 1
564
simple
european_football_2
When was the first time did Kevin Constant have his highest crossing score? Give the date.
Kevin Constant refers to player_name = 'Kevin Constant'; highest crossing score refers to MAX(crossing)
SELECT `date` FROM ( SELECT t2.crossing, t2.`date` FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_fifa_api_id = t2.player_fifa_api_id WHERE t1.player_name = 'Kevin Constant' ORDER BY t2.crossing DESC) ORDER BY date DESC LIMIT 1
1,107
moderate
student_club
Please list the event names of all the events attended by Maya Mclean.
SELECT T1.event_name FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event INNER JOIN member AS T3 ON T2.link_to_member = T3.member_id WHERE T3.first_name = 'Maya' AND T3.last_name = 'Mclean'
1,320
simple
thrombosis_prediction
From laboratory examinations in 1991, what is the average hematoclit level that is lower than the normal range.
laboratory examinations in 1991 refers to Date like '1991%'; average hematoclit level = AVG(HCT); hematoclit level that is lower than the normal range refers to HCT < 29;
SELECT AVG(T2.HCT) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.HCT < 29 AND STRFTIME('%Y', T2.Date) = '1991'
1,240
moderate
card_games
What is the language of the "Battlebond" set?
"Battlebond" set refers to name = 'Battlebond'
SELECT language FROM set_translations WHERE id IN ( SELECT id FROM sets WHERE name = 'Battlebond' )
519
simple
toxicology
Among all chemical compounds identified in the database, what percent of compounds form a triple-bond.
triple bond refers to bond_type = '#';
SELECT CAST(COUNT(CASE WHEN T.bond_type = '#' THEN T.bond_id ELSE NULL END) AS REAL) * 100 / COUNT(T.bond_id) FROM bond AS T
286
simple
student_club
Write the full name of the club member with the position of 'Secretary' and list which college the club member belongs to.
full name refers to first_name, last name
SELECT T1.first_name, T1.last_name, college FROM member AS T1 INNER JOIN major AS T2 ON T2.major_id = T1.link_to_major WHERE T1.position = 'Secretary'
1,466
simple
thrombosis_prediction
What is the percentage of female patient had total protein not within the normal range?
female refers to sex = 'F'; total protein not within the normal range refers to TP < '6.0' or TP > '8.5'; calculation = DIVIDE((ID where sex = 'F' and TP < '6.0' or TP > '8.5'), COUNT(ID)) * 100
SELECT CAST(SUM(CASE WHEN T1.SEX = 'F' AND (T2.TP < 6.0 OR T2.TP > 8.5) THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'F'
1,160
moderate
debit_card_specializing
Please list the chains of the gas stations with transactions in euro.
SELECT DISTINCT T3.ChainID FROM transactions_1k AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN gasstations AS T3 ON T1.GasStationID = T3.GasStationID WHERE T2.Currency = 'EUR'
1,502
simple
financial
How many percent of 'Gold' cards were issued prior to 1998?
Percent of Gold = [ count(type = 'gold' and issued date < 1998) / count(all cards)] * 100%
SELECT CAST(SUM(type = 'gold') AS REAL) * 100 / COUNT(card_id) FROM card WHERE STRFTIME('%Y', issued) < '1998'
155
simple
california_schools
If there are any, what are the websites address of the schools with a free meal count of 1,900-2,000 to students aged 5-17? Include the name of the school.
SELECT T2.Website, T1.`School Name` FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T1.`Free Meal Count (Ages 5-17)` BETWEEN 1900 AND 2000 AND T2.Website IS NOT NULL
33
moderate
formula_1
Give the coordinate position for Abu Dhabi Grand Prix.
coordinates refers to (lat, lng); position and location shares the same meaning.
SELECT DISTINCT T1.lat, T1.lng, T1.location FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T2.name = 'Abu Dhabi Grand Prix'
857
simple
superhero
Provide the eye colours of the heroes whose skin colours are gold.
skin colours are gold refers to colour.colour = 'Gold' WHERE skin_colour_id = colour.id;
SELECT T2.colour FROM superhero AS T1 INNER JOIN colour AS T2 ON T1.eye_colour_id = T2.id INNER JOIN colour AS T3 ON T1.skin_colour_id = T3.id WHERE T3.colour = 'Gold'
783
simple
codebase_community
How many posts did Jay Stevens have in 2010?
DisplayName = 'Jay Stevens'; in 2010 refers to YEAR(CreationDate) = 2010;
SELECT COUNT(T1.Id) FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId WHERE STRFTIME('%Y', T2.CreaionDate) = '2010' AND T1.DisplayName = 'Jay Stevens'
677
simple
thrombosis_prediction
How long did it take after patient number 821298 arrived at the hospital for the first time before her evaluation began?
DATEDIFF(`Examination Date`, `First Date`)
SELECT STRFTIME('%d', T3.`Examination Date`) - STRFTIME('%d', T1.`First Date`) FROM Patient AS T1 INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T1.ID = 821298
1,204
simple
codebase_community
Name the user that commented 'thank you user93!'
"thank you user93" is the Text of comment; user refers to DisplayName
SELECT T1.DisplayName FROM users AS T1 INNER JOIN comments AS T2 ON T1.Id = T2.UserId WHERE T2.Text = 'thank you user93!'
576
simple
formula_1
How many American drivers have been disqualified from the race.
disqualified refers to statusID = 2;
SELECT COUNT(T1.driverId) FROM drivers AS T1 INNER JOIN results AS T2 on T1.driverId = T2.driverId INNER JOIN status AS T3 on T2.statusId = T3.statusId WHERE T3.status = 2 AND T1.nationality = 'American'
982
simple
thrombosis_prediction
What is the ratio of male to female patients among all those with abnormal uric acid counts?
male refers to SEX = 'M'; female refers to SEX = 'F'; abnormal uric acid refers to UA < = '8.0' where SEX = 'M', UA < = '6.5' where SEX = 'F'; calculation = DIVIDE(SUM(UA <= '8.0' and SEX = 'M'), SUM(UA <= '6.5 and SEX = 'F'))
SELECT CAST(SUM(CASE WHEN T2.UA <= 8.0 AND T1.SEX = 'M' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.UA <= 6.5 AND T1.SEX = 'F' THEN 1 ELSE 0 END) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID
1,169
challenging
debit_card_specializing
For the deal happened at 2012/8/24 12:42:00, which country was it?
'2012/8/24 12:42:00' can refer to date = '2012-08-24' AND T1.time = '12:42:00' in the database
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.Time = '12:42:00'
1,518
simple
formula_1
What is the annual average number of races held during the first 10 years of the 21st century?
races in date between '2000-01-01' and '2010-12-31'
SELECT CAST(SUM(CASE WHEN year BETWEEN 2000 AND 2010 THEN 1 ELSE 0 END) AS REAL) / 10 FROM races WHERE date BETWEEN '2000-01-01' AND '2010-12-31'
996
simple
financial
How many of the accounts are from Jesenik district?
SELECT COUNT(T2.account_id) FROM district AS T1 INNER JOIN account AS T2 ON T1.district_id = T2.district_id WHERE T1.A2 = 'Jesenik'
166
simple
card_games
What are the cards that only available in paper and Japanese language?
available in paper refers to availability = 'paper'; 'Japanese is the language;
SELECT T1.name FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T1.uuid = T2.uuid WHERE T1.availability = 'paper' AND T2.language = 'Japanese'
382
simple
toxicology
Among the molecules with element Calcium, are they mostly carcinogenic or non carcinogenic?
calcium refers to element = 'ca'; label = '+' mean molecules are carcinogenic; label = '-' means molecules are non-carcinogenic; MAX(label)
SELECT T2.label FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.element = 'ca' GROUP BY T2.label ORDER BY COUNT(T2.label) DESC LIMIT 1
270
moderate
codebase_community
List the title of posts which were edited by Vebjorn Ljosa.
"Vebjorn Ljosa" is the DisplayName; last edited refers to LastEditorUserId
SELECT T1.Title FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T2.DisplayName = 'Vebjorn Ljosa'
582
simple
financial
How many accounts in North Bohemia has made a transaction with the partner's bank being AB?
A3 contains the region names; North Bohemia is a region.
SELECT COUNT(T2.account_id) FROM district AS T1 INNER JOIN account AS T2 ON T1.district_id = T2.district_id INNER JOIN trans AS T3 ON T2.account_id = T3.account_id WHERE T3.bank = 'AB' AND T1.A3 = 'north Bohemia'
150
moderate
thrombosis_prediction
How many female patients who came at the hospital in 1997 was immediately followed at the outpatient clinic?
female refers to sex = 'F'; came at the hospital in 1997 refers to year(Description) = '1997'; followed at the outpatient clinic refers to Admission = '-'
SELECT COUNT(*) FROM Patient WHERE STRFTIME('%Y', Description) = '1997' AND SEX = 'F' AND Admission = '-'
1,162
moderate
toxicology
What is the ratio of Hydrogen elements in molecule ID TR006? Please indicate its label.
hydrogen refers to element = 'h'; ratio = DIVIDE(SUM(element = 'h'), count(element)) where molecule_id = 'TR006' ; label = '+' mean molecules are carcinogenic; label = '-' means molecules are non-carcinogenic
SELECT CAST(COUNT(CASE WHEN T.element = 'h' THEN T.atom_id ELSE NULL END) AS REAL) / COUNT(T.atom_id) FROM ( SELECT DISTINCT T1.atom_id, T1.element, T1.molecule_id, T2.label FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.molecule_id = 'TR006' ) AS T UNION ALL SELECT DISTINCT T3.label FROM ( SELECT DISTINCT T1.atom_id, T1.element, T1.molecule_id, T2.label FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.molecule_id = 'TR006' ) AS T3
282
challenging
formula_1
Please list the time of the races held on Sepang International Circuit.
SELECT DISTINCT T2.time FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T1.name = 'Sepang International Circuit'
856
simple
card_games
What are the colors of cards from ID 1-20? What are the format of these cards?
ID 1-20 refers to id BETWEEN 1 and 20;
SELECT T1.colors, T2.format FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T1.id BETWEEN 1 AND 20
390
simple
card_games
Among the cards whose version of frame style is 1997, what is the status of the card illustrated by D. Alexander Gregory in legacy play format that has sensitive content or Wizards of the Coast?
version of frame style is 1997 refers to frameVersion = '1997'; illustrated by D. Alexander Gregory refers to artist = 'D. Alexander Gregory'; sensitive content refers to hasContentWarning = 1; legacy play format refers to format = 'legacy'; status of the card refers to status
SELECT DISTINCT T2.status FROM cards AS T1 INNER JOIN legalities AS T2 ON T2.uuid = T1.uuid WHERE T1.frameVersion = 1997 AND T1.hasContentWarning = 1 AND T1.artist = 'D. Alexander Gregory' AND T2.format = 'legacy'
521
challenging