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
What is the language of the card with the multiverse number 149934?
multiverse number 149934 refers to multiverseid = 149934;
SELECT language FROM foreign_data WHERE multiverseid = 149934
422
simple
codebase_community
Identify the number of posts that have been viewed over 35000 times but have received no comments from other users.
have been viewed over 35000 times refers to ViewCount > 35000; received no comments refers to CommentCount = 0;
SELECT COUNT(Id) FROM posts WHERE ViewCount > 35000 AND CommentCount = 0
688
simple
formula_1
Among the drivers that finished the race in the 2008 Australian Grand Prix, how many of them have participated in Formula_1 races?
COUNT(raceID) > 0 reveals that this driver participated in races; drivers who finished the race refers to time has value.
SELECT COUNT(*) FROM ( SELECT T1.driverId FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T2.name = 'Australian Grand Prix' AND T2.year = 2008 AND T1.time IS NOT NULL GROUP BY T1.driverId HAVING COUNT(T2.raceId) > 0 )
940
moderate
student_club
What is the average attendance of meetings in 2020?
meetings in 2020 refers to type = 'Meeting' where YEAR(event_date) = 2020; average = DIVIDE(COUNT(event_id), COUNT(DISTINCT event_name))
SELECT CAST(COUNT(T2.link_to_event) AS REAL) / COUNT(DISTINCT T2.link_to_event) FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event WHERE SUBSTR(T1.event_date, 1, 4) = '2020' AND T1.type = 'Meeting'
1,324
moderate
california_schools
How many test takers are there at the school/s whose mailing city address is in Fresno?
SELECT T1.NumTstTakr FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T2.MailCity = 'Fresno'
53
simple
toxicology
What is the element with the atom ID of TR004_7 in molecule that is not 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 T1.element FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.atom_id = 'TR004_7' AND T2.label = '-'
334
challenging
european_football_2
List down the long name for slow speed class team.
slow speed class refers to buildUpPlaySpeedClass = 'Slow'; long name refers to team_long_name
SELECT DISTINCT t1.team_long_name FROM Team AS t1 INNER JOIN Team_Attributes AS t2 ON t1.team_api_id = t2.team_api_id WHERE t2.buildUpPlaySpeedClass = 'Slow'
1,129
simple
toxicology
Identify all connected atoms with a triple bond.
triple bond refers to bond_type = '#';
SELECT T2.atom_id, T2.atom_id2 FROM bond AS T1 INNER JOIN connected AS T2 ON T1.bond_id = T2.bond_id WHERE T1.bond_type = '#'
216
simple
student_club
Among the members who incurred expenses in more than one event, who paid the most amount?
paid the most amount refers to for expense incurred in more than one event refers to MAX(cost where COUNT(event_id) > 1)
SELECT T2.member_id FROM expense AS T1 INNER JOIN member AS T2 ON T1.link_to_member = T2.member_id INNER JOIN budget AS T3 ON T1.link_to_budget = T3.budget_id INNER JOIN event AS T4 ON T3.link_to_event = T4.event_id GROUP BY T2.member_id HAVING COUNT(DISTINCT T4.event_id) > 1 ORDER BY SUM(T1.cost) DESC LIMIT 1
1,451
challenging
california_schools
Name schools in Riverside which the average of average math score for SAT is grater than 400, what is the funding type of these schools?
Average of average math = sum(average math scores) / count(schools).
SELECT T1.sname, T2.`Charter Funding Type` FROM satscores AS T1 INNER JOIN frpm AS T2 ON T1.cds = T2.CDSCode WHERE T2.`District Name` LIKE 'Riverside%' GROUP BY T1.sname, T2.`Charter Funding Type` HAVING CAST(SUM(T1.AvgScrMath) AS REAL) / COUNT(T1.cds) > 400
25
moderate
california_schools
List the names of schools with more than 30 difference in enrollements between K-12 and ages 5-17? Please also give the full street adress of the schools.
Diffrence in enrollement = `Enrollment (K-12)` - `Enrollment (Ages 5-17)`
SELECT T1.School, T1.StreetAbr FROM schools AS T1 INNER JOIN frpm AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.`Enrollment (K-12)` - T2.`Enrollment (Ages 5-17)` > 30
23
moderate
student_club
State the name of students from Georgetown, South Carolina.
name of students means the full name; full name refers to first_name, last_name; Georgetown is a city; South Carolina is a state
SELECT T1.first_name, T1.last_name FROM member AS T1 INNER JOIN zip_code AS T2 ON T1.zip = T2.zip_code WHERE T2.city = 'Georgetown' AND T2.state = 'South Carolina'
1,383
simple
thrombosis_prediction
Among the patients with a normal blood glucose, how many of them don't have thrombosis?
normal blood glucose refers to GLU < 180; don't have thrombosis refers to Thrombosis = 0;
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.GLU < 180 AND T3.Thrombosis = 0
1,304
moderate
thrombosis_prediction
Among the patients who were diagnosed with SLE, who is the oldest with normal hemoglobin level. Provide the ID and sex.
diagnosed with SLE refers to Diagnosis = 'SLE'; oldest refers to MIN(Birthday); normal hemoglobin level refers to 10 < HGB < 17;
SELECT T1.ID, T1.SEX FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Diagnosis = 'SLE' AND T2.HGB > 10 AND T2.HGB < 17 ORDER BY T1.Birthday ASC LIMIT 1
1,238
moderate
financial
How many male clients in 'Hl.m. Praha' district?
District data appears in the A2; Male means that gender = 'M'
SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.gender = 'M' AND T2.A2 = 'Hl.m. Praha'
154
simple
superhero
What is the publisher's name of Blue Beetle II?
Blue Beetle II refers to superhero_name = 'Blue Beetle II'
SELECT T2.publisher_name FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T1.superhero_name = 'Blue Beetle II'
734
simple
superhero
Describe the names of neutral alignment superheroes.
names of superheroes refers to superhero_name; neutral alignment refers to alignment = 'Neutral';
SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN alignment AS T2 ON T1.alignment_id = T2.id WHERE T2.alignment = 'Neutral'
785
simple
card_games
List down the uuid for legacy cards and the foreign language of these cards.
legacy card refers to format = 'legacy'; foreign language refers to language in foreign_data
SELECT T1.uuid, T3.language FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid INNER JOIN foreign_data AS T3 ON T1.uuid = T3.uuid WHERE T2.format = 'legacy'
384
simple
superhero
What is Abomination's superpower?
Abomination refers to superhero_name = 'Abomination'; superpower refers to power_name;
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.superhero_name = 'Abomination'
792
simple
thrombosis_prediction
For patients with severe degree of thrombosis, list their ID, sex and dieseas the patient is diagnosed with.
severe degree of thrombosis refers to thrombosis = 2; disease refers to diagnosis
SELECT DISTINCT T1.ID, T1.SEX, T1.Diagnosis FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T2.Thrombosis = 2
1,157
simple
california_schools
What is the total amount of Community College District closure in 1989 in the city of San Francisco?
SELECT COUNT(School) FROM schools WHERE strftime('%Y', ClosedDate) = '1989' AND City = 'San Francisco' AND DOCType = 'Community College District'
67
simple
student_club
How many of the members' hometowns are from Maryland state?
SELECT COUNT(T2.member_id) FROM zip_code AS T1 INNER JOIN member AS T2 ON T1.zip_code = T2.zip WHERE T1.state = 'Maryland'
1,373
simple
california_schools
How many students from the ages of 5 to 17 are enrolled at the State Special School school in Fremont for the 2014-2015 academic year?
State Special School means EdOpsCode = 'SSS'
SELECT T1.`Enrollment (Ages 5-17)` FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.EdOpsCode = 'SSS' AND T2.City = 'Fremont' AND T1.`Academic Year` BETWEEN 2014 AND 2015
72
moderate
card_games
How many cards are there in the base set of "Hauptset Zehnte Edition"?
"Hauptset Zehnte Edition" refers to translation = 'Hauptset Zehnte Edition'; number of cards refers to baseSetSize
SELECT T1.baseSetSize FROM sets AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.code WHERE T2.translation = 'Hauptset Zehnte Edition'
467
simple
superhero
Who is the dumbest superhero?
the dumbest superhero refers to MIN(attribute_value) where attribute_name = 'Intelligence'
SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN hero_attribute AS T2 ON T1.id = T2.hero_id INNER JOIN attribute AS T3 ON T2.attribute_id = T3.id WHERE T3.attribute_name = 'Intelligence' ORDER BY T2.attribute_value LIMIT 1
736
moderate
thrombosis_prediction
For all the female patient age 50 and above, who has abnormal red blood cell count. State if they were admitted to hospital.
female patient refers to Sex = 'F'; age 50 and above = SUBTRACT(year(current_timestamp), year(Birthday)) > = 50; abnormal red blood cell count refers to RBC < = 3.5 or RBC > = 6.0; Admission = '+' means the patient was admitted to the hospital; Admission = '-' means the patient was not admitted to the hospital;
SELECT DISTINCT T1.ID, T1.Admission FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'F' AND (T2.RBC <= 3.5 OR T2.RBC >= 6.0) AND STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) >= 50
1,236
challenging
codebase_community
How many users obtained the "Announcer" badge?
"Announcer" is the Name of badge; user refers to UserId
SELECT COUNT(id) FROM badges WHERE Name = 'Announcer'
605
simple
toxicology
Identify by their ID the molecules in which there is silicon.
silicon refers to element = 'si';
SELECT T.atom_id FROM atom AS T WHERE T.element = 'si'
205
simple
thrombosis_prediction
What is the disease patient '30609' diagnosed with. List all the date of laboratory tests done for this patient.
'30609' is an ID; disease means diagnosis
SELECT T1.Diagnosis, T2.Date FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.ID = 30609
1,153
simple
codebase_community
What is the post ID and the comments commented in the post titled by "Group differences on a five point Likert item"?
Title = 'Group differences on a five point Likert item';
SELECT T2.Id, T1.Text FROM comments AS T1 INNER JOIN posts AS T2 ON T1.PostId = T2.Id WHERE T2.Title = 'Group differences on a five point Likert item'
712
simple
student_club
State the major name for the Vice President of the club.
'Vice President' is a position of Student Club
SELECT T2.major_name FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.position = 'Vice President'
1,354
simple
thrombosis_prediction
Are there more in-patient or outpatient who were male? What is the deviation in percentage?
male refers to SEX = 'M'; in-patient refers to Admission = '+'; outpatient refers to Admission = '-'; SUBTRACT(COUNT(ID) where SEX = 'M' and Admission = '+', COUNT(ID) where SEX  = 'M' and Admission = '-')
SELECT CAST(SUM(CASE WHEN Admission = '+' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN Admission = '-' THEN 1 ELSE 0 END) FROM Patient WHERE SEX = 'M'
1,149
moderate
superhero
Calculate the average height for each superhero.
average = DIVIDE(SUM(height_cm), COUNT(all heros));
SELECT CAST(SUM(height_cm) AS REAL) / COUNT(id) FROM superhero
791
simple
student_club
What is the major of Garrett Gerke and which department does it belong to?
major refers to major name;
SELECT T2.major_name, T2.department FROM member AS T1 INNER JOIN major AS T2 ON T2.major_id = T1.link_to_major WHERE T1.first_name = 'Garrett' AND T1.last_name = 'Gerke'
1,459
simple
codebase_community
Provide the badge names received in 2011 for the user whose location is in the North Pole.
received in 2011 refers to year(Date) = 2011;
SELECT T2.Name FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE STRFTIME('%Y', T2.Date) = '2011' AND T1.Location = 'North Pole'
647
simple
thrombosis_prediction
What is the most common sign of patients with SLE disease?
the most common sign refers to MAX(symptoms); 'SLE' refers to diagnosis
SELECT Symptoms FROM Examination WHERE Diagnosis = 'SLE' GROUP BY Symptoms ORDER BY COUNT(Symptoms) DESC LIMIT 1
1,196
simple
thrombosis_prediction
Please list the diagnosis of the patients whose total protein is lower than normal.
total protein is lower than normal refers to TP < 6.0;
SELECT T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TP < 6.0
1,288
simple
superhero
List the powers of Hunter Zolomon.
Hunter Zolomon is the full name of superhero; list the powers refers to power_name;
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 = 'Hunter Zolomon'
780
simple
codebase_community
Which post has the highest score? Please give its id and title's name.
the highest score refers to MAX(Score); owner's name refers to DisplayName;
SELECT T1.Id, T2.Title FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId ORDER BY T2.Score DESC LIMIT 1
679
simple
california_schools
What is the phone number of the school that has the highest average score in Math?
SELECT T1.Phone FROM schools AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds ORDER BY T2.AvgScrMath DESC LIMIT 1
19
simple
superhero
Who is the tallest superhero?
who refers to superhero_name; tallest superhero refers to MAX(height_cm);
SELECT superhero_name FROM superhero ORDER BY height_cm DESC LIMIT 1
802
simple
california_schools
Please list the zip code of all the charter schools in Fresno County Office of Education.
Charter schools refers to `Charter School (Y/N)` = 1 in the table fprm
SELECT T2.Zip FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T1.`District Name` = 'Fresno County Office of Education' AND T1.`Charter School (Y/N)` = 1
2
simple
formula_1
Which driver ranked the first in the Australian Grand Prix in 2008? Please give his reference name.
reference name refers to driverRef
SELECT T3.forename, T3.surname, T3.driverRef 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.name = 'Australian Grand Prix' AND T2.rank = 1 AND T1.year = 2008
928
moderate
card_games
Of all the cards that are designed by Aaron Miller, how many of them are incredibly powerful?
designed by Aaron Miller refers to artist = 'Aaron Miller'; are icredibily powerful refers to cardKingdomFoilId = cardKingdomId AND cardKingdomId is not null
SELECT SUM(CASE WHEN artist = 'Aaron Miller' AND cardKingdomFoilId IS NOT NULL AND cardKingdomId IS NOT NULL THEN 1 ELSE 0 END) FROM cards
450
moderate
formula_1
Which race has the shortest actual finishing time? Please give the name and year.
shortest actual finishing time refers to Min(milliseconds) except milliseconds = null;
SELECT T1.name, T1.year FROM races AS T1 INNER JOIN results AS T2 on T1.raceId = T2.raceId WHERE T2.milliseconds IS NOT NULL ORDER BY T2.milliseconds LIMIT 1
961
simple
toxicology
Among the single bond molecule id, which molecules are not carcinogenic?
label = '-' means molecules are non-carcinogenic; single bond refers to bond_type = '-';
SELECT DISTINCT T1.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 = '-'
262
simple
superhero
What is the race of the superhero with maximum attribute value?
maximum attribute value refers to MAX(attribute_value);
SELECT T3.race FROM superhero AS T1 INNER JOIN hero_attribute AS T2 ON T1.id = T2.hero_id INNER JOIN race AS T3 ON T1.race_id = T3.id ORDER BY T2.attribute_value DESC LIMIT 1
810
simple
formula_1
Among all the lap records set on various circuits, what is the time for the fastest one?
SELECT time FROM lapTimes ORDER BY (CASE WHEN INSTR(time, ':') <> INSTR(SUBSTR(time, INSTR(time, ':') + 1), ':') + INSTR(time, ':') THEN CAST(SUBSTR(time, 1, INSTR(time, ':') - 1) AS REAL) * 3600 ELSE 0 END) + (CAST(SUBSTR(time, INSTR(time, ':') - 2 * (INSTR(time, ':') = INSTR(SUBSTR(time, INSTR(time, ':') + 1), ':') + INSTR(time, ':')), INSTR(time, ':') - 1) AS REAL) * 60) + (CAST(SUBSTR(time, INSTR(time, ':') + 1, INSTR(time, '.') - INSTR(time, ':') - 1) AS REAL)) + (CAST(SUBSTR(time, INSTR(time, '.') + 1) AS REAL) / 1000) ASC LIMIT 1
1,006
challenging
codebase_community
Give the number of votes for the post about data visualization.
About data visualization is the Title that contains 'data visualization';
SELECT COUNT(T1.Id) FROM posts AS T1 INNER JOIN votes AS T2 ON T1.Id = T2.PostId WHERE T1.Title LIKE '%data visualization%'
569
simple
codebase_community
List out the dates that users who are located in Rochester, NY obtained their badges?
"Rochester, NY" is the Location of user; user refers to UserId
SELECT T2.Date FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE T1.Location = 'Rochester, NY'
613
simple
card_games
What is the mana cost of cards with a normal layout, a 2003 frame version, with a black border color, and available in paper and mtgo?
available in paper refers to availability = 'paper'; available in mtgo refers to availability = 'mtgo; frameVersion = 2003;borderColor = 'black'
SELECT manaCost FROM cards WHERE availability = 'mtgo,paper' AND borderColor = 'black' AND frameVersion = 2003 AND layout = 'normal'
397
moderate
student_club
Who was the first one paid his/her dues? Tell the full name.
full name refers to first_name, last_name; first paid dues refers to MIN(received_date) where source = 'Dues'
SELECT T1.first_name, T1.last_name FROM member AS T1 INNER JOIN income AS T2 ON T1.member_id = T2.link_to_member WHERE T2.source = 'Dues' ORDER BY T2.date_received LIMIT 1
1,358
simple
formula_1
Please state the reference name of the oldest German driver.
oldest refers to MIN(year(dob)); reference names appear in drverRef.
SELECT driverRef FROM drivers WHERE nationality = 'German' ORDER BY JULIANDAY(dob) ASC LIMIT 1
971
simple
toxicology
List all the elements of atoms that can not bond with any other atoms.
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; atoms cannot bond with other atoms means atom_id NOT in connected table;
SELECT DISTINCT T.element FROM atom AS T WHERE T.element NOT IN ( SELECT DISTINCT T1.element FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id )
247
challenging
california_schools
What is the phone number and extension number for the school that had the 333rd highest average writing score?
SELECT T2.Phone, T2.Ext FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode ORDER BY T1.AvgScrWrite DESC LIMIT 332, 1
57
simple
toxicology
How many atoms belong to the molecule that element is hydrogen and labeled with carcinogenic compound?
label = '+' mean molecules are carcinogenic; hydrogen refers to element = h'
SELECT COUNT(T1.atom_id) AS atomnums_h FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '+' AND T1.element = 'h'
295
simple
superhero
Calculate the average attribute value of all neutral superheroes.
average = AVG(attribute_value); neutral superheroes refers to alignment_id = 3;
SELECT AVG(T1.attribute_value) FROM hero_attribute AS T1 INNER JOIN superhero AS T2 ON T1.hero_id = T2.id INNER JOIN alignment AS T3 ON T2.alignment_id = T3.id WHERE T3.alignment = 'Neutral'
813
simple
card_games
Name all cards with 2015 frame style ranking below 100 on EDHRec.
below 100 on EDHRec refers to EDHRec <100; with 2015 frame style refers to frameVersion = 2015;
SELECT id FROM cards WHERE edhrecRank < 100 AND frameVersion = 2015
343
simple
card_games
Which foreign language used by "A Pedra Fellwar"?
"A Pedra Fellwar" refers to name = 'A Pedra Fellwar'
SELECT DISTINCT language FROM foreign_data WHERE name = 'A Pedra Fellwar'
440
simple
superhero
Provide the superpowers of the superhero called Deathlok.
superpowers refers to power_name; Deathlok refers to superhero_name = 'Deathlok'
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.superhero_name = 'Deathlok'
749
simple
student_club
What are the zip codes that have post office boxes in the country of the country of San Juan Municipio whose state is Puerto Rico?
zip codes that have post office boxes refers to type = 'PO Box'
SELECT zip_code FROM zip_code WHERE type = 'PO Box' AND county = 'San Juan Municipio' AND state = 'Puerto Rico'
1,434
simple
european_football_2
What is the average overall rating of the football player Aaron Doran?
average overall rating = AVG(overall_rating);
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.player_name = 'Aaron Doran'
1,072
simple
financial
State the district and region for loan ID '4990'.
A2, A3 contains the information about district and region respectively.
SELECT T2.A2, T2.A3 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.loan_id = 4990
122
simple
formula_1
From race no. 50 to 100, how many finishers have been disqualified?
disqualified refers to statusID = 2, finisher refers to time! = null; race no. refers to raceId; raceId > 50 and raceId < 100;
SELECT SUM(IIF(time IS NOT NULL, 1, 0)) FROM results WHERE statusId = 2 AND raceID < 100 AND raceId > 50
977
simple
student_club
Which countries have zip codes with post office boxes?
zip codes that have post office boxes refers to type = 'PO Box'
SELECT DISTINCT county FROM zip_code WHERE type = 'PO Box' AND county IS NOT NULL
1,433
simple
financial
How many female customers have a junior credit card?
Female refers to gender = 'F'
SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN disp AS T2 ON T1.client_id = T2.client_id INNER JOIN card AS T3 ON T2.disp_id = T3.disp_id WHERE T1.gender = 'F' AND T3.type = 'junior'
184
simple
thrombosis_prediction
For the patient whose birthday was 1959/3/1, what symptoms did he/she have during the examination on 1993/9/27?
SELECT T2.Symptoms FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.Birthday = '1959-03-01' AND T2.`Examination Date` = '1993-09-27'
1,184
simple
toxicology
What proportion of single bonds are carcinogenic?
single bond refers to bond_type = '-'; label = '+' mean molecules are carcinogenic; proportion = DIVIDE(SUM(label = '+'), COUNT(bond_id)) where bond_type = '-'
SELECT CAST(COUNT(CASE WHEN T2.label = '+' THEN T1.bond_id ELSE NULL END) AS REAL) * 100 / COUNT(T1.bond_id) FROM bond AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.bond_type = '-'
255
moderate
debit_card_specializing
What is the percentage of "premium" against the overall segment in "SVK"?
SELECT CAST(SUM(IIF(Country = 'SVK' AND Segment = 'Premium', 1, 0)) AS FLOAT) * 100 / SUM(IIF(Country = 'SVK', 1, 0)) FROM gasstations
1,528
simple
california_schools
What is the total number of non-chartered schools in the county of Los Angeles with a percent (%) of eligible free meals for grades 1 through 12 that is less than 0.18%?
non-chartered schools refer to schools whose Charter = 0; K-12 means grades 1 through 12; percent of eligible free rate for K-12 = `Free Meal Count (K-12)` * 100 / `Enrollment (K-12)`
SELECT COUNT(T2.School) FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.County = 'Los Angeles' AND T2.Charter = 0 AND CAST(T1.`Free Meal Count (K-12)` AS REAL) * 100 / T1.`Enrollment (K-12)` < 0.18
62
challenging
toxicology
What type of bond is there between the atoms TR004_8 and TR004_20?
type of bond refers to bond_type; between the atoms TR004_8 and TR004_20 refers to atom_id between atom_id = 'TR004_8' and atom_id = 'TR004_20';
SELECT T1.bond_type FROM bond AS T1 INNER JOIN connected AS T2 ON T1.bond_id = T2.bond_id WHERE T2.atom_id = 'TR004_8' AND T2.atom_id2 = 'TR004_20' OR T2.atom_id2 = 'TR004_8' AND T2.atom_id = 'TR004_20'
213
moderate
codebase_community
List the post IDs and badge names of the user Samuel in 2013.
Samuel refers to UserDisplayName; YEAR(CreationDate) = 2013 relates to PostId; YEAR(Date) = 2013 relates to the badge;
SELECT T1.PostId, T2.Name FROM postHistory AS T1 INNER JOIN badges AS T2 ON T1.UserId = T2.UserId WHERE T1.UserDisplayName = 'Samuel' AND STRFTIME('%Y', T1.CreationDate) = '2013' AND STRFTIME('%Y', T2.Date) = '2013'
652
moderate
student_club
List the expenses that spend more than fifty dollars on average.
expense refers to expense_description; spend more than fifty dollars on average refers to DIVIDE( SUM(cost), COUNT(expense_id) ) > 50
SELECT expense_description FROM expense GROUP BY expense_description HAVING AVG(cost) > 50
1,444
simple
card_games
Who is the illustrator that illustrated the least amount of cards? List the format of play of the cards that he/she illustrated.
format of the cards refers to format; illustrator refers to artist; the least amount of cards refers to MIN(artist)
SELECT T1.artist, T2.format FROM cards AS T1 INNER JOIN legalities AS T2 ON T2.uuid = T1.uuid GROUP BY T1.artist ORDER BY COUNT(T1.id) ASC LIMIT 1
520
moderate
student_club
Give the location for "Spring Budget Review".
'Spring Budget Review' is an event name;
SELECT location FROM event WHERE event_name = 'Spring Budget Review'
1,341
simple
formula_1
State the racing year which has the fastest lap time?
'has the fastest lap time?' refers to fastestLapTime has values
SELECT T2.year FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T1.fastestLapTime IS NOT NULL
974
simple
toxicology
Among all chemical compounds that contain molecule TR047, identify the percent that form a double-bond.
TR047 is the molecule id; double bond refers to bond_type = ' = '; percentage = DIVIDE(SUM(bond_type = ' = '), COUNT(all bond_id)) as percent where molecule_id = 'TR047'
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 WHERE T.molecule_id = 'TR047'
287
moderate
financial
Which accounts placed orders for household payment in Pisek?
k_symbol = 'SIPO' refers to household payment
SELECT DISTINCT T2.account_id FROM trans AS T1 INNER JOIN account AS T2 ON T1.account_id = T2.account_id INNER JOIN district AS T3 ON T2.district_id = T3.district_id WHERE T1.k_symbol = 'SIPO' AND T3.A2 = 'Pisek'
142
simple
european_football_2
How many players were born after 1990?
born after 1990 refers to strftime('%Y', birthday) = '1990';
SELECT COUNT(id) FROM Player WHERE STRFTIME('%Y', birthday) > '1990'
1,060
simple
card_games
What's the magic card market name for the set which was released on 2017/6/9?
magic card market name refers to mcmName
SELECT mcmName FROM sets WHERE releaseDate = '2017-06-09'
491
simple
toxicology
What are the elements of the atoms of TR144_8_19?
TR144_8_19 is the bond 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 T2.element FROM connected AS T1 INNER JOIN atom AS T2 ON T1.atom_id = T2.atom_id WHERE T1.bond_id = 'TR144_8_19'
249
challenging
financial
Who are the account holder identification numbers whose spent per month on the credit card is less than the average, in 1998?
Operation = 'VYBER KARTOU' refers to credit card withdrawal
SELECT T1.account_id FROM trans AS T1 INNER JOIN account AS T2 ON T1.account_id = T2.account_id WHERE STRFTIME('%Y', T1.date) = '1998' AND T1.operation = 'VYBER KARTOU' AND T1.amount < (SELECT AVG(amount) FROM trans WHERE STRFTIME('%Y', date) = '1998')
145
moderate
codebase_community
What is the average number of badges obtained by a user with over 200 views?
user with over 200 views refers to Views > 200; average number of badges = Divide (Count(Id), Count(DisplayName))
SELECT CAST(COUNT(T1.Id) AS REAL) / COUNT(DISTINCT T2.DisplayName) FROM badges AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T2.Views > 200
556
simple
superhero
Provide the weight and race of the superhero with superhero ID 40.
weight refers to weight_kg; superhero ID 40 refers to superhero.id = 40;
SELECT T1.weight_kg, T2.race FROM superhero AS T1 INNER JOIN race AS T2 ON T1.race_id = T2.id WHERE T1.id = 40
841
simple
toxicology
Calculate the total atoms consisting of the element carbon and hydrogen.
consisting of element carbon and hydrogen refers to element in('c', 'h')
SELECT COUNT(T.atom_id) FROM atom AS T WHERE T.element = 'c' OR T.element = 'h'
256
simple
codebase_community
Among the users located in United Kingdom, how many users whose post have a total favorite amount of 4 or more?
favorite amount of 4 or more refers to FavoriteCount > = 4; Location = 'United Kingdom';
SELECT COUNT(T1.Id) FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId WHERE T1.Location = 'United Kingdom' AND T2.FavoriteCount >= 4
672
moderate
thrombosis_prediction
What percentage of male patients who first presented to the hospital in 1981 were diagnosed with BEHCET?
male refers to SEX = 'M'; first presented to the hospital in 1981 refers to YEAR(`FIRST DATE`) = '1981'; BEHCET refers to diagnosis; calculation = DIVIDE(SUM(DIAGNOSIS = 'BEHCET') where YEAR(`FIRST DATE`) = '1981', MULTIPLY(COUNT(YEAR(`FIRST DATE`) = '1981')), 100)
SELECT CAST(SUM(CASE WHEN Diagnosis = 'BEHCET' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(ID) FROM Patient WHERE STRFTIME('%Y', `First Date`) = '1981' AND SEX = 'M'
1,191
challenging
formula_1
List out top 10 Spanish drivers who were born before 1982 and have the latest lap time.
born before 1982 refers to year(dob) < 1982; latest lap time refers to Max(time);
SELECT T2.driverId FROM pitStops AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId WHERE T2.nationality = 'Spanish' AND STRFTIME('%Y', T2.dob) < '1982' ORDER BY T1.time DESC LIMIT 10
973
moderate
student_club
How much did the Student_Club members spend on advertisement in September Meeting?
amount spent refers to spent; spend on food in September Meeting refers to category = 'Advertisement' 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 = 'Advertisement' AND SUBSTR(T1.event_date, 6, 2) = '09'
1,335
moderate
financial
How many high-level credit cards have "disponent" type of disposition?
High-level credit cards refers to the cards with the gold type.
SELECT COUNT(T1.card_id) FROM card AS T1 INNER JOIN disp AS T2 ON T1.disp_id = T2.disp_id WHERE T1.type = 'gold' AND T2.type = 'DISPONENT'
139
simple
superhero
Provide the full names of vampire heroes.
vampire heroes refers to race = 'Vampire';
SELECT T1.full_name FROM superhero AS T1 INNER JOIN race AS T2 ON T1.race_id = T2.id WHERE T2.race = 'Vampire'
784
simple
european_football_2
State the chance creation passing class for "PEC Zwolle" on 2013/9/20.
"PEC Zwolle" refers to team_long_name = 'PEC Zwolle'; on 2013/9/20 refers to date = '2013-09-20 00:00:00'
SELECT t2.chanceCreationPassingClass FROM Team AS t1 INNER JOIN Team_Attributes AS t2 ON t1.team_api_id = t2.team_api_id WHERE t1.team_long_name = 'PEC Zwolle' AND SUBSTR(t2.`date`, 1, 10) = '2013-09-20'
1,111
moderate
card_games
How many translations of the name of the set "Salvat 2011"?
translations of the name refers to translation; translation is not NULL; set "Salvat 2011" refers to name = 'Salvat 2011'
SELECT COUNT(DISTINCT T2.translation) FROM sets AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.code WHERE T1.name = 'Salvat 2011' AND T2.translation IS NOT NULL
499
moderate
toxicology
What is the percentage of double bonds in the molecule TR008?
double bond refers to bond_type = ' = '; TR008 is the molecule id; percentage = DIVIDE(SUM(bond_type = ' = '), COUNT(bond_id)) as percent where molecule_id = 'TR008'
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 WHERE T.molecule_id = 'TR008'
226
moderate
student_club
Provide the full name and email address of the Student_Club's Secretary.
full name refers to first_name, last_name; 'Secretary' is a position of Student Club
SELECT first_name, last_name, email FROM member WHERE position = 'Secretary'
1,393
simple
thrombosis_prediction
For the patient who was diagnosed SLE on 1997/1/27, what was his/her original diagnose when he/she came to the hospital for the first time?
'SLE' AND original diagnose refers to diagnosis; 1997/1/27 refer to `Examination Date` = '1997-01-27'; first came to the hospital refers to patient.`First Date`
SELECT T1.Diagnosis FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.ID = ( SELECT ID FROM Examination WHERE `Examination Date` = '1997-01-27' AND Diagnosis = 'SLE' ) AND T2.`Examination Date` = T1.`First Date`
1,183
challenging
superhero
How many green-skinned villains are there in the superhero universe?
green-skinned refers to colour.colour = 'Green' WHERE skin_colour_id = colour.id; villains refers to alignment = 'Bad';
SELECT COUNT(T1.id) FROM superhero AS T1 INNER JOIN alignment AS T2 ON T1.alignment_id = T2.id INNER JOIN colour AS T3 ON T1.skin_colour_id = T3.id WHERE T2.alignment = 'Bad' AND T3.colour = 'Green'
822
moderate
superhero
Calculate the average attribute value of all superheroes.
average attribute value of all superheroes refers to AVG(attribute_value)
SELECT AVG(attribute_value) FROM hero_attribute
746
simple
toxicology
How many atoms belong to the molecule labeled with carcinogenic compounds?
label = '+' mean molecules are carcinogenic;
SELECT COUNT(T1.atom_id) FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '+'
293
simple
formula_1
What's Bruno Senna's Q1 result in the qualifying race No. 354?
race number refers to raceId;
SELECT T1.q1 FROM qualifying AS T1 INNER JOIN drivers AS T2 ON T2.driverId = T1.driverId WHERE T1.raceId = 354 AND T2.forename = 'Bruno' AND T2.surname = 'Senna'
859
simple
README.md exists but content is empty.
Downloads last month
7,639