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 |
---|---|---|---|---|---|
formula_1
|
Which website should I go to if I want to know more about Anthony Davidson?
|
website refers to url
|
SELECT url FROM drivers WHERE forename = 'Anthony' AND surname = 'Davidson'
| 917 |
simple
|
debit_card_specializing
|
Which of the three segments—SME, LAM and KAM—has the biggest and lowest percentage increases in consumption paid in EUR between 2012 and 2013?
|
Increase or Decrease = consumption for 2013 - consumption for 2012; Percentage of Increase = (Increase or Decrease / consumption for 2013) * 100%; Between 2012 And 2013 can be represented by Between 201201 And 201312; First 4 strings of Date represents the year.
|
SELECT CAST((SUM(IIF(T1.Segment = 'SME' AND T2.Date LIKE '2013%', T2.Consumption, 0)) - SUM(IIF(T1.Segment = 'SME' AND T2.Date LIKE '2012%', T2.Consumption, 0))) AS FLOAT) * 100 / SUM(IIF(T1.Segment = 'SME' AND T2.Date LIKE '2012%', T2.Consumption, 0)), CAST(SUM(IIF(T1.Segment = 'LAM' AND T2.Date LIKE '2013%', T2.Consumption, 0)) - SUM(IIF(T1.Segment = 'LAM' AND T2.Date LIKE '2012%', T2.Consumption, 0)) AS FLOAT) * 100 / SUM(IIF(T1.Segment = 'LAM' AND T2.Date LIKE '2012%', T2.Consumption, 0)) , CAST(SUM(IIF(T1.Segment = 'KAM' AND T2.Date LIKE '2013%', T2.Consumption, 0)) - SUM(IIF(T1.Segment = 'KAM' AND T2.Date LIKE '2012%', T2.Consumption, 0)) AS FLOAT) * 100 / SUM(IIF(T1.Segment = 'KAM' AND T2.Date LIKE '2012%', T2.Consumption, 0)) FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID
| 1,482 |
challenging
|
codebase_community
|
Describe the display name of the parent ID for child post with the highest score.
|
If the parent id is not null, the post is the child post; the highest score refers to MAX(Score);
|
SELECT DisplayName FROM users WHERE Id = ( SELECT OwnerUserId FROM posts WHERE ParentId IS NOT NULL ORDER BY Score DESC LIMIT 1 )
| 656 |
simple
|
formula_1
|
How many times did Michael Schumacher won from races hosted in Sepang International Circuit?
|
win from races refers to max(points)
|
SELECT SUM(T2.wins) FROM drivers AS T1 INNER JOIN driverStandings AS T2 ON T2.driverId = T1.driverId INNER JOIN races AS T3 ON T3.raceId = T2.raceId INNER JOIN circuits AS T4 ON T4.circuitId = T3.circuitId WHERE T1.forename = 'Michael' AND T1.surname = 'Schumacher' AND T4.name = 'Sepang International Circuit'
| 903 |
moderate
|
toxicology
|
Is molecule TR151 carcinogenic?
|
label = '+' mean molecules are carcinogenic;
|
SELECT T.label FROM molecule AS T WHERE T.molecule_id = 'TR151'
| 289 |
simple
|
codebase_community
|
Calculate the average view count of posts tagged as 'humor' and write the title and the comments of the posts alongside their scores if applicable.
|
"humor" is the Tags; comment of the post refers to Text; average view count = AVG(ViewCount)
|
SELECT AVG(T2.ViewCount), T2.Title, T1.Text FROM comments AS T1 INNER JOIN posts AS T2 ON T1.Id = T1.PostId WHERE T2.Tags = '<humor>'
| 587 |
moderate
|
codebase_community
|
What is the owner user id of the most valuable post?
|
the most valuable post refers to MAX(FavoriteCount);
|
SELECT OwnerUserId FROM posts WHERE FavoriteCount = ( SELECT MAX(FavoriteCount) FROM posts )
| 660 |
simple
|
card_games
|
Lists all types of cards available in arena.
|
all types refer to subtypes and supertypes
availble in arena refers to availability = 'arena'
|
SELECT DISTINCT subtypes, supertypes FROM cards WHERE availability = 'arena' AND subtypes IS NOT NULL AND supertypes IS NOT NULL
| 399 |
simple
|
debit_card_specializing
|
How many transactions were paid in EUR in the morning of 2012/8/26?
|
'2012/8/26' can be represented by '2012-08-26'; The morning refers to the time before '13:00:00'
|
SELECT COUNT(T1.TransactionID) FROM transactions_1k AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Date = '2012-08-26' AND T1.Time < '13:00:00' AND T2.Currency = 'EUR'
| 1,516 |
moderate
|
debit_card_specializing
|
Among the transactions made in the gas stations in the Czech Republic, how many of them are taken place after 2012/1/1?
|
Gas station in the Czech Republic implies that Country = 'CZE'
|
SELECT COUNT(T1.TransactionID) FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T2.Country = 'CZE' AND strftime('%Y', T1.Date) >= '2012'
| 1,509 |
moderate
|
toxicology
|
Among the atoms that contain element carbon, which one does not contain compound carcinogenic?
|
label = '-' means molecules are non-carcinogenic; carbon refers to element = 'c'
|
SELECT T1.atom_id FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.element = 'c' AND T2.label = '-'
| 297 |
simple
|
superhero
|
Provide the heights of the heroes whose eye colours are amber.
|
heights of the heroes refers to height_cm; eye colours are amber refers to colour.colour = 'Amber' WHERE eye_colour_id = colour.id;
|
SELECT T1.height_cm FROM superhero AS T1 INNER JOIN colour AS T2 ON T1.eye_colour_id = T2.id WHERE T2.colour = 'Amber'
| 781 |
simple
|
thrombosis_prediction
|
Among the patients with a normal Ig G level, how many of them have symptoms?
|
normal Ig G level refers to IGG BETWEEN 900 AND 2000; have symptoms refers to Symptoms IS NOT NULL;
|
SELECT COUNT(T1.ID) 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 T2.IGG BETWEEN 900 AND 2000 AND T3.Symptoms IS NOT NULL
| 1,252 |
moderate
|
codebase_community
|
Identify the total number of posts with views above average.
|
views above average refer to ViewCount > AVG(ViewCount);
|
SELECT Id FROM posts WHERE ViewCount > ( SELECT AVG(ViewCount) FROM posts )
| 686 |
simple
|
codebase_community
|
Give the number of "Revival" badges.
|
number refers to Id; 'Revival' is the Name of badge
|
SELECT COUNT(Id) FROM badges WHERE Name = 'Revival'
| 560 |
simple
|
thrombosis_prediction
|
When is the birthday of the oldest patient whose blood glucose is abnormal?
|
oldest patient refers to MIN(Birthday); blood glucose is abnormal refers to GLU > 180;
|
SELECT T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GLU > 180 ORDER BY T1.Birthday ASC LIMIT 1
| 1,303 |
simple
|
codebase_community
|
Identify the percentage of teenage users.
|
DIVIDE(COUNT(Id where Age BETWEEN 13 and 18), COUNT(Id)) as percentage;
|
SELECT CAST(SUM(IIF(Age BETWEEN 13 AND 18, 1, 0)) AS REAL) * 100 / COUNT(Id) FROM users
| 684 |
simple
|
card_games
|
How many Brazilian Portuguese translated sets are inside the Commander block?
|
Commander block refer to block = 'Commander'; sets refer to setCode; Portuguese refer to language = 'Portuguese (Brasil)'
|
SELECT COUNT(T1.id) FROM sets AS T1 INNER JOIN set_translations AS T2 ON T1.code = T2.setCode WHERE T2.language = 'Portuguese (Brazil)' AND T1.block = 'Commander'
| 405 |
moderate
|
toxicology
|
How many triple type bonds are there?
|
triple type bonds refers to bond_type = '#'
|
SELECT COUNT(T.bond_id) FROM bond AS T WHERE T.bond_type = '#'
| 202 |
simple
|
card_games
|
How many cards did Volkan Baǵa illustrated whose foreign language is in French?
|
Volkan Baǵa refers to artist = 'Volkan Baga'; foreign language is in French refers to language = 'French'
|
SELECT COUNT(T3.id) FROM ( SELECT T1.id FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T2.uuid = T1.uuid WHERE T1.artist = 'Volkan Baǵa' AND T2.language = 'French' GROUP BY T1.id ) AS T3
| 516 |
moderate
|
formula_1
|
Name the driver with the most winning. Mention his nationality and what is his average point scores.
|
the most winning refers to MAX(COUNT(wins)); avg(points);
|
SELECT T1.forename, T1.surname, T1.nationality, AVG(T2.points) FROM drivers AS T1 INNER JOIN driverStandings AS T2 ON T2.driverId = T1.driverId WHERE T2.wins = 1 GROUP BY T1.forename, T1.surname, T1.nationality ORDER BY COUNT(T2.wins) DESC LIMIT 1
| 897 |
moderate
|
thrombosis_prediction
|
For the patient who was diagnosed with SLE on 1994/2/19, what was his/her anti-Cardiolipin antibody concentration status on 1993/11/12?
|
'SLE' refers to Diagnosis; 1994/2/19 refers to Description = '1994-02-19'; anti-Cardiolipin refers to aCL IgM; 1993/11/12 refers to Description = '1993/11/12'
|
SELECT `aCL IgA`, `aCL IgG`, `aCL IgM` FROM Examination WHERE ID IN ( SELECT ID FROM Patient WHERE Diagnosis = 'SLE' AND Description = '1994-02-19' ) AND `Examination Date` = '1993-11-12'
| 1,179 |
moderate
|
card_games
|
List the card names with value that cost more converted mana for the face.
|
more converted mana for the face refers to Max(faceConvertedManaCost);
|
SELECT name FROM cards ORDER BY faceConvertedManaCost LIMIT 1
| 342 |
simple
|
student_club
|
What does the person with the phone number "809-555-3360" major in?
|
major in refers to major_name
|
SELECT T2.major_name FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.phone = '809-555-3360'
| 1,368 |
simple
|
codebase_community
|
State all the tags used by Mark Meckes in his posts that doesn't have comments.
|
DisplayName = 'Mark Meckes';
|
SELECT T3.Tags FROM users AS T1 INNER JOIN postHistory AS T2 ON T1.Id = T2.UserId INNER JOIN posts AS T3 ON T3.Id = T2.PostId WHERE T1.DisplayName = 'Mark Meckes' AND T3.CommentCount = 0
| 637 |
moderate
|
codebase_community
|
Who is the editor of the post titled 'Open source tools for visualizing multi-dimensional data?'
|
'Open source tools for visualizing multi-dimensional data' is the Title of Post
|
SELECT T2.DisplayName FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T1.Title = 'Open source tools for visualizing multi-dimensional data?'
| 581 |
moderate
|
european_football_2
|
What is Ajax's highest chance creation passing score and what is it classified as?
|
Ajax's refers to team_long_name = 'Ajax'; chance creation passing score refers to MAX(chanceCreationPassing); classified as chanceCreationPassingClass
|
SELECT t2.chanceCreationPassing, 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 = 'Ajax' ORDER BY t2.chanceCreationPassing DESC LIMIT 1
| 1,098 |
moderate
|
card_games
|
What is the annual average number of sets that were released between 1/1/2012 to 12/31/2015? Indicate the common langugage of the card.
|
AVG(id); releaseDate BETWEEN 1/1/2012 AND 12/31/2015; the common language refers to MAX(COUNT(language))
|
SELECT (CAST(SUM(T1.id) AS REAL) / COUNT(T1.id)) / 4, T2.language FROM sets AS T1 INNER JOIN set_translations AS T2 ON T1.id = T2.id WHERE T1.releaseDate BETWEEN '2012-01-01' AND '2015-12-31' GROUP BY T1.releaseDate ORDER BY COUNT(T2.language) DESC LIMIT 1
| 523 |
challenging
|
california_schools
|
What are the websites for all the partially virtual chartered schools located in San Joaquin?
|
Virtual = 'P' means partially virtual; Charter schools refers to Charter = 1 in the table schools
|
SELECT Website FROM schools WHERE County = 'San Joaquin' AND Virtual = 'P' AND Charter = 1
| 60 |
simple
|
card_games
|
For all the set of cards that has Japanese translation, what is the percentage of them are only available in non-foil?
|
Japanese translation refers to language = 'Japanese'; in non-foil refers to isNonFoilOnly = 1; percentage of Japanese non foil in Japanese cards refers to DIVIDE(SUM(isNonFoilOnly = 1), SUM(language = 'Japanese'))*100
|
SELECT CAST(SUM(CASE WHEN isNonFoilOnly = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(id) FROM sets WHERE code IN ( SELECT setCode FROM set_translations WHERE language = 'Japanese' )
| 506 |
challenging
|
codebase_community
|
How many views did the post titled 'Integration of Weka and/or RapidMiner into Informatica PowerCenter/Developer' get?
|
"Integration of Weka and/or RapidMiner into Informatica PowerCenter/Developer" is the Title of post; views refers to ViewCount
|
SELECT ViewCount FROM posts WHERE Title = 'Integration of Weka and/or RapidMiner into Informatica PowerCenter/Developer'
| 572 |
moderate
|
superhero
|
Among the male superheroes, list the full names of superheroes with weight greater than the 79% average weight of all superheroes.
|
Calculation = weight_kg > MULTIPLY(AVG(weight_kg), 0.79)
|
SELECT T1.full_name FROM superhero AS T1 INNER JOIN gender AS T2 ON T1.gender_id = T2.id WHERE T2.gender = 'Male' AND T1.weight_kg * 100 > ( SELECT AVG(weight_kg) FROM superhero ) * 79
| 761 |
moderate
|
formula_1
|
Please calculate the race completion percentage of Japanese drivers from 2007 to 2009.
|
from 2007 to 2009 refers to year between 2007 and 2009; race completion refers to time is not null; percentage = Divide(COUNT(DriverID where time is not null and year between 2007 and 2009),Count (DriverID where year between 2007 and 2009))*100;
|
SELECT CAST(SUM(IIF(T1.time IS NOT NULL, 1, 0)) AS REAL) * 100 / COUNT(T1.raceId) FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId INNER JOIN drivers AS T3 on T1.driverId = T3.driverId WHERE T3.nationality = 'Japanese' AND T2.year BETWEEN 2007 AND 2009
| 954 |
challenging
|
card_games
|
What is the release date for the set "Ola de frío"?
|
release date is the date of card set being released; set "Ola de frío" refers to translation = 'Ola de frío'
|
SELECT T1.releaseDate FROM sets AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.code WHERE T2.translation = 'Ola de frío'
| 502 |
simple
|
codebase_community
|
What are the names of badges that users who have the highest reputation obtained?
|
highest reputation refers to Max(Reputation); user refers to UserId
|
SELECT T2.name FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId ORDER BY T1.Reputation DESC LIMIT 1
| 610 |
simple
|
european_football_2
|
In Scotland Premier League, which away team won the most during the 2010 season?
|
Scotland Premier League refers to League.name = 'Scotland Premier League'; away team refers to away_team_api_id; away team that won the most refers to MAX(SUBTRACT(away_team_goal, home_team_goal) > 0); 2010 season refers to season = '2009/2010';
|
SELECT teamInfo.team_long_name FROM League AS leagueData INNER JOIN Match AS matchData ON leagueData.id = matchData.league_id INNER JOIN Team AS teamInfo ON matchData.away_team_api_id = teamInfo.team_api_id WHERE leagueData.name = 'Scotland Premier League' AND matchData.season = '2009/2010' AND matchData.away_team_goal - matchData.home_team_goal > 0 GROUP BY matchData.away_team_api_id ORDER BY COUNT(*) DESC LIMIT 1
| 1,028 |
challenging
|
california_schools
|
What is the average number of test takers from Fresno schools that opened between 1/1/1980 and 12/31/1980?
|
between 1/1/1980 and 12/31/1980 means the year = 1980
|
SELECT AVG(T1.NumTstTakr) FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE strftime('%Y', T2.OpenDate) = '1980' AND T2.County = 'Fresno'
| 39 |
simple
|
financial
|
Which are the top ten withdrawals (non-credit card) by district names for the month of January 1996?
|
Non-credit card withdraws refers to type = 'VYDAJ'; January 1996 can be found by date LIKE '1996-01%' in the database; A2 means district names
|
SELECT T1.district_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.type = 'VYDAJ' AND T2.date LIKE '1996-01%' ORDER BY A2 ASC LIMIT 10
| 129 |
moderate
|
european_football_2
|
List out of players whose preferred foot is left.
|
preferred_foot = 'left';
|
SELECT DISTINCT t1.id, t1.player_name FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t2.preferred_foot = 'left'
| 1,064 |
simple
|
formula_1
|
Which racetrack hosted the most recent race? Indicate the full location.
|
full location refers to location+country; most recent race = MAX(date)
|
SELECT T1.location FROM circuits AS T1 INNER JOIN races AS T2 ON T1.circuitId = T2.circuitId ORDER BY T2.date DESC LIMIT 1
| 1,000 |
simple
|
thrombosis_prediction
|
What is the age gap between the youngest and oldest patient with a normal triglyceride recorded?
|
age gap refers to SUBTRACT(MAX(year(Birthday)) - MIN(year(Birthday))); normal triglyceride refers to tg > = 200
|
SELECT STRFTIME('%Y', MAX(T1.Birthday)) - STRFTIME('%Y', MIN(T1.Birthday)) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TG >= 200
| 1,165 |
moderate
|
formula_1
|
For the driver who had the Q2 time as 0:01:15 in race No. 347, where is he from?
|
race number refers to raceId;
|
SELECT DISTINCT T2.nationality FROM qualifying AS T1 INNER JOIN drivers AS T2 ON T2.driverId = T1.driverId WHERE T1.raceId = 347 AND T1.q2 LIKE '1:15%'
| 871 |
simple
|
thrombosis_prediction
|
For the patient who has the highest Ig A within the normal range, what is his or her diagnosis?
|
highest Ig A within the normal range refers to MAX(IGA BETWEEN 80 AND 500);
|
SELECT patientData.Diagnosis FROM Patient AS patientData INNER JOIN Laboratory AS labData ON patientData.ID = labData.ID WHERE labData.IGA BETWEEN 80 AND 500 ORDER BY labData.IGA DESC LIMIT 1
| 1,253 |
simple
|
toxicology
|
Among the molecules which contain "c" element, which of them are not carcinogenic?
|
label = '-' means molecules are non-carcinogenic
|
SELECT DISTINCT T1.molecule_id FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.element = 'c' AND T2.label = '-'
| 316 |
simple
|
european_football_2
|
What was the overall rating for Aaron Mooy on 2016/2/4?
|
Aaron Mooy refers to player_name = 'Aaron Mooy'; on 2016/2/4 refers to date = '2016-02-04 00:00:00'
|
SELECT t2.overall_rating FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE SUBSTR(t2.`date`, 1, 10) = '2016-02-04' AND t1.player_name = 'Aaron Mooy'
| 1,103 |
moderate
|
thrombosis_prediction
|
Of the patients with an abnormal level of anti-DNA-II, how many of them admitted to the hospital?
|
normal level of anti-DNA-II refers to DNA-II < 8; admitted to the hospital refers to Admission = '+';
|
SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`DNA-II` >= 8 AND T1.Admission = '+'
| 1,278 |
simple
|
superhero
|
What are the superpowers of heroes with ID 1?
|
superpowers refers to power_name; heroes with ID 1 refers to hero_id = 1;
|
SELECT DISTINCT T2.power_name FROM hero_power AS T1 INNER JOIN superpower AS T2 ON T1.power_id = T2.id WHERE T1.hero_id = 1
| 764 |
simple
|
formula_1
|
List circuits in USA which hosted f1 races in 2006. State the name and location of circuit and the name of the race it hosted.
|
SELECT T1.name, T1.location, T2.name FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T1.country = 'USA' AND T2.year = 2006
| 900 |
simple
|
|
toxicology
|
What is the percentage of carcinogenic molecules in triple type bonds?
|
label = '+' mean molecules are carcinogenic; triple bond refers to bond_type = '#'; percentage = DIVIDE(SUM(bond_type = '#'), COUNT(bond_id)) as percent where label = '+'
|
SELECT CAST(COUNT(DISTINCT CASE WHEN T2.label = '+' THEN T2.molecule_id ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT T2.molecule_id) FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id INNER JOIN bond AS T3 ON T2.molecule_id = T3.molecule_id WHERE T3.bond_type = '#'
| 219 |
challenging
|
financial
|
What is the number of committed crimes in 1995 in the district of the account with the id 532?
|
A15 contains information about number of committed crimes in 1995
|
SELECT T1.A15 FROM district AS T1 INNER JOIN `account` AS T2 ON T1.district_id = T2.district_id WHERE T2.account_id = 532
| 157 |
simple
|
thrombosis_prediction
|
What is the average age of patients examined in the laboratory for the October of the year 1991?
|
average age for first half of 1999 refers to AVG(SUBTRACT('1999', year(Birthday))); October of 1991 refers to Date BETWEEN '1991-10-01' AND '1991-10-30'
|
SELECT AVG('1999' - STRFTIME('%Y', T2.Birthday)) FROM Laboratory AS T1 INNER JOIN Patient AS T2 ON T1.ID = T2.ID WHERE T1.Date BETWEEN '1991-10-01' AND '1991-10-30'
| 1,174 |
moderate
|
financial
|
What is the disposition id of the client who made 5100 USD transaction in 1998/9/2?
|
SELECT T1.disp_id FROM disp AS T1 INNER JOIN trans AS T2 ON T1.account_id = T2.account_id WHERE T2.date = '1998-09-02' AND T2.amount = 5100
| 110 |
simple
|
|
toxicology
|
How many bonds which involved atom 12 does molecule TR009 have?
|
TR009 is the molecule id; molecule_id = 'TR009' means the bond_id LIKE 'TR009_%'; involved atom 12 refers to atom_id = 'TR009_12' or atom_id2 = 'TR009_12'
|
SELECT COUNT(T2.bond_id) FROM bond AS T1 INNER JOIN connected AS T2 ON T1.bond_id = T2.bond_id WHERE T1.molecule_id = 'TR009' AND T2.atom_id = T1.molecule_id || '_1' AND T2.atom_id2 = T1.molecule_id || '_2'
| 234 |
moderate
|
european_football_2
|
At present, calculate for the player's age who have a sprint speed of no less than 97 between 2013 to 2015.
|
players age at present = SUBTRACT((DATETIME(), birthday)); sprint_speed > = 97; between 2013 to 2015 refers to date > = '2013-01-01 00:00:00' AND date < = '2015-12-31 00:00:00';
|
SELECT DATETIME() - T2.birthday age FROM Player_Attributes AS t1 INNER JOIN Player AS t2 ON t1.player_api_id = t2.player_api_id WHERE SUBSTR(t1.`date`, 1, 10) BETWEEN '2013-01-01' AND '2015-12-31' AND t1.sprint_speed >= 97
| 1,031 |
challenging
|
toxicology
|
How many carcinogenic molecules that consisted of Nitrogen?
|
nitrogen refers to element = 'n'; label = '+' mean molecules are carcinogenic;
|
SELECT COUNT(DISTINCT T1.molecule_id) FROM molecule AS T1 INNER JOIN atom AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.element = 'n' AND T1.label = '+'
| 325 |
simple
|
student_club
|
Find the full name of members whose t-shirt size is extra large.
|
full name refers to first_name, last_name; t_shirt_size = 'X-Large'
|
SELECT first_name, last_name FROM member WHERE t_shirt_size = 'X-Large'
| 1,445 |
simple
|
codebase_community
|
Who is the owner of the post "Eliciting priors from experts"?
|
"Eliciting priors from experts" is the Title of post; owner refers to DisplayName
|
SELECT T2.DisplayName FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T1.Title = 'Eliciting priors from experts'
| 539 |
simple
|
card_games
|
Describe the information about rulings for card named 'Sublime Epiphany' with number 74s.
|
Sublime Epiphany' is name of cards; number 74s refers to number = '74s'; information refers to text;
|
SELECT T2.text FROM cards AS T1 INNER JOIN rulings AS T2 ON T1.uuid = T2.uuid WHERE T1.name = 'Sublime Epiphany' AND T1.number = '74s'
| 348 |
simple
|
european_football_2
|
When is the birthday of the football player who has the highest overall rating?
|
football player who has the highest overall rating refers to MAX(overall_rating);
|
SELECT t1.birthday FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id ORDER BY t2.overall_rating DESC LIMIT 1
| 1,055 |
simple
|
codebase_community
|
List all the name of users that obtained the Organizer Badges.
|
name of users refers to DisplayName; the Organizer Badges refer to badges where Name = 'Organizer';
|
SELECT T1.DisplayName FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE T2.`Name` = 'Organizer'
| 638 |
simple
|
student_club
|
What is the ratio between students majored in finance and physics?
|
DIVDE(SUM(major_name = 'Finance'), SUM(major_name = 'Physics'))
|
SELECT SUM(CASE WHEN major_name = 'Finance' THEN 1 ELSE 0 END) / SUM(CASE WHEN major_name = 'Physics' THEN 1 ELSE 0 END) AS ratio FROM major
| 1,391 |
simple
|
toxicology
|
What is the atom ID of double bonded carbon in TR012 molecule?
|
carbon refers to element = 'c'; double bond refers to bond_type = ' = ';
|
SELECT T1.atom_id FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id INNER JOIN bond AS T3 ON T2.molecule_id = T3.molecule_id WHERE T2.molecule_id = 'TR012' AND T3.bond_type = '=' AND T1.element = 'c'
| 338 |
moderate
|
formula_1
|
What is the rate of drivers completing all the laps in the 2008 Australian Grand Prix?
|
completing all the laps refers to time is not null; rate = divide(COUNT(raceID where time is not null), COUNT(raceID))
|
SELECT CAST(SUM(IIF(T1.time IS NOT NULL, 1, 0)) AS REAL) * 100 / COUNT(T1.resultId) FROM results AS T1 INNER JOIN races AS T2 ON T1.raceId = T2.raceId WHERE T2.name = 'Australian GrAND Prix' AND T2.year = 2008
| 943 |
moderate
|
european_football_2
|
Please list the names of the players whose volley score and dribbling score are over 70.
|
volley score refers to volleys; volleys > 70; dribbling score refers to dribbling; dribbling > 70;
|
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.volleys > 70 AND t2.dribbling > 70
| 1,088 |
moderate
|
european_football_2
|
Who are the players that tend to be attacking when their mates were doing attack moves? List down their name.
|
tend to be attacking when their mates were doing attack moves refers to attacking_work_rate = 'high';
|
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.attacking_work_rate = 'high'
| 1,124 |
moderate
|
european_football_2
|
What is the overall rating of the football player Gabriel Tamas in year 2011?
|
in year 2011 refers to strftime('%Y', date) = '2011';
|
SELECT t2.overall_rating FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.player_name = 'Gabriel Tamas' AND SUBSTR(t2.`date`, 1, 4) = '2011'
| 1,048 |
simple
|
student_club
|
How many members of the Student_Club have major in 'Physics Teaching'?
|
'Physics Teaching' is the major name;
|
SELECT COUNT(T2.member_id) FROM major AS T1 INNER JOIN member AS T2 ON T1.major_id = T2.link_to_major WHERE T1.major_name = 'Physics Teaching'
| 1,394 |
simple
|
card_games
|
Which of the cards that are a promotional painting have multiple faces on the same card? Please list their names.
|
are a promotional painting refers to isPromo = 1; have multiple faces on the same card refers to side is not Null
|
SELECT DISTINCT name FROM cards WHERE isPromo = 1 AND side IS NOT NULL
| 455 |
simple
|
toxicology
|
Which molecule consisted of Sulphur atom with double bond?
|
sulphur refers to element - 's'; double bond refers to bond_type = ' = ';
|
SELECT DISTINCT T1.molecule_id FROM atom AS T1 INNER JOIN bond AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.element = 's' AND T2.bond_type = '='
| 326 |
simple
|
card_games
|
How many cards are having future frame version and what are the legality status of these cards?
|
future frame version refers to frameVersion = 'future'; legility status refers to status = 'legal';
|
SELECT COUNT(T1.id) FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T1.frameVersion = 'future'
| 386 |
simple
|
formula_1
|
How many races were there in 2005? Name all the races in descending order.
|
SELECT name FROM races WHERE year = 2005 ORDER BY name DESC
| 883 |
simple
|
|
toxicology
|
How many atoms belong to molecule id TR005?
|
SELECT COUNT(T.atom_id) FROM atom AS T WHERE T.molecule_id = 'TR005'
| 313 |
simple
|
|
formula_1
|
Which constructor scored most points from Monaco Grand Prix between 1980 and 2010? List the score, name and nationality of this team.
|
Monaco Grand Priz refers to the race; race in year between 1980 and 2010
|
SELECT SUM(T1.points), T2.name, T2.nationality FROM constructorResults AS T1 INNER JOIN constructors AS T2 ON T1.constructorId = T2.constructorId INNER JOIN races AS T3 ON T3.raceid = T1.raceid WHERE T3.name = 'Monaco Grand Prix' AND T3.year BETWEEN 1980 AND 2010 GROUP BY T2.name ORDER BY SUM(T1.points) DESC LIMIT 1
| 994 |
challenging
|
student_club
|
What category was budgeted for the 'January Speaker' event and how much was the amount budgeted for that category?
|
amount budgeted refers to amount, 'January Speaker' is the event name;
|
SELECT T2.category, T2.amount FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.event_name = 'January Speaker'
| 1,462 |
simple
|
codebase_community
|
For the user whose display name is "DatEpicCoderGuyWhoPrograms", what is his/her badge's name?
|
"DatEpicCoderGuyWhoPrograms" is the DisplayName;
|
SELECT T2.Name FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE T1.DisplayName = 'DatEpicCoderGuyWhoPrograms'
| 570 |
simple
|
toxicology
|
Name chemical elements that form a bond TR001_10_11.
|
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; TR001_10_11 is the bond id; molecule id refers to SUBSTR(bond_id, 1, 5); atom 1 refers to SUBSTR(bond_id, 7, 2); atom 2 refers to SUBSTR(bond_id, 10, 2)
|
SELECT T1.element FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id INNER JOIN bond AS T3 ON T2.bond_id = T3.bond_id WHERE T3.bond_id = 'TR001_10_11'
| 285 |
challenging
|
superhero
|
Which hero was the fastest?
|
which hero refers to superhero_name; fastest refers to MAX(attribute_value) WHERE attribute_name = 'Speed';
|
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 = 'Speed' ORDER BY T2.attribute_value DESC LIMIT 1
| 794 |
moderate
|
toxicology
|
Name all bonds with single bond types and what atoms are connected to the molecules.
|
single bond refers to bond_type = '-';
|
SELECT T1.bond_id, 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 = '-'
| 305 |
simple
|
card_games
|
What is the description about the ruling of card "Condemn"?
|
Ancestor's Chosen' is the name of card; description about the ruling refers to text;
|
SELECT T2.text FROM cards AS T1 INNER JOIN rulings AS T2 ON T1.uuid = T2.uuid WHERE T1.name = 'Condemn'
| 362 |
simple
|
financial
|
List the account IDs with monthly issuance of statements.
|
'POPLATEK MESICNE' stands for monthly issuance
|
SELECT account_id FROM account WHERE Frequency = 'POPLATEK MESICNE'
| 127 |
simple
|
superhero
|
List down at least five full name of Demi-God superheroes.
|
Demi-God superheroes refers to race = 'Demi-God'
|
SELECT T1.full_name FROM superhero AS T1 INNER JOIN race AS T2 ON T1.race_id = T2.id WHERE T2.race = 'Demi-God'
| 755 |
simple
|
codebase_community
|
How many posts have a score less than 20?
|
score less than 20 refers to Score < 20;
|
SELECT COUNT(id) FROM posts WHERE Score < 20
| 702 |
simple
|
european_football_2
|
In what country did the Poland Ekstraklasa take place?
|
SELECT name FROM Country WHERE id IN ( SELECT country_id FROM League WHERE name = 'Poland Ekstraklasa' )
| 1,138 |
simple
|
|
european_football_2
|
Which league had the most goals in the 2016 season?
|
league that had the most goals refers to MAX(SUM(home_team_goal, away_team_goal)); 2016 season refers to season = '2015/2016';
|
SELECT t2.name FROM Match AS t1 INNER JOIN League AS t2 ON t1.league_id = t2.id WHERE t1.season = '2015/2016' GROUP BY t2.name ORDER BY SUM(t1.home_team_goal + t1.away_team_goal) DESC LIMIT 1
| 1,025 |
moderate
|
codebase_community
|
Which user added a bounty amount of 50 to the post title mentioning variance?
|
"bounty amount of 50 refers to BountyAmount = 50; user refers to DisplayName
|
SELECT T3.DisplayName, T1.Title FROM posts AS T1 INNER JOIN votes AS T2 ON T1.Id = T2.PostId INNER JOIN users AS T3 ON T3.Id = T2.UserId WHERE T2.BountyAmount = 50 AND T1.Title LIKE '%variance%'
| 586 |
challenging
|
toxicology
|
Calculate the total carcinogenic molecules for molecule id from TR000 to TR030.
|
label = '+' mean molecules are carcinogenic
|
SELECT COUNT(T.molecule_id) FROM molecule AS T WHERE T.molecule_id BETWEEN 'TR000' AND 'TR030' AND T.label = '+'
| 266 |
simple
|
european_football_2
|
Among the players whose preferred foot was the left foot when attacking, how many of them would remain in his position when the team attacked?
|
preferred foot when attacking refers to preferred foot; preferred_foot = 'left'; players who would remain in his position when the team attacked refers to attacking_work_rate = 'low';
|
SELECT COUNT(player_api_id) FROM Player_Attributes WHERE preferred_foot = 'left' AND attacking_work_rate = 'low'
| 1,080 |
moderate
|
codebase_community
|
How many users whose reputations are higher than 2000 and the number of views is higher than 1000?
|
reputations are higher than 2000 refer to Reputation > 2000; number of views is higher than 1000 refers to Views > 1000;
|
SELECT COUNT(id) FROM users WHERE Reputation > 2000 AND Views > 1000
| 675 |
simple
|
thrombosis_prediction
|
How many patients have a normal anti-SSB and are diagnosed with SLE in the examination?
|
normal anti-SSB refers to SSB IN('-', '+-'); '-' is expressed as 'negative' and '+-' is expressed as '0' in the database ; diagnosed with SLE refers to Diagnosis = 'SLE'; Should compute the number of distinct ones
|
SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.SSB = 'negative' OR '0' AND T1.Diagnosis = 'SLE'
| 1,273 |
moderate
|
formula_1
|
For the race happened on 2015/11/29, how many drivers finished the game?
|
game and race are synonyms; drivers who finished the race should have record in time;
|
SELECT COUNT(T2.driverId) FROM races AS T1 INNER JOIN results AS T2 ON T2.raceId = T1.raceId WHERE T1.date = '2015-11-29' AND T2.time IS NOT NULL
| 864 |
simple
|
formula_1
|
In which Formula_1 race did Lewis Hamilton rank the highest?
|
rank the highest refers to min(rank)
|
SELECT name FROM races WHERE raceId IN ( SELECT raceId FROM results WHERE rank = 1 AND driverId = ( SELECT driverId FROM drivers WHERE forename = 'Lewis' AND surname = 'Hamilton' ) )
| 930 |
simple
|
superhero
|
Give the race of the blue-haired male superhero.
|
blue-haired refers to colour.colour = 'blue' WHERE hair_colour_id = colour.id; male refers to gender = 'male';
|
SELECT T3.race FROM superhero AS T1 INNER JOIN colour AS T2 ON T1.hair_colour_id = T2.id INNER JOIN race AS T3 ON T1.race_id = T3.id INNER JOIN gender AS T4 ON T1.gender_id = T4.id WHERE T2.colour = 'Blue' AND T4.gender = 'Male'
| 817 |
moderate
|
european_football_2
|
What was the chance creation crossing class for "Hull City" on 2010/2/22?
|
"Hull City" refers to team_long_name = 'Hull City'; on 2010/2/22 refers to date = '2010-02-22 00:00:00'
|
SELECT t2.chanceCreationCrossingClass FROM Team AS t1 INNER JOIN Team_Attributes AS t2 ON t1.team_api_id = t2.team_api_id WHERE t1.team_long_name = 'Hull City' AND SUBSTR(t2.`date`, 1, 10) = '2010-02-22'
| 1,112 |
moderate
|
debit_card_specializing
|
Among the customers who paid in euro, how many of them have a monthly consumption of over 1000?
|
SELECT COUNT(*) FROM yearmonth AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.Currency = 'EUR' AND T1.Consumption > 1000.00
| 1,505 |
simple
|
|
european_football_2
|
Please list the leagues from Germany.
|
Germany refers to Country.name = 'Germany';
|
SELECT t2.name FROM Country AS t1 INNER JOIN League AS t2 ON t1.id = t2.country_id WHERE t1.name = 'Germany'
| 1,082 |
simple
|
toxicology
|
On average how many carcinogenic molecules are single bonded?
|
carcinogenic molecules refers to label = '+'; single-bonded refers to bond_type = '-'; average = DIVIDE(SUM(bond_type = '-'), COUNT(atom_id))
|
SELECT AVG(single_bond_count) FROM (SELECT T3.molecule_id, COUNT(T1.bond_type) AS single_bond_count FROM bond AS T1 INNER JOIN atom AS T2 ON T1.molecule_id = T2.molecule_id INNER JOIN molecule AS T3 ON T3.molecule_id = T2.molecule_id WHERE T1.bond_type = '-' AND T3.label = '+' GROUP BY T3.molecule_id) AS subquery
| 198 |
challenging
|
card_games
|
What is the type of the card "Ancestor's Chosen" as originally printed?
|
Ancestor's Chosen' is the name of card; type of the card as originally printed refers to originaltype;
|
SELECT originalType FROM cards WHERE name = 'Ancestor''s Chosen' AND originalType IS NOT NULL
| 359 |
simple
|
formula_1
|
Who was the champion of 2008's Australian Grand Prix and where can I know more about him?
|
only champion's finished time is represented by 'HH:MM:SS.mmm'; where can I know more refers to url
|
SELECT T1.forename, T1.surname, T1.url FROM drivers AS T1 INNER JOIN results AS T2 ON T1.driverId = T2.driverId INNER JOIN races AS T3 ON T3.raceId = T2.raceId WHERE T3.name = 'Australian Grand Prix' AND T2.time LIKE '_:%:__.___' AND T3.year = 2008
| 938 |
moderate
|
thrombosis_prediction
|
Was the total cholesterol status for the patient id 2927464 on 1995-9-4 at the normal level?
|
total cholesterol normal level refers to N < 250
|
SELECT CASE WHEN `T-CHO` < 250 THEN 'Normal' ELSE 'Abnormal' END FROM Laboratory WHERE ID = 2927464 AND Date = '1995-09-04'
| 1,177 |
simple
|
formula_1
|
Who was the driver that got the best lap time in the race No. 348? Give his full name.
|
race number refers to raceId; the best lap time refers to MIN(time)
|
SELECT T2.forename, T2.surname FROM lapTimes AS T1 INNER JOIN drivers AS T2 ON T2.driverId = T1.driverId WHERE T1.raceId = 348 ORDER BY T1.time ASC LIMIT 1
| 878 |
simple
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.