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
debit_card_specializing
Which country was the card owner of No.667467 in?
SELECT T2.Country FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T1.CardID = '667467'
1,523
simple
superhero
Which group does superhero A-Bomb belong to?
group refers to race; A-Bomb refers to superhero_name = 'A-Bomb';
SELECT T2.race FROM superhero AS T1 INNER JOIN race AS T2 ON T1.race_id = T2.id WHERE T1.superhero_name = 'A-Bomb'
774
simple
toxicology
Name the elements that comprise the atoms of bond TR001_2_4.
element = 'cl' means Chlorine; element = 'c' means Carbon; element = 'h' means Hydrogen; element = 'o' means Oxygen, element = 's' means Sulfur; element = 'n' means Nitrogen, element = 'p' means Phosphorus, element = 'na' means Sodium, element = 'br' means Bromine, element = 'f' means Fluorine; element = 'i' means Iodine; element = 'sn' means Tin; element = 'pb' means Lead; element = 'te' means Tellurium; element = 'ca' means Calcium
SELECT DISTINCT T1.element FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id WHERE T2.bond_id = 'TR001_2_4'
302
challenging
california_schools
What is the complete address of the school with the lowest excellence rate? Indicate the Street, City, Zip and State.
Execellence Rate = NumGE1500 / NumTstTakr; complete address has Street, City, State, Zip code
SELECT T2.Street, T2.City, T2.Zip, T2.State FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode ORDER BY CAST(T1.NumGE1500 AS REAL) / T1.NumTstTakr ASC LIMIT 1
37
moderate
card_games
What kind of printing is on the card that Daren Bader created?
kind of printing refers to availability; Daren Bader created refers to artist = 'Daren Bader'
SELECT DISTINCT availability FROM cards WHERE artist = 'Daren Bader'
418
simple
codebase_community
What is the detailed content of the comment of the post which was created on 7/19/2010 7:37:33 PM?
detailed content of the comment refers to Text; created on 7/19/2010 7:37:33 PM CreationDate = 2010-07-19 19:37:33.0'
SELECT T1.Text FROM comments AS T1 INNER JOIN posts AS T2 ON T1.PostId = T2.Id WHERE T1.CreationDate = '2010-07-19 19:37:33.0'
617
simple
codebase_community
When did the user known as 'IrishStat' create his or her account?
DisplayName = 'IrishStat'; when create his or her account refers to CreationDate;
SELECT CreationDate FROM users WHERE DisplayName = 'IrishStat'
699
simple
card_games
What languages are available in the set known as Archenemy on the magic card market and having the code ARC?
known as Archenemy refers to mcmName = 'Archenemy'; having the code ARC refers to setCode = 'ARC'
SELECT T2.language FROM sets AS T1 INNER JOIN set_translations AS T2 ON T1.code = T2.setCode WHERE T1.mcmName = 'Archenemy' AND T2.setCode = 'ARC'
427
moderate
thrombosis_prediction
What is the anti Cardiolipin antibody concentration of the female patient with the highest uric acid level in the normal range?
anti Cardiolipin antibody concentration refers to `aCL IgG`, `aCL IgM`, `aCL IgA`; female patient refers to Sex = F'; highest uric acid level in the normal range refers to MAX(UA > 6.50);
SELECT T3.`aCL IgG`, T3.`aCL IgM`, T3.`aCL IgA` FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T3.ID = T2.ID WHERE T1.SEX = 'F' AND T2.UA > 6.5 ORDER BY T2.UA DESC LIMIT 1
1,292
challenging
thrombosis_prediction
List and group all patients by sex for total bilirubin (T-BIL) level not within the normal range.
total bilirubin (T-BIL) not within normal range refers to T-BIL > = 2.0
SELECT DISTINCT CASE WHEN T1.SEX = 'F' THEN T1.ID END , CASE WHEN T1.SEX = 'M' THEN T1.ID END FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`T-BIL` >= 2.0
1,225
moderate
thrombosis_prediction
What sex is the patient who in a medical examination was diagnosed with PSS and in a laboratory examination had a blood level of C-reactive protein de 2+, createnine 1 and LDH 123?
PSS' refers to diagnosis; blood level of C-reactive protein de 2+refers to CRP > 2; createnine 1 refers to CRE = 1; LDH 123 refers to LDH = 123
SELECT T1.SEX FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID INNER JOIN Laboratory AS T3 ON T3.ID = T2.ID WHERE T2.Diagnosis = 'PSS' AND T3.CRP = '2+' AND T3.CRE = 1.0 AND T3.LDH = 123
1,194
challenging
debit_card_specializing
What is the percentage of the customers who used EUR in 2012/8/25?
'2012/8/25' can be represented by '2012-08-25'
SELECT CAST(SUM(IIF(T2.Currency = 'EUR', 1, 0)) AS FLOAT) * 100 / COUNT(T1.CustomerID) FROM transactions_1k AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Date = '2012-08-25'
1,525
simple
card_games
Which of the play formats has the highest number of banned status? Indicate the play format and the name of the card.
play format refers to format uuid; banned status refers to status = 'banned'; the highest number of banned status refers to MAX(status = 'banned')
SELECT T2.format, T1.name FROM cards AS T1 INNER JOIN legalities AS T2 ON T2.uuid = T1.uuid WHERE T2.status = 'Banned' GROUP BY T2.format ORDER BY COUNT(T2.status) DESC LIMIT 1
518
moderate
student_club
List the full name of the top five members who spend the most money in the descending order of spending.
full name refers to first_name, last_name; spend the most money refers to MAX(expense.cost)
SELECT T3.first_name, T3.last_name FROM expense AS T1 INNER JOIN budget AS T2 ON T1.link_to_budget = T2.budget_id INNER JOIN member AS T3 ON T1.link_to_member = T3.member_id ORDER BY T2.spent DESC LIMIT 5
1,456
moderate
formula_1
How many points did Lewis Hamilton get in total in all the Formula_1 races he participated?
SELECT SUM(T2.points) FROM drivers AS T1 INNER JOIN results AS T2 ON T1.driverId = T2.driverId WHERE T1.forename = 'Lewis' AND T1.surname = 'Hamilton'
941
simple
student_club
On average, how much did the Student_Club spend on food for the typical event in the past?
DIVIDE(SUM(spent), COUNT(spent)) where category = 'Food'; 'event in the past' means event_status = 'Closed'
SELECT SUM(spent) / COUNT(spent) FROM budget WHERE category = 'Food' AND event_status = 'Closed'
1,397
simple
codebase_community
What is the title for the post which got the highest score comment?
highest score comment refers to Max(comments.Score)
SELECT Title FROM posts WHERE Id = ( SELECT PostId FROM comments ORDER BY Score DESC LIMIT 1 )
561
simple
card_games
Please list the Italian names of the cards in the set Coldsnap with the highest converted mana cost.
card set Coldsnap refers to name = 'Coldsnap'; Italian refers to language = 'Italian'
SELECT T2.name FROM foreign_data AS T1 INNER JOIN cards AS T2 ON T2.uuid = T1.uuid INNER JOIN sets AS T3 ON T3.code = T2.setCode WHERE T3.name = 'Coldsnap' AND T1.language = 'Italian' ORDER BY T2.convertedManaCost DESC LIMIT 1
484
moderate
student_club
Among the budgets for Advertising, list out top three which have the most budgeted amount?
MAX(amount) where category = 'Advertisement'
SELECT budget_id FROM budget WHERE category = 'Advertisement' ORDER BY amount DESC LIMIT 3
1,407
simple
debit_card_specializing
How much did customer 6 consume in total between August and November 2013?
Between August And November 2013 refers to Between 201308 And 201311; First 4 strings of Date represents the year.
SELECT SUM(Consumption) FROM yearmonth WHERE CustomerID = 6 AND Date BETWEEN '201308' AND '201311'
1,483
simple
card_games
Which card costs more converted mana, "Serra Angel" or "Shrine Keeper"?
"Serra Angel" refers to name = 'Serra Angel'; "Shrine Keeper" refers to name = 'Shrine Keeper'; card costs more converted mana when the value of convertedManaCost is greater
SELECT name FROM cards WHERE name IN ('Serra Angel', 'Shrine Keeper') ORDER BY convertedManaCost DESC LIMIT 1
459
moderate
card_games
How many cards designed by UDON and available in mtgo print type has a starting maximum hand size of -1?
UDON refer to artist; availabe in mtgo refers to availability = 'mtgo'; starting maximum hand size of -1 refers to hand = -1
SELECT COUNT(id) FROM cards WHERE hAND = '-1' AND artist = 'UDON' AND Availability = 'print' AND type = 'mtgo'
395
simple
thrombosis_prediction
For in-patient age 50 and above, what is their average anti-cardiolipin antibody (IgG) concentration?
in-patient refers to Admission = '+'; age 50 and above refers to SUBTRACT(year(current_timestamp), year(Birthday)) >= '50'; average anti-cardiolipin antibody (IgG) concentration refers to AVG(aCL IgG)
SELECT AVG(T2.`aCL IgG`) FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) >= 50 AND T1.Admission = '+'
1,161
challenging
card_games
How many translations are there for the set of cards with "Angel of Mercy" in it?
set of cards with "Angel of Mercy" in it refers to name = 'Angel of Mercy'
SELECT COUNT(DISTINCT translation) FROM set_translations WHERE setCode IN ( SELECT setCode FROM cards WHERE name = 'Angel of Mercy' ) AND translation IS NOT NULL
463
simple
student_club
Which budget category does the expense 'Posters' fall to?
'Posters' refers to expense description
SELECT DISTINCT T2.category FROM expense AS T1 INNER JOIN budget AS T2 ON T1.link_to_budget = T2.budget_id WHERE T1.expense_description = 'Posters'
1,465
simple
superhero
Among the superheroes with the super power of "Super Strength", how many of them have a height of over 200cm?
super power of "Super Strength" refers to power_name = 'Super Strength'; a height of over 200cm refers to height_cm > 200
SELECT COUNT(T1.id) FROM superhero AS T1 INNER JOIN hero_power AS T2 ON T1.id = T2.hero_id INNER JOIN superpower AS T3 ON T2.power_id = T3.id WHERE T3.power_name = 'Super Strength' AND T1.height_cm > 200
719
moderate
codebase_community
How old is the most influential user?
How old describes age; the most influential refers to user where MAX(Reputation);
SELECT Age FROM users WHERE Reputation = ( SELECT MAX(Reputation) FROM users )
661
simple
card_games
Tell the Japanese name of the set which card "Fellwar Stone" is in it.
Japanese name refers to language = 'Japanese'; card "Fellwar Stone" refers to name = 'Fellwar Stone'
SELECT T2.translation FROM cards AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.setCode WHERE T1.name = 'Fellwar Stone' AND T2.language = 'Japanese' AND T2.translation IS NOT NULL
500
moderate
formula_1
What are the average points of British constructors?
average points = AVG(points); British is a nationality
SELECT AVG(T1.points) FROM constructorStandings AS T1 INNER JOIN constructors AS T2 on T1.constructorId = T2.constructorId WHERE T2.nationality = 'British'
948
simple
california_schools
Which exclusively virtual schools have the top 5 highest average reading scores?
Exclusively virtual refers to Virtual = 'F'.
SELECT T2.School FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T2.Virtual = 'F' ORDER BY T1.AvgScrRead DESC LIMIT 5
41
simple
thrombosis_prediction
How many male patients have their glutamic oxaloacetic transaminase in the normal range?
male refers to Sex = 'M'; glutamic oxaloacetic transaminase in the normal range refers to GOT < 60;
SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GOT < 60 AND T1.SEX = 'M'
1,280
simple
thrombosis_prediction
What is the percentage of female patient were born after 1930?
female refers to Sex = 'F'; patient who were born after 1930 refers to year(Birthday) > '1930'; calculation = DIVIDE(COUNT(ID) where year(Birthday) > '1930' and SEX = 'F'), (COUNT(ID) where SEX = 'F')
SELECT CAST(SUM(CASE WHEN STRFTIME('%Y', Birthday) > '1930' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Patient WHERE SEX = 'F'
1,150
moderate
debit_card_specializing
For the earliest customer, what segment did he/she have?
SELECT T2.Segment FROM transactions_1k AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID ORDER BY Date ASC LIMIT 1
1,517
simple
formula_1
What was Lewis Hamilton's final rank in the 2008 Australian Grand Prix?
final rank refers to positionOrder
SELECT T2.positionOrder 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 T3.forename = 'Lewis' AND T3.surname = 'Hamilton' AND T1.name = 'Australian Grand Prix' AND T1.year = 2008
933
moderate
thrombosis_prediction
What was the anti-nucleus antibody concentration level for the patient id 3605340 on 1996/12/2?
anti-nucleus antibody refers to ANA; 1996/12/2 refers to `Examination Date` = '1996-12-02'
SELECT ANA FROM Examination WHERE ID = 3605340 AND `Examination Date` = '1996-12-02'
1,176
simple
student_club
What is the amount of the funds that the Vice President received?
'Vice President' is a position of Student Club; funds received refers to amount;
SELECT T2.amount FROM member AS T1 INNER JOIN income AS T2 ON T1.member_id = T2.link_to_member WHERE T1.position = 'Vice President'
1,331
simple
student_club
Among all the closed events, which event has the highest spend-to-budget ratio?
closed events refers to event_name where status = 'Closed'; highest spend-to budget ratio refers to MAX(DIVIDE(spent, amount))
SELECT T2.event_name FROM budget AS T1 INNER JOIN event AS T2 ON T1.link_to_event = T2.event_id WHERE T2.status = 'Closed' ORDER BY T1.spent / T1.amount DESC LIMIT 1
1,376
moderate
thrombosis_prediction
For the patients who are diagnosed with SJS, how many of them have a normal level of total protein?
diagnosed with SJS refers to Diagnosis = 'SJS'; normal level of total protein refers to TP > 6.0 and TP < 8.5;
SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Diagnosis = 'SJS' AND T2.TP > 6.0 AND T2.TP < 8.5
1,289
moderate
card_games
What is card number 4 in the set Coldsnap?
card set Coldsnap refers to name = 'Coldsnap'; card number 4 refers to number = 4
SELECT T1.name FROM cards AS T1 INNER JOIN sets AS T2 ON T2.code = T1.setCode WHERE T2.name = 'Coldsnap' AND T1.number = 4
478
simple
thrombosis_prediction
Provide the ID, sex, birthday of all patients diagnosed with 'RA' that are within the UN normal index.
within the UN normal index refers to UN < 30; Diagnosis = 'RA'
SELECT DISTINCT T1.ID, T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.UN < 30 AND T1.Diagnosis = 'RA'
1,221
simple
european_football_2
What percentage is Landon Donovan's overall rating higher than Jordan Bowery on 2013/7/12?
Landon Donovan's refers to player_name = 'Landon Donovan'; Jordan Bowery refers to player_name = 'Jordan Bowery';  percentage refers to DIVIDE(SUBTRACT(player_name = 'Landon Donovan' overall_rating; player_name = 'Jordan Bowery' overall_rating), player_name = 'Landon Donovan' overall_rating)*100
SELECT (SUM(CASE WHEN t1.player_name = 'Landon Donovan' THEN t2.overall_rating ELSE 0 END) * 1.0 - SUM(CASE WHEN t1.player_name = 'Jordan Bowery' THEN t2.overall_rating ELSE 0 END)) * 100 / SUM(CASE WHEN t1.player_name = 'Landon Donovan' THEN t2.overall_rating ELSE 0 END) LvsJ_percent FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_fifa_api_id = t2.player_fifa_api_id WHERE SUBSTR(t2.`date`, 1, 10) = '2013-07-12'
1,115
challenging
formula_1
How many driver participated in race ID number 18?
SELECT COUNT(driverId) FROM driverStandings WHERE raceId = 18
966
simple
european_football_2
How many matches were held in the Belgium Jupiler League in April, 2009?
Belgium Jupiler League refers to League.name = 'Belgium Jupiler League'; in April, 2009 refers to strftime('%Y', date) = '2009' AND strftime('%m', date) = '04';
SELECT COUNT(t2.id) FROM League AS t1 INNER JOIN Match AS t2 ON t1.id = t2.league_id WHERE t1.name = 'Belgium Jupiler League' AND SUBSTR(t2.`date`, 1, 4) = '2009'
1,091
moderate
student_club
How many members attended the "Women's Soccer" event?
'Women's Soccer' is the event name;
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 = 'Women''s Soccer'
1,371
simple
codebase_community
Give the user's reputation and up vote number of the user that commented "fine, you win :)".
Text = 'fine, you win :)';
SELECT T2.Reputation, T2.UpVotes FROM comments AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T1.Text = 'fine, you win :)'
705
simple
toxicology
What are the bond type and the atoms of the bond ID of TR001_6_9?
double bond refers to bond_type = ' = '; single bond refers to bond_type = '-'; triple bond refers to bond_type = '#'; atoms refer to atom_id or atom_id2
SELECT T1.bond_type, T2.atom_id, T2.atom_id2 FROM bond AS T1 INNER JOIN connected AS T2 ON T1.bond_id = T2.bond_id WHERE T2.bond_id = 'TR001_6_9'
236
moderate
financial
What is the average number of crimes committed in 1995 in regions where the number exceeds 4000 and the region has accounts that are opened starting from the year 1997?
A3 refers to region names; A15 stands for the average number of crimes commited in 1995.
SELECT AVG(T1.A15) FROM district AS T1 INNER JOIN account AS T2 ON T1.district_id = T2.district_id WHERE STRFTIME('%Y', T2.date) >= '1997' AND T1.A15 > 4000
152
moderate
student_club
Which college is the vice president of the Student_Club from?
Vice President is a position of the Student Club
SELECT T2.college FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.position LIKE 'vice president'
1,319
simple
codebase_community
Under the vote type of 8, provide the display names and websites URLs of the user who got the highest bounty amount.
vote type of 8 refers to VoteTypeId = 8; the highest bounty amount refers to MAX(BountyAmount);
SELECT DisplayName, WebsiteUrl FROM users WHERE Id = ( SELECT UserId FROM votes WHERE VoteTypeId = 8 ORDER BY BountyAmount DESC LIMIT 1 )
657
moderate
codebase_community
How many votes did the user No.58 take on 2010/7/19?
user no. 58 refers to UserId = 58; on 2010/7/19 refers to CreationDate = '2010-07-19'
SELECT COUNT(Id) FROM votes WHERE UserId = 58 AND CreationDate = '2010-07-19'
558
simple
card_games
Among black card borders, which card has full artwork?
white card borders refers to borderColor = 'white'; has full artwork refers to isFullArt = 1
SELECT id FROM cards WHERE borderColor = 'black' AND isFullArt = 1
437
simple
card_games
How many cards are oversized, reprinted, and printed for promotions?
are oversized refers to isOversized = 1; reprinted refers to isReprint = 1; printed for promotions refers to isPromo = 1
SELECT COUNT(id) FROM cards WHERE isOversized = 1 AND isReprint = 1 AND isPromo = 1
420
simple
financial
What is the sum that client number 4's account has following transaction 851? Who owns this account, a man or a woman?
SELECT T3.balance, T1.gender FROM client 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 T1.client_id = 4 AND T3.trans_id = 851
177
simple
card_games
Calculate the percentage of the cards availabe in Chinese Simplified.
Chinese Simplified' is the language; percentage = Divide(Sum(id where language = 'Chinese Simplified'), Count(id)) *100
SELECT CAST(SUM(CASE WHEN T2.language = 'Chinese Simplified' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.id) FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T1.uuid = T2.uuid
352
moderate
financial
State different accounts who have account opening date before 1997 and own an amount of money greater than 3000USD
SELECT DISTINCT T2.account_id FROM trans AS T1 INNER JOIN account AS T2 ON T1.account_id = T2.account_id WHERE STRFTIME('%Y', T2.date) < '1997' AND T1.amount > 3000
102
simple
debit_card_specializing
Please list the disparate time of the transactions taken place in the gas stations from chain no. 11.
SELECT DISTINCT T1.Time FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T2.ChainID = 11
1,507
simple
formula_1
What time did the the 2010's Formula_1 race took place on the Abu Dhabi Circuit?
SELECT T2.date, T2.time FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T2.year = 2010 AND T2.name = 'Abu Dhabi Grand Prix'
922
simple
formula_1
List the driver's ID of the top five driver, by descending order, the fastest time during the first lap of the race.
fastest time refers to Min(time);
SELECT driverId FROM lapTimes WHERE lap = 1 ORDER BY time LIMIT 5
976
simple
financial
How many 'classic' cards are eligible for loan?
when the account type = 'OWNER', it's eligible for loan
SELECT COUNT(T1.card_id) FROM card AS T1 INNER JOIN disp AS T2 ON T1.disp_id = T2.disp_id WHERE T1.type = 'classic' AND T2.type = 'Owner'
153
simple
california_schools
How many schools in Contra Costa (directly funded) have number of test takers not more than 250?
SELECT COUNT(T1.CDSCode) FROM frpm AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds WHERE T1.`Charter Funding Type` = 'Directly funded' AND T1.`County Name` = 'Contra Costa' AND T2.NumTstTakr <= 250
18
simple
thrombosis_prediction
Please list the top three patients' birthdays with the highest glutamic pylvic transaminase in the normal range.
highest glutamic pylvic transaminase in the normal range refers to MAX(GPT < 60);
SELECT T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GPT < 60 ORDER BY T2.GPT DESC LIMIT 3
1,282
simple
student_club
Which department was the President of the club in?
'President' is a position of Student Club
SELECT T2.department FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.position = 'President'
1,356
simple
codebase_community
Calculate the ratio of votes in 2010 and 2011.
DIVIDE(COUNT(Id where YEAR(CreationDate) = 2010), COUNT(Id where YEAR(CreationDate) = 2011)) FROM votes;
SELECT CAST(SUM(IIF(STRFTIME('%Y', CreationDate) = '2010', 1, 0)) AS REAL) / SUM(IIF(STRFTIME('%Y', CreationDate) = '2011', 1, 0)) FROM votes
629
simple
toxicology
Which carcinogenic molecule have the highest number of atoms consisted in it?
label = '+' mean molecules are carcinogenic; molecule that have the highest number of atoms consisted in in refers to MAX(COUNT(atom.molecule_id))
SELECT T.molecule_id FROM ( SELECT T2.molecule_id, COUNT(T1.atom_id) FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '+' GROUP BY T2.molecule_id ORDER BY COUNT(T1.atom_id) DESC LIMIT 1 ) t
329
moderate
formula_1
How old is the youngest Japanese driver? What is his name?
youngest Japanese driver refers to max(dob); Japanese refers to nationality = 'Japanese'; age = 2022-year(dob)+1
SELECT STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', dob), forename , surname FROM drivers WHERE nationality = 'Japanese' ORDER BY dob DESC LIMIT 1
898
simple
debit_card_specializing
Who among KAM's customers consumed the most? How much did it consume?
SELECT T2.CustomerID, SUM(T2.Consumption) FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Segment = 'KAM' GROUP BY T2.CustomerID ORDER BY SUM(T2.Consumption) DESC LIMIT 1
1,488
simple
toxicology
How many elements are contained in bond_id TR001_3_4?
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 COUNT(DISTINCT T1.element) FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id WHERE T2.bond_id = 'TR001_3_4'
319
challenging
card_games
Indicates the name of all the languages into which the set whose number of cards is 309 is translated.
set refer to setCode; number of cards refers to baseSetSize; baseSetsize = 309
SELECT T2.language FROM sets AS T1 INNER JOIN set_translations AS T2 ON T1.code = T2.setCode WHERE T1.baseSetSize = 309
404
simple
formula_1
In which location does the Hungaroring circuit located? Also, find the country and coordinates of this circuit?
coordinates expressed in latitude and longitude refers to (lat, lng)
SELECT country, lat, lng FROM circuits WHERE name = 'Hungaroring'
993
simple
student_club
Was each expense in October Meeting on October 8, 2019 approved?
event_name = 'October Meeting' where event_date = '2019-10-08'; approved = True means expenses was approved; approved = False means expenses was not approved
SELECT T3.approved FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event INNER JOIN expense AS T3 ON T2.budget_id = T3.link_to_budget WHERE T1.event_name = 'October Meeting' AND T1.event_date LIKE '2019-10-08%'
1,338
moderate
financial
Who are the female account holders who own credit cards and also have loans?
Female refers to gender = 'F'
SELECT T1.client_id FROM client AS T1 INNER JOIN disp AS T2 ON T1.client_id = T2.client_id INNER JOIN loan AS T3 ON T2.account_id = T3.account_id INNER JOIN card AS T4 ON T2.disp_id = T4.disp_id WHERE T1.gender = 'F'
146
simple
student_club
How many members have education major in the College of Education & Human Services?
'education' is the major name; 'Member' is a position of club;
SELECT COUNT(T1.member_id) FROM member AS T1 INNER JOIN major AS T2 ON T2.major_id = T1.link_to_major WHERE T1.position = 'Member' AND T2.major_name LIKE '%Education%' AND T2.college = 'College of Education & Human Services'
1,441
moderate
formula_1
What is the average fastest lap time in seconds for Lewis Hamilton in all the Formula_1 races?
average fastest lap time = avg(fastestLapTime); The time is recorded on 'MM:SS.mmm'
SELECT AVG(CAST(SUBSTR(T2.fastestLapTime, 1, INSTR(T2.fastestLapTime, ':') - 1) AS INTEGER) * 60 + CAST(SUBSTR(T2.fastestLapTime, INSTR(T2.fastestLapTime, ':') + 1) AS REAL)) FROM drivers AS T1 INNER JOIN results AS T2 ON T1.driverId = T2.driverId WHERE T1.surname = 'Hamilton' AND T1.forename = 'Lewis'
942
moderate
superhero
List down Ajax's superpowers.
Ajax refers to superhero_name = 'Ajax'; superpowers 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 = 'Ajax'
821
simple
formula_1
List out the code for drivers who have nationality in America.
nationality = 'America'
SELECT code FROM drivers WHERE Nationality = 'American'
964
simple
student_club
Calculate the difference in the percentage of members in Maine and Vermont.
SUBTRACT( DIVIDE( SUM(state = 'Maine'), COUNT(position = 'Member')), DIVIDE( SUM(state = 'Vermont'), COUNT(position = 'Member')) )
SELECT CAST((SUM(CASE WHEN T2.state = 'Maine' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.state = 'Vermont' THEN 1 ELSE 0 END)) AS REAL) * 100 / COUNT(T1.member_id) AS diff FROM member AS T1 INNER JOIN zip_code AS T2 ON T2.zip_code = T1.zip
1,458
moderate
thrombosis_prediction
Please list the patient's ID if he or she has an abnormal level of red blood cell and is followed at the outpatient clinic.
RBC < = 3.5 or RBC > = 6.0 means the patient has an abnormal level of red blood cell; 3.5 < RBC < 6.0 means the patient has a normal level of red blood cell; followed at the outpatient clinic refers to Admission = '-';
SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE (T2.RBC <= 3.5 OR T2.RBC >= 6) AND T1.Admission = '-'
1,307
challenging
codebase_community
Write all the comments left by users who edited the post titled 'Why square the difference instead of taking the absolute value in standard deviation?'
"Why square the difference instead of taking the absolute value in standard deviation?" is the Title of post;
SELECT T2.Comment FROM posts AS T1 INNER JOIN postHistory AS T2 ON T1.Id = T2.PostId WHERE T1.Title = 'Why square the difference instead of taking the absolute value in standard deviation?'
584
moderate
thrombosis_prediction
What is the anti-nucleus antibody concentration of the patient whose total bilirubin is the highest in the normal range?
anti-nucleus antibody concentration refers to ANA; total bilirubin is the highest in the normal range refers to MAX(`T-BIL` < 2.0);
SELECT T3.ANA 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-BIL` < 2.0 ORDER BY T2.`T-BIL` DESC LIMIT 1
1,296
moderate
formula_1
Please list the constructor names with 0 points at race 291.
race at 18 refers to raceID = 18;
SELECT T2.name FROM constructorStandings AS T1 INNER JOIN constructors AS T2 on T1.constructorId = T2.constructorId WHERE T1.points = 0 AND T1.raceId = 291
950
simple
codebase_community
How many users were from New York?
New York refers to Location;
SELECT COUNT(Id) FROM users WHERE Location = 'New York'
625
simple
formula_1
Name the races in year 2017 that are not hosted in year 2000.
not hosted means not in;
SELECT name FROM races WHERE year = 2017 AND name NOT IN ( SELECT name FROM races WHERE year = 2000 )
887
simple
codebase_community
What is the score and the link type ID for post ID 395?
SELECT T1.Score, T2.LinkTypeId FROM posts AS T1 INNER JOIN postLinks AS T2 ON T1.Id = T2.PostId WHERE T2.PostId = 395
601
simple
codebase_community
How long did it take the user, known by his or her display name 'Zolomon' to get the badge? Count from the date the user's account was created.
SUBTRACT(Date from stats_badges, CreationDate) where DisplayName = 'Zolomon';
SELECT T1.Date - T2.CreationDate FROM badges AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T2.DisplayName = 'Zolomon'
692
moderate
toxicology
Indicate which atoms are connected in non-carcinogenic type molecules.
label = '-' means molecules are non-carcinogenic
SELECT DISTINCT T1.atom_id FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id INNER JOIN connected AS T3 ON T1.atom_id = T3.atom_id WHERE T2.label = '-'
211
simple
thrombosis_prediction
List all patients who were followed up at the outpatient clinic who underwent a laboratory test in October 1991 and had a total blood bilirubin level within the normal range.
followed up at the outpatient clinic refers to Admission = '-'; laboratory test in April 1981 refers to Date like '1991-10%'; blood bilirubin level within the normal range refers to T-BIL < 2.0
SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Admission = '-' AND T2.`T-BIL` < 2.0 AND STRFTIME('%Y', T2.Date) = '1991' AND STRFTIME('%m', T2.Date) = '10'
1,192
challenging
codebase_community
What is the display name of the user who is the owner of the most valuable post?
most valuable post refers to Max(FavoriteCount)
SELECT T2.DisplayName FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id ORDER BY T1.FavoriteCount DESC LIMIT 1
541
simple
formula_1
Where can I find the information about the races held on Sepang International Circuit?
information about races refers to url;
SELECT DISTINCT T1.url FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T1.name = 'Sepang International Circuit'
855
simple
thrombosis_prediction
When was the medical information on patient number 48473 first documented, and what disease did she have?
medical information first documented refers to Description; disease refers to diagnosis; patient number refers to id
SELECT `First Date`, Diagnosis FROM Patient WHERE ID = 48473
1,197
simple
superhero
List down at least five full names of superheroes with blue eyes.
blue eyes refers to colour.colour = 'Blue' WHERE eye_colour_id = colour.id;
SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN colour AS T2 ON T1.eye_colour_id = T2.id WHERE T2.colour = 'Blue' LIMIT 5
812
simple
california_schools
What is the charter number of the school that the average score in Writing is 499?
SELECT T1.CharterNum FROM schools AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds WHERE T2.AvgScrWrite = 499
17
simple
california_schools
For the school with the highest average score in Reading in the SAT test, what is its FRPM count for students aged 5-17?
SELECT T2.`FRPM Count (Ages 5-17)` FROM satscores AS T1 INNER JOIN frpm AS T2 ON T1.cds = T2.CDSCode ORDER BY T1.AvgScrRead DESC LIMIT 1
10
simple
superhero
Please list all the superpowers of 3-D Man.
3-D Man refers to superhero_name = '3-D Man'; superpowers 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 = '3-D Man'
717
simple
card_games
How many cards of legalities whose status is restricted are found in a starter deck?
restricted refers to status = 'restricted'; found in the starter deck refers to isStarter = 1;
SELECT COUNT(DISTINCT T1.id) FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T2.status = 'Restricted' AND T1.isStarter = 1
363
simple
card_games
What type of promotion is of card 'Duress'?
card Duress refers to name = 'Duress'; type of promotion refers to promoTypes;
SELECT promoTypes FROM cards WHERE name = 'Duress' AND promoTypes IS NOT NULL
357
simple
european_football_2
Does the KSV Cercle Brugge team have a slow, balanced or fast speed class?
KSV Cercle Brugge refers to team_long_name = 'KSV Cercle Brugge'; speed class refers to buildUpPlaySpeedClass
SELECT DISTINCT t1.buildUpPlaySpeedClass FROM Team_Attributes AS t1 INNER JOIN Team AS t2 ON t1.team_api_id = t2.team_api_id WHERE t2.team_long_name = 'KSV Cercle Brugge'
1,141
moderate
financial
How many accounts were opened in Litomerice in 1996?
A2 refers to district name; Litomerice is one of district names.
SELECT COUNT(T2.account_id) FROM district AS T1 INNER JOIN account AS T2 ON T1.district_id = T2.district_id WHERE STRFTIME('%Y', T2.date) = '1996' AND T1.A2 = 'Litomerice'
111
simple
european_football_2
Which country's players have the heaviest average weights?
heaviest average weights refers to MAX(AVG(weight))
SELECT t1.name FROM Country AS t1 INNER JOIN Match AS t2 ON t1.id = t2.country_id INNER JOIN Player AS t3 ON t2.home_player_1 = t3.player_api_id GROUP BY t1.name ORDER BY AVG(t3.weight) DESC LIMIT 1
1,128
simple
toxicology
Calculate the percentage of carcinogenic molecules with triple bonded Hidrogen atoms.
hydrogen refers to element = 'h'; label = '+' mean molecules are carcinogenic; triple bond refers to bond_type = '#'; percentage = DIVIDE(SUM(label = '+'), COUNT(molecule_id)) * 100.0 where element = 'h' AND bond_type = '#';
SELECT CAST(SUM(CASE WHEN T1.label = '+' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(DISTINCT T1.molecule_id) FROM molecule AS T1 INNER JOIN atom AS T2 ON T1.molecule_id = T2.molecule_id INNER JOIN bond AS T3 ON T1.molecule_id = T3.molecule_id WHERE T3.bond_type = '#' AND T2.element = 'h'
330
challenging
codebase_community
What is the average score of Stephen Turner's posts?
DisplayName = 'Stephen Turner'; average score refers to AVG(Score);
SELECT AVG(T2.Score) FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId WHERE T1.DisplayName = 'Stephen Turner'
680
simple