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 that has azorius watermark? List out the type of this card.
SELECT DISTINCT T2.language, T1.type FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T2.uuid = T1.uuid WHERE T1.watermark = 'azorius'
449
simple
superhero
Which superheroes have blue eyes with brown hair?
which superheroes refers to superhero_name; blue eyes refers to eye_colour_id = 7; brown hair refers to hair_colour_id = 9;
SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN colour AS T2 ON T1.eye_colour_id = T2.id INNER JOIN colour AS T3 ON T1.hair_colour_id = T3.id WHERE T2.colour = 'Blue' AND T3.colour = 'Brown'
797
moderate
financial
Please list the name of the districts with accounts that made withdrawal transactions.
A2 refers to district name; type = 'VYDAJ' stands for withdrawal transactions
SELECT DISTINCT T1.A2 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'
151
moderate
superhero
What is the name of the superhero that has the most powers?
name of the superhero refers to superhero_name; superhero that has the most powers refers to MAX(COUNT(superhero_name))
SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN hero_power AS T2 ON T1.id = T2.hero_id GROUP BY T1.superhero_name ORDER BY COUNT(T2.hero_id) DESC LIMIT 1
741
simple
card_games
How many cards that illusrtated in German have been reprinted?
German' is the language; reprinted refers to isReprint = 1;
SELECT COUNT(T1.id) FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T1.uuid = T2.uuid WHERE T2.language = 'German' AND T1.isReprint = 1
369
simple
student_club
What is the most expensive item that was spent in support of club events?
item in support of club events refers to expense_description; most expensive refers to MAX(cost)
SELECT expense_description FROM expense ORDER BY cost DESC LIMIT 1
1,325
simple
california_schools
What is the administrator's email address for the school with the highest number of test takers who received SAT scores of at least 1500?Provide the name of the school.
SELECT T2.AdmEmail1, T2.School FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode ORDER BY T1.NumGE1500 DESC LIMIT 1
88
simple
european_football_2
What is the height of the tallest player? Indicate his name.
tallest player refers to MAX(height);
SELECT player_name FROM Player ORDER BY height DESC LIMIT 1
1,021
simple
formula_1
Please list the exact dates on which a Formula_1 race took place on the Barcelona-Catalunya circuit.
SELECT T2.date FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T1.name = 'Circuit de Barcelona-Catalunya'
924
simple
student_club
Give the event ID, location, and status of events conducted from November 2019 to March 2020.
event_date BETWEEN '2019-11-01' and '2020-03-31'
SELECT event_id, location, status FROM event WHERE date(SUBSTR(event_date, 1, 10)) BETWEEN '2019-11-01' AND '2020-03-31'
1,443
simple
codebase_community
Provide the related post title of "How to tell if something happened in a data set which monitors a value over time".
SELECT T3.Title FROM postLinks AS T1 INNER JOIN posts AS T2 ON T1.PostId = T2.Id INNER JOIN posts AS T3 ON T1.RelatedPostId = T3.Id WHERE T2.Title = 'How to tell if something happened in a data set which monitors a value over time'
651
simple
financial
There was a loan approved in 1994/8/25, where was that account opened, give the district Id of the branch.
SELECT T1.district_id FROM account AS T1 INNER JOIN loan AS T2 ON T1.account_id = T2.account_id WHERE T2.date = '1994-08-25'
105
simple
codebase_community
Calculate the difference in view count from post posted by mornington and view count from posts posted by Amos.
SUBTRACT(SUM(ViewCount where DisplayName = 'Mornington'), SUM(ViewCount where DisplayName = 'Amos'));
SELECT SUM(IIF(T1.DisplayName = 'Mornington', T3.ViewCount, 0)) - SUM(IIF(T1.DisplayName = 'Amos', T3.ViewCount, 0)) AS diff FROM users AS T1 INNER JOIN postHistory AS T2 ON T1.Id = T2.UserId INNER JOIN posts AS T3 ON T3.Id = T2.PostId
640
moderate
formula_1
Which constructors have been ranked 1?
SELECT DISTINCT T2.name FROM results AS T1 INNER JOIN constructors AS T2 on T1.constructorId = T2.constructorId WHERE T1.rank = 1
952
simple
card_games
Please provide the ids of top three powerful pairs of Kingdom Foil and Kingdom Cards sorted by Kingdom Foil id in alphabetical order.
poweful refers to cardKingdomFoilId is not null AND cardKingdomId is not null
SELECT cardKingdomFoilId, cardKingdomId FROM cards WHERE cardKingdomFoilId IS NOT NULL AND cardKingdomId IS NOT NULL ORDER BY cardKingdomFoilId LIMIT 3
423
simple
formula_1
What is the average time in seconds of champion for each year?
only champion's finished time is represented by 'HH:MM:SS.mmm'; finished the game refers to time is not null.
WITH time_in_seconds AS ( SELECT T2.year, T2.raceId, T1.positionOrder, CASE WHEN T1.positionOrder = 1 THEN (CAST(SUBSTR(T1.time, 1, 1) AS REAL) * 3600) + (CAST(SUBSTR(T1.time, 3, 2) AS REAL) * 60) + CAST(SUBSTR(T1.time, 6) AS REAL) ELSE CAST(SUBSTR(T1.time, 2) AS REAL) END AS time_seconds FROM results AS T1 INNER JOIN races AS T2 ON T1.raceId = T2.raceId WHERE T1.time IS NOT NULL ), champion_time AS ( SELECT year, raceId, time_seconds FROM time_in_seconds WHERE positionOrder = 1 ) SELECT year, AVG(time_seconds) FROM champion_time GROUP BY year HAVING AVG(time_seconds) IS NOT NULL
955
challenging
card_games
List down all the card IDs with converted mana cost of 0.
converted mana cost of 0 refers to covertedManaCost = 0;
SELECT id FROM cards WHERE convertedManaCost = 0
375
simple
student_club
Among the students from the Student_Club who attended the event "Women's Soccer", how many of them want a T-shirt that's in medium size?
Women's Soccer is an event name; T-shirt that is in medium size refers to t_shirt_size = 'Medium'
SELECT COUNT(T1.event_id) FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event INNER JOIN member AS T3 ON T2.link_to_member = T3.member_id WHERE T1.event_name = 'Women''s Soccer' AND T3.t_shirt_size = 'Medium'
1,317
moderate
financial
For the branch which located in the south Bohemia with biggest number of inhabitants, what is the percentage of the male clients?
Percentage of the male clients = DIVIDE(COUNT(male clients), COUNT(clients)) * 100%; Male refers to gender = 'M', A3 is the region name. A4 contains the information about inhabitants.
SELECT CAST(SUM(T1.gender = 'M') AS REAL) * 100 / COUNT(T1.client_id) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.A3 = 'south Bohemia' GROUP BY T2.A4 ORDER BY T2.A4 DESC LIMIT 1
115
challenging
debit_card_specializing
Please list the product description of the products bought in transactions in euro.
SELECT DISTINCT T1.ProductID, T3.Description FROM transactions_1k AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN products AS T3 ON T1.ProductID = T3.ProductID WHERE T2.Currency = 'EUR'
1,503
simple
student_club
What's Angela Sanders's major?
major 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.first_name = 'Angela' AND T1.last_name = 'Sanders'
1,312
simple
formula_1
Which year was the first Singapore Grand Prix?
the first race refers to race happened in min(year);
SELECT year FROM races WHERE name = 'Singapore Grand Prix' ORDER BY year ASC LIMIT 1
882
simple
debit_card_specializing
What is the average total price of the transactions taken place in gas stations in the Czech Republic?
Gas station in the Czech Republic implies that Country = 'CZE'
SELECT AVG(T1.Price) FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T2.Country = 'CZE'
1,510
simple
superhero
In superheroes with height between 150 to 180, what is the percentage of heroes published by Marvel Comics?
height between 150 to 180 refers to height_cm BETWEEN 150 AND 180; heroes published by Marvel Comics refers to publisher_id = 13; calculation = MULTIPLY(DIVIDE(SUM(publisher.id = 13)), COUNT(publisher.id), 100)
SELECT CAST(COUNT(CASE WHEN T2.publisher_name = 'Marvel Comics' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.id) FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T1.height_cm BETWEEN 150 AND 180
760
challenging
toxicology
What are the bonds that have phosphorus and nitrogen as their atom elements?
have phosphorus as atom elements refers to element = 'p'; have nitrogen as atom elements refers to element = 'n'
SELECT T2.bond_id FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id WHERE T2.bond_id IN ( SELECT T3.bond_id FROM connected AS T3 INNER JOIN atom AS T4 ON T3.atom_id = T4.atom_id WHERE T4.element = 'p' ) AND T1.element = 'n'
243
moderate
formula_1
For the drivers who took part in the race in 1983/7/16, what's their race completion rate?
DIVIDE(COUNT(driverid where time has value and date = '1983-07-16'), (COUNT(driverid where date = '1983-07-16')) as percentage
SELECT CAST(COUNT(CASE WHEN T2.time IS NOT NULL THEN T2.driverId END) AS REAL) * 100 / COUNT(T2.driverId) FROM races AS T1 INNER JOIN results AS T2 ON T2.raceId = T1.raceId WHERE T1.date = '1983-07-16'
881
moderate
codebase_community
Identify the number of posts and comments left by the user, who has the latest created user account.
the latest created user account refers to MAX(CreationDate);
SELECT COUNT(T2.Id) FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId INNER JOIN comments AS T3 ON T3.PostId = T2.Id ORDER BY T1.CreationDate DESC LIMIT 1
693
simple
toxicology
What is the total number of molecules with double bonded oxygen?
oxygen refers to element = 'o'; double bond refers to bond_type = ' = ';
SELECT COUNT(DISTINCT T1.molecule_id) FROM atom AS T1 INNER JOIN bond AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.bond_type = '=' AND T1.element = 'o'
335
simple
debit_card_specializing
Which client segment consumed the least in September 2013?
September 2013 refers to yearmonth.date = '201309'
SELECT T1.Segment FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.Date = '201309' GROUP BY T1.CustomerID ORDER BY SUM(T2.Consumption) ASC LIMIT 1
1,496
simple
financial
Among the accounts who have loan validity more than 12 months, list out the accounts that have the highest approved amount and have account opening date in 1993.
Loan validity more than 12 months refers to duration > 12
SELECT T1.account_id FROM loan AS T1 INNER JOIN disp AS T2 ON T1.account_id = T2.account_id WHERE STRFTIME('%Y', T1.date) = '1993' AND T1.duration = 12 ORDER BY T1.amount DESC LIMIT 1
99
moderate
card_games
List down the name of cards with original types of Creature - Elf and the date of rulings for these cards.
Creature - Elf is the originalType;
SELECT T1.id, T2.date FROM cards AS T1 INNER JOIN rulings AS T2 ON T1.uuid = T2.uuid WHERE T1.originalType = 'Creature - Elf'
389
simple
formula_1
In the race No. 45, for the driver who had the Q3 time as 0:01:33, what is his abbreviated code?
race number refers to raceId;
SELECT T2.code FROM qualifying AS T1 INNER JOIN drivers AS T2 ON T2.driverId = T1.driverId WHERE T1.raceId = 45 AND T1.q3 LIKE '1:33%'
872
simple
thrombosis_prediction
How many patients born after 1980/1/1 have an abnormal fibrinogen level?
born after 1980/1/1 refers to Birthday > '1980-01-01'; normal fibrinogen level refers to FG between 150 and 450; Should return the number of distinct patients.
SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.FG <= 150 OR T2.FG >= 450 AND T1.Birthday > '1980-01-01'
1,248
moderate
toxicology
What is the most common bond type?
most common bond type refers MAX(COUNT(bond_type))
SELECT T.bond_type FROM ( SELECT bond_type, COUNT(bond_id) FROM bond GROUP BY bond_type ORDER BY COUNT(bond_id) DESC LIMIT 1 ) AS T
195
simple
toxicology
How many of the molecules are carcinogenic?
label = '+' mean molecules are carcinogenic;
SELECT COUNT(T.molecule_id) FROM molecule AS T WHERE T.label = '+'
331
simple
thrombosis_prediction
For all patients who are older than 55 years old, what is the percentage of female who has abnormal prothrombin time (PT)?
older than 55 years old = SUBTRACT(year(current_timestamp), year(Birthday)) > 55; percentage = MULTIPLY(DIVIDE(SUM(PT > = 14 AND SEX = 'F'), SUM(PT > = 14)), 1.0); female refers to Sex = 'F'; abnormal prothrombin time (PT) refers to PT > = 14;
SELECT CAST(SUM(CASE WHEN T2.PT >= 14 AND T1.SEX = 'F' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) > 55
1,243
challenging
formula_1
How many French drivers who obtain the laptime less than 02:00.00?
lap time less than 01:00.00 refers to seconds < 120;
SELECT COUNT(T1.driverId) FROM drivers AS T1 INNER JOIN lapTimes AS T2 on T1.driverId = T2.driverId WHERE T1.nationality = 'French' AND (CAST(SUBSTR(T2.time, 1, 2) AS INTEGER) * 60 + CAST(SUBSTR(T2.time, 4, 2) AS INTEGER) + CAST(SUBSTR(T2.time, 7, 2) AS REAL) / 1000) < 120
963
moderate
toxicology
Please list top three molecules that have single bonds between two atoms and are not carcinogenic in alphabetical order.
label = '-' means molecules are not carcinogenic; single type bond refers to bond_type = '-'
SELECT DISTINCT T2.molecule_id FROM bond AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.bond_type = '-' AND T2.label = '-' ORDER BY T2.molecule_id LIMIT 3
232
moderate
thrombosis_prediction
List all patients with their sex and date of birthday, whose AST glutamic oxaloacetic transaminase (GOT) index is within normal range for loboratory examination in 1994.
AST glutamic oxaloacetic transaminase (GOT) index is within normal range refers to GOT < 60; examination in 1994 refers to year(Date) = 1994
SELECT DISTINCT T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GOT < 60 AND STRFTIME('%Y', T2.Date) = '1994'
1,207
moderate
toxicology
What is the carcinogenic label for bond TR001_2_4?
label = '+' mean molecules are carcinogenic
SELECT DISTINCT T2.label 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_id = 'TR001_2_4'
312
simple
formula_1
What is the average of fastest lap speed in the 2009 Spanish Grand Prix race?
Spanish Grand Prix is the name of race refers to name = 'Spanish Grand Prix'; average fastest lap speed refers to avg(fastestLapSpeed);
SELECT AVG(T1.fastestLapSpeed) FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T2.year = 2009 AND T2.name = 'Spanish Grand Prix'
960
moderate
student_club
List all the expenses incurred by the vice president.
expense refers to expense_description; 'Vice President' is a position of the Student Club
SELECT T2.expense_id, T2.expense_description FROM member AS T1 INNER JOIN expense AS T2 ON T1.member_id = T2.link_to_member WHERE T1.position = 'Vice President'
1,370
simple
card_games
How many sets are available just in Japanese and not in Magic: The Gathering Online?
Japanese refers to language = 'Japanese'; not in Magic: The Gathering Online refers to mtgoCode is null or mtgoCode = ''
SELECT COUNT(T1.id) FROM sets AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.code WHERE T2.language = 'Japanese' AND (T1.mtgoCode IS NULL OR T1.mtgoCode = '')
434
moderate
california_schools
What is the most common type of grade span served in the city of Adelanto?
SELECT GSserved FROM schools WHERE City = 'Adelanto' GROUP BY GSserved ORDER BY COUNT(GSserved) DESC LIMIT 1
78
simple
financial
How many loan accounts are for pre-payment of duration of 24 months with weekly issuance of statement.
Frequency = 'POPLATEK TYDNE' referes to weekly statement
SELECT COUNT(T2.account_id) FROM account AS T1 INNER JOIN loan AS T2 ON T1.account_id = T2.account_id WHERE T2.duration = 24 AND T1.frequency = 'POPLATEK TYDNE'
191
simple
superhero
Which superhero has the most durability published by Dark Horse Comics?
which superhero refers to superhero_name; most durability refers to MAX(attribute_value) WHERE attribute_name = 'durability'; published by Dark Horse Comics refers to publisher_name = 'Dark Horse Comics';
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 T3.id = T2.attribute_id INNER JOIN publisher AS T4 ON T4.id = T1.publisher_id WHERE T4.publisher_name = 'Dark Horse Comics' AND T3.attribute_name = 'Durability' ORDER BY T2.attribute_value DESC LIMIT 1
769
challenging
superhero
List the attribute value of the superhero named Aquababy.
SELECT T2.attribute_value FROM superhero AS T1 INNER JOIN hero_attribute AS T2 ON T1.id = T2.hero_id WHERE T1.superhero_name = 'Aquababy'
840
simple
toxicology
What elements are in a double type bond?
double type bond refers to bond_type = ' = '; 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 bond AS T2 ON T1.molecule_id = T2.molecule_id INNER JOIN connected AS T3 ON T1.atom_id = T3.atom_id WHERE T2.bond_type = '='
207
challenging
thrombosis_prediction
What is the percentage of patient who has a abnormal level of glutamic oxaloacetic transaminase level, yet he or she is diagnosed with SLE?
abnormal level of glutamic oxaloacetic transaminase refers to GOT > = 60; percentage = MULTIPLY(DIVIDE(COUNT(ID WHERE GOT > = 60 AND Diagnosis = 'SLE'), COUNT(ID WHERE GOT > = 60)), 1.0);
SELECT COUNT(CASE WHEN T1.Diagnosis LIKE '%SLE%' THEN T1.ID ELSE 0 END) / COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`GOT` >= 60
1,279
moderate
formula_1
For the driver who set the fastest lap speed in race No.933, where does he come from?
fastest lap speed refers to MAX(fastestLapSpeed);
SELECT T1.nationality FROM drivers AS T1 INNER JOIN results AS T2 ON T2.driverId = T1.driverId WHERE T2.raceId = 933 AND T2.fastestLapTime IS NOT NULL ORDER BY T2.fastestLapSpeed DESC LIMIT 1
867
simple
superhero
Please list the superhero names of all the superheroes that have blue eyes and blond hair.
blue eyes refers to colour = 'Blue' and eye_colour_id = colour.id; blond hair refers to colour = 'Blond' and hair_colour_id = colour.id; super power of "Agility" refers to power_name = 'Agility'
SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN colour AS T2 ON T1.eye_colour_id = T2.id INNER JOIN colour AS T3 ON T1.hair_colour_id = T3.id WHERE T2.colour = 'Blue' AND T3.colour = 'Blond'
724
challenging
debit_card_specializing
How many gas stations in CZE has Premium gas?
SELECT COUNT(GasStationID) FROM gasstations WHERE Country = 'CZE' AND Segment = 'Premium'
1,470
simple
codebase_community
For the owner user of post No. 65041, what is his/her reputation points?
post no. 65041 refers to Id = '65041'; reputation point refers to Reputation
SELECT T1.Reputation FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId WHERE T2.Id = 65041
566
simple
student_club
Please list the full names of the students in the Student_Club that come from the Art and Design Department.
full name refers to first_name, last_name;
SELECT T1.first_name, T1.last_name FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T2.department = 'Art and Design Department'
1,314
simple
card_games
Lists by ID all Creature-type cards with legal status.
legal status refer to status = 'legal'; Goblin-type cards refer to types = 'Creature';
SELECT T1.id FROM cards AS T1 INNER JOIN rulings AS T2 ON T1.uuid = T2.uuid INNER JOIN legalities AS T3 ON T1.uuid = T3.uuid WHERE T3.status = 'Legal' AND T1.types = 'Creature'
406
simple
california_schools
Please list the codes of the schools with a total enrollment of over 500.
Total enrollment can be represented by `Enrollment (K-12)` + `Enrollment (Ages 5-17)`
SELECT T2.CDSCode FROM schools AS T1 INNER JOIN frpm AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.`Enrollment (K-12)` + T2.`Enrollment (Ages 5-17)` > 500
11
simple
european_football_2
What is the difference between players 6 and 23's jumping scores?
difference between players 6 and 23's jumping scores refers to SUBTRACT(jumping AND id = 6,jumping AND id = 23)
SELECT SUM(CASE WHEN t1.id = 6 THEN t1.jumping ELSE 0 END) - SUM(CASE WHEN t1.id = 23 THEN t1.jumping ELSE 0 END) FROM Player_Attributes AS t1
1,134
simple
codebase_community
User No.23853 gave a comment to a post at 9:08:18 on 2013/7/12, was that post well-finished?
user no. 23853 refers to UserId = '23853'; at 9:08:18 on 2013/7/12 refers to CreationDate = '2013-07-12 09:08:18.0'; not well-finished refers to ClosedDate IS NULL and vice versa
SELECT IIF(T2.ClosedDate IS NULL, 'NOT well-finished', 'well-finished') AS resylt FROM comments AS T1 INNER JOIN posts AS T2 ON T1.PostId = T2.Id WHERE T1.UserId = 23853 AND T1.CreationDate = '2013-07-12 09:08:18.0'
565
moderate
thrombosis_prediction
Please list the patient's ID whose creatinine level is normal and whose anti Cardiolipin antibody concentration level is the highest.
creatinine level is normal refers to CRE < 1.5; anti Cardiolipin antibody concentration level is the highest refers to MAX(aCL IgA);
SELECT T2.ID FROM Laboratory AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.CRE < 1.5 ORDER BY T2.`aCL IgA` DESC LIMIT 1
1,294
moderate
card_games
Name the foreign name of the card that has abzan watermark? List out the type of this card.
SELECT DISTINCT T1.name, T1.type FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T2.uuid = T1.uuid WHERE T1.watermark = 'abzan'
448
simple
thrombosis_prediction
Name the ID of the patient who is born on the April 1st, 1982. Is his/her alkaliphophatase (ALP) within normal range?
alkaliphophatase (ALP) within normal range refers to ALP < 300
SELECT T1.ID , CASE WHEN T2.ALP < 300 THEN 'normal' ELSE 'abNormal' END FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Birthday = '1982-04-01'
1,213
moderate
thrombosis_prediction
For the patients with an abnormal anti-SM, please list the IDs of the three youngest ones.
abnormal anti-SM refers to SM NOT IN('-', '+-'); youngest refers to MAX(Birthday);
SELECT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.SM NOT IN ('negative','0') ORDER BY T1.Birthday DESC LIMIT 3
1,268
simple
toxicology
Tally the toxicology element of the 4th atom of each molecule that was carcinogenic.
label = '+' means molecules are carcinogenic; 4th atom of each molecule refers to substr(atom_id, 7, 1) = 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 molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '+' AND SUBSTR(T1.atom_id, -1) = '4' AND LENGTH(T1.atom_id) = 7
281
challenging
codebase_community
List the comments commented by the user with a username of Harvey Motulsky.
comments refer to Text; username of Harvey Motulsky refers to DisplayName = 'Harvey Motulsky';
SELECT T1.Text FROM comments AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T2.DisplayName = 'Harvey Motulsky'
714
simple
european_football_2
Which players had an overall rating of over 80 from 2008 to 2010? Please list player names.
overall_rating > 80; from 2008 to 2010 refers to strftime('%Y', date) BETWEEN '2008' AND '2010';
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.overall_rating > 80 AND SUBSTR(t2.`date`, 1, 4) BETWEEN '2008' AND '2010'
1,062
moderate
superhero
What is the total number of superheroes that have John as their first name?
have John as their first name refers to full_name LIKE 'John%';
SELECT COUNT(id) FROM superhero WHERE full_name LIKE 'John%'
836
simple
card_games
List the keyrune code for the set whose code is 'PKHC'.
keyrune code refers to keyruneCode
SELECT keyruneCode FROM sets WHERE code = 'PKHC'
489
simple
formula_1
What is the actual finish time for Bruce McLaren in the race No.743?
race number refers to raceId;
SELECT T2.time FROM drivers AS T1 INNER JOIN results AS T2 ON T2.driverId = T1.driverId WHERE T2.raceId = 743 AND T1.forename = 'Bruce' AND T1.surname = 'McLaren'
873
simple
codebase_community
What is the id of the youngest user?
the youngest user refers to MIN(Age);
SELECT Id FROM users WHERE Age = ( SELECT MIN(Age) FROM users )
663
simple
card_games
What are the card layout of cards with keyword of flying?
SELECT layout FROM cards WHERE keywords = 'Flying'
376
simple
student_club
What is the total cost of the pizzas for all the events?
total cost of the pizzas refers to SUM(cost) where expense_description = 'Pizza'
SELECT SUM(cost) FROM expense WHERE expense_description = 'Pizza'
1,361
simple
european_football_2
What is the name of players with the highest potential?
highest potential refers to MAX(potential)
SELECT DISTINCT t1.player_name FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id ORDER BY t2.potential DESC LIMIT 1
1,123
simple
codebase_community
State the number of views of users who obtained the badge on 7/19/2010 7:39:08 PM.
on 7/19/2010 7:39:08 PM refers to Date = '2010-07-19 19:39:08.0'
SELECT T1.Views FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE T2.Date = '2010-07-19 19:39:08.0'
620
simple
california_schools
How many schools in merged Alameda have number of test takers less than 100?
SELECT COUNT(T1.CDSCode) FROM schools AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds WHERE T1.StatusType = 'Merged' AND T2.NumTstTakr < 100 AND T1.County = 'Alameda'
16
simple
student_club
Please provide links to events for members who have paid more than 50 dollar.
have paid more than 50 dollar refers to cost > 50
SELECT DISTINCT T3.link_to_event FROM expense AS T1 INNER JOIN member AS T2 ON T1.link_to_member = T2.member_id INNER JOIN attendance AS T3 ON T2.member_id = T3.link_to_member WHERE T1.cost > 50
1,436
simple
european_football_2
For the team "Hannover 96", what was its defence aggression class on 2015/9/10?
"Hannover 96" refers to team_long_name = 'Hannover 96'; on 2015/9/10 refers to date = '2015-09-10 00:00:00'
SELECT t2.chanceCreationShootingClass FROM Team AS t1 INNER JOIN Team_Attributes AS t2 ON t1.team_api_id = t2.team_api_id WHERE t1.team_long_name = 'Hannover 96' AND SUBSTR(t2.`date`, 1, 10) = '2015-09-10'
1,113
moderate
card_games
Write down the ruling of Beacon of Immortality.
Beacon of Immortality' is the name of card;
SELECT T2.text FROM cards AS T1 INNER JOIN rulings AS T2 ON T1.uuid = T2.uuid WHERE T1.name = 'Beacon of Immortality'
385
simple
card_games
List down the name of artists for cards in Chinese Simplified.
Chinese Simplified' is the language;
SELECT T1.artist FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T1.uuid = T2.uuid WHERE T2.language = 'Chinese Simplified'
381
simple
superhero
Find the ratio between male superheroes and female superheroes.
ratio = DIVIDE(SUM(gender_id = 1) / SUM(gender_id = 2)); male superheroes refers to gender_id = 1; female superheroes refers to gender_id = 2;
SELECT CAST(COUNT(CASE WHEN T2.gender = 'Male' THEN T1.id ELSE NULL END) AS REAL) / COUNT(CASE WHEN T2.gender = 'Female' THEN T1.id ELSE NULL END) FROM superhero AS T1 INNER JOIN gender AS T2 ON T1.gender_id = T2.id
801
moderate
codebase_community
What are the display names and ages of user who got the highest in views?
the highest in views refers to MAX(Views);
SELECT DisplayName, Age FROM users WHERE Views = ( SELECT MAX(Views) FROM users )
643
simple
superhero
Find the average weight of the heroes who are aliens.
average = AVG(weight_kg); aliens refers to race = 'Alien';
SELECT CAST(SUM(T1.weight_kg) AS REAL) / COUNT(T1.id) FROM superhero AS T1 INNER JOIN race AS T2 ON T1.race_id = T2.id WHERE T2.race = 'Alien'
789
simple
card_games
Please list the websites where I can purchase the cards that have the promotional type of "bundle".
promotional type of "bundle" refers to promoTypes = 'bundle'; websites refers to purchaseUrls
SELECT DISTINCT purchaseUrls FROM cards WHERE promoTypes = 'bundle'
457
simple
debit_card_specializing
Which client ID consumed the most in September 2013?
September 2013 refers to yearmonth.date = '201309'
SELECT T1.CustomerID FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.Date = '201309' GROUP BY T1.CustomerID ORDER BY SUM(T2.Consumption) DESC LIMIT 1
1,495
simple
california_schools
What is the postal street address for the school with the 6th highest Math average? Indicate the school's name.
Postal street and mailing street are synonyms.
SELECT T2.MailStreet, T2.School FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode ORDER BY T1.AvgScrMath DESC LIMIT 5, 1
50
simple
formula_1
What was the fastest lap speed among all drivers in the 2009 Spanish Grand Prix?
the fastest lap speed among all refers to max(fastestLapSpeed)
SELECT T2.fastestLapSpeed FROM races AS T1 INNER JOIN results AS T2 ON T2.raceId = T1.raceId WHERE T1.name = 'Spanish Grand Prix' AND T1.year = 2009 AND T2.fastestLapSpeed IS NOT NULL ORDER BY T2.fastestLapSpeed DESC LIMIT 1
931
moderate
codebase_community
What is the average number of posts voted by the oldest users?
average number of posts voted refers to AVG(PostId) FROM votes; the oldest users refer to MAX(Age);
SELECT AVG(PostId) FROM votes WHERE UserId IN ( SELECT Id FROM users WHERE Age = ( SELECT MAX(Age) FROM users ) )
673
simple
codebase_community
What is the comment's rating score of the post which was created on 7/19/2010 7:19:56 PM
created on 7/19/2010 7:19:56 PM refers to CreationDate = '2010-07-19 19:19:56.0'
SELECT T1.Score FROM comments AS T1 INNER JOIN posts AS T2 ON T1.PostId = T2.Id WHERE T1.CreationDate = '2010-07-19 19:19:56.0'
616
simple
superhero
Which superhero has the same eyes, hair and skin colour? Indicate the publisher of the superhero.
which superhero refers to superhero_name; the same eyes, hair and skin colour refers to hair_colour_id = skin_colour_id AND hair_colour_id = eye_colour_id; publisher refers to publisher_name;
SELECT T1.superhero_name, T2.publisher_name FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T1.eye_colour_id = T1.hair_colour_id AND T1.eye_colour_id = T1.skin_colour_id
773
challenging
debit_card_specializing
Which segment had the least consumption?
SELECT T1.Segment FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID GROUP BY T1.Segment ORDER BY SUM(T2.Consumption) ASC LIMIT 1
1,478
simple
student_club
Calculate the percentage of members who are major Mathematics in the list?
DIVIDE(SUM(position = 'Member' and major_name = 'Mathematics'), COUNT(member_id)) * 100
SELECT CAST(SUM(CASE WHEN T2.major_name = 'Mathematics' THEN 1 ELSE 0 END) AS REAL) * 100 / 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'
1,421
moderate
codebase_community
In comments with score between 1 to 5, list down the display names of the users with 0 down votes.
DownVotes = 0; Score BETWEEN 1 and 5
SELECT T2.DisplayName FROM comments AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T1.Score BETWEEN 1 AND 5 AND T2.DownVotes = 0
715
simple
debit_card_specializing
For all the people who paid more than 29.00 per unit of product id No.5. Give their consumption status in the August of 2012.
August of 2012 means Date contains '201208' in the yearmonth.date of the database; Price per unit of product = Price / Amount
SELECT T2.Consumption FROM transactions_1k AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Price / T1.Amount > 29.00 AND T1.ProductID = 5 AND T2.Date = '201208'
1,533
moderate
codebase_community
Please list the display names of all the users whose accounts were created in the year 2014.
account created in the year 2014 refers to year(CreationDate) = 2014
SELECT DisplayName FROM users WHERE STRFTIME('%Y', CreationDate) = '2014'
532
simple
thrombosis_prediction
How many patients with a normal RF don't have thrombosis?
normal RF refers to RF < 20; don't have thrombosis refers to Thrombosis = '0';
SELECT COUNT(DISTINCT T1.ID) FROM Examination AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.RF < 20 AND T1.Thrombosis = 0
1,261
simple
codebase_community
Indicate the creation date of the maximum number of votes.
the creation date of the maximum number of votes refers to CreationDate where Max(Count(Id))
SELECT CreationDate FROM votes GROUP BY CreationDate ORDER BY COUNT(Id) DESC LIMIT 1
559
simple
student_club
How many events did the member with the phone number "954-555-6240" attend?
SELECT COUNT(T2.link_to_event) FROM member AS T1 INNER JOIN attendance AS T2 ON T1.member_id = T2.link_to_member WHERE T1.phone = '954-555-6240'
1,374
simple
codebase_community
How many users received commentator badges in 2014?
commentator is the name of the badge; year(Date) = 2014;
SELECT COUNT(Id) FROM badges WHERE Name = 'Commentator' AND STRFTIME('%Y', Date) = '2014'
641
simple
thrombosis_prediction
What is the ratio of outpatient to inpatient followed up treatment among all the 'SLE' diagnosed patient?
'SLE' refers to diagnosis; inpatient refers to Admission = '+'; outpatient refers to Admission = '-'; DIVIDE(COUNT(ID) where Diagnosis = 'SLE' and Admission = '+', COUNT(ID) where Diagnosis = 'SLE' and Admission = '-')
SELECT SUM(CASE WHEN Admission = '+' THEN 1 ELSE 0 END) / SUM(CASE WHEN Admission = '-' THEN 1 ELSE 0 END) FROM Patient WHERE Diagnosis = 'SLE'
1,152
moderate
thrombosis_prediction
How many patients hadn't undergone a medical examination until at least a year following their initial hospital visit?
hadn't undergone a medical examination until at least a year refers to SUBTRACT(year(`Examination Date`), year(`First Date`)) > = 1
SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.Admission = '+' AND STRFTIME('%Y', T2.`Examination Date`) - STRFTIME('%Y', T1.`First Date`) >= 1
1,170
moderate
student_club
Tell the hometown county for "Adela O'Gallagher".
hometown county refers to county
SELECT T2.county FROM member AS T1 INNER JOIN zip_code AS T2 ON T1.zip = T2.zip_code WHERE T1.first_name = 'Adela' AND T1.last_name = 'O''Gallagher'
1,347
simple