id
int64 0
1.53k
| query
stringlengths 23
215
| sql
stringlengths 29
1.45k
| difficulty
stringclasses 3
values |
---|---|---|---|
974 |
State the racing year which has the fastest lap time?
|
SELECT T2.year FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T1.fastestLapTime IS NOT NULL
|
simple
|
997 |
Which citizenship do the vast majority of the drivers hold?
|
SELECT nationality FROM drivers GROUP BY nationality ORDER BY COUNT(driverId) DESC LIMIT 1
|
simple
|
1,080 |
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?
|
SELECT COUNT(player_api_id) FROM Player_Attributes WHERE preferred_foot = 'left' AND attacking_work_rate = 'low'
|
moderate
|
1,142 |
In the 2015–2016 season, how many games were played in the Italian Serie A league?
|
SELECT COUNT(t2.id) FROM League AS t1 INNER JOIN Match AS t2 ON t1.id = t2.league_id WHERE t1.name = 'Italy Serie A' AND t2.season = '2015/2016'
|
simple
|
102 |
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
|
simple
|
489 |
List the keyrune code for the set whose code is 'PKHC'.
|
SELECT keyruneCode FROM sets WHERE code = 'PKHC'
|
simple
|
418 |
What kind of printing is on the card that Daren Bader created?
|
SELECT DISTINCT availability FROM cards WHERE artist = 'Daren Bader'
|
simple
|
608 |
State the detailed content of the comment which was created on 7/19/2010 7:25:47 PM.
|
SELECT Text FROM comments WHERE CreationDate = '2010-07-19 19:16:14.0'
|
simple
|
1,177 |
Was the total cholesterol status for the patient id 2927464 on 1995-9-4 at the normal level?
|
SELECT CASE WHEN `T-CHO` < 250 THEN 'Normal' ELSE 'Abnormal' END FROM Laboratory WHERE ID = 2927464 AND Date = '1995-09-04'
|
simple
|
166 |
How many of the accounts are from Jesenik district?
|
SELECT COUNT(T2.account_id) FROM district AS T1 INNER JOIN account AS T2 ON T1.district_id = T2.district_id WHERE T1.A2 = 'Jesenik'
|
simple
|
591 |
How many users are awarded with supporter badge during year 2011?
|
SELECT COUNT(Id) FROM badges WHERE STRFTIME('%Y', Date) = '2011' AND Name = 'Supporter'
|
simple
|
614 |
Among the users who obtained the "Teacher" badge, calculate their percentage of users
|
SELECT CAST(COUNT(T1.Id) AS REAL) * 100 / (SELECT COUNT(Id) FROM users) FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE T2.Name = 'Teacher'
|
simple
|
901 |
Name the races along with its circuit name and location for f1 races hosted in September 2005.
|
SELECT DISTINCT T2.name, T1.name, T1.location FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T2.year = 2005 AND STRFTIME('%m', T2.date) = '09'
|
simple
|
439 |
List out the set name of the set code "ALL".
|
SELECT name FROM sets WHERE code = 'ALL'
|
simple
|
597 |
How many users from India have the teacher badges?
|
SELECT COUNT(T1.Id) FROM badges AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T2.Location = 'India' AND T1.Name = 'Teacher'
|
simple
|
1,013 |
What is the lap record for the Austrian Grand Prix Circuit?
|
WITH fastest_lap_times AS ( SELECT T1.raceId, T1.fastestLapTime FROM results AS T1 WHERE T1.FastestLapTime IS NOT NULL) SELECT MIN(fastest_lap_times.fastestLapTime) as lap_record FROM fastest_lap_times INNER JOIN races AS T2 on fastest_lap_times.raceId = T2.raceId INNER JOIN circuits AS T3 on T2.circuitId = T3.circuitId WHERE T2.name = 'Austrian Grand Prix'
|
simple
|
1,399 |
Did Maya Mclean attend the 'Women's Soccer' event?
|
SELECT CASE WHEN T3.event_name = 'Women''s Soccer' THEN 'YES' END AS result FROM member AS T1 INNER JOIN attendance AS T2 ON T1.member_id = T2.link_to_member INNER JOIN event AS T3 ON T2.link_to_event = T3.event_id WHERE T1.first_name = 'Maya' AND T1.last_name = 'Mclean'
|
moderate
|
820 |
How strong is the Hulk?
|
SELECT T2.attribute_value 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 T1.superhero_name = 'Hulk' AND T3.attribute_name = 'Strength'
|
moderate
|
428 |
What is the name of set number 5 and its translation?
|
SELECT T1.name, T2.translation FROM sets AS T1 INNER JOIN set_translations AS T2 ON T1.code = T2.setCode WHERE T2.id = 5 GROUP BY T1.name, T2.translation
|
simple
|
786 |
How many heroes have the highest attribute value in strength?
|
SELECT COUNT(T1.hero_id) FROM hero_attribute AS T1 INNER JOIN attribute AS T2 ON T1.attribute_id = T2.id WHERE T2.attribute_name = 'Strength' AND T1.attribute_value = ( SELECT MAX(attribute_value) FROM hero_attribute )
|
moderate
|
353 |
List all the sets available in Italian translation. State the total number of cards per set.
|
SELECT T1.name, T1.totalSetSize FROM sets AS T1 INNER JOIN set_translations AS T2 ON T1.code = T2.setCode WHERE T2.language = 'Italian'
|
simple
|
745 |
Give the publisher ID of Star Trek.
|
SELECT id FROM publisher WHERE publisher_name = 'Star Trek'
|
simple
|
603 |
What is the sum of favourite count gained by user ID 686 in 2011?
|
SELECT SUM(DISTINCT FavoriteCount) FROM posts WHERE Id IN ( SELECT PostId FROM postHistory WHERE UserId = 686 AND STRFTIME('%Y', CreationDate) = '2011' )
|
simple
|
1,285 |
When is the latest patient's medical data recorded? This patient should have an abnormal level of lactate dehydrogenase.
|
SELECT T1.`First Date` FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.LDH >= 500 ORDER BY T1.`First Date` DESC LIMIT 1
|
moderate
|
810 |
What is the race of the superhero with maximum attribute value?
|
SELECT T3.race FROM superhero AS T1 INNER JOIN hero_attribute AS T2 ON T1.id = T2.hero_id INNER JOIN race AS T3 ON T1.race_id = T3.id ORDER BY T2.attribute_value DESC LIMIT 1
|
simple
|
976 |
List the driver's ID of the top five driver, by descending order, the fastest time during the first lap of the race.
|
SELECT driverId FROM lapTimes WHERE lap = 1 ORDER BY time LIMIT 5
|
simple
|
793 |
Among the superheroes with the race of god/eternal, how many of them are male
|
SELECT COUNT(*) FROM superhero AS T1 INNER JOIN race AS T2 ON T1.race_id = T2.id INNER JOIN gender AS T3 ON T3.id = T1.gender_id WHERE T1.race_id = 21 AND T1.gender_id = 1
|
simple
|
398 |
What is the unconverted mana do all the cards created by Rob Alexander cost in total?
|
SELECT manaCost FROM cards WHERE artist = 'Rob Alexander'
|
simple
|
133 |
In 1996, which districts have the highest unemployment rate? List their branch location and district name.
|
SELECT district_id, A2 FROM district ORDER BY A13 DESC LIMIT 1
|
simple
|
190 |
How many clients who were born in 1920 stay in east Bohemia?
|
SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE STRFTIME('%Y', T1.birth_date) = '1920' AND T2.A3 = 'east Bohemia'
|
simple
|
327 |
Which non-carcinogenic molecules consisted more than 5 atoms?
|
SELECT T.molecule_id FROM ( SELECT T1.molecule_id, COUNT(T2.atom_id) FROM molecule AS T1 INNER JOIN atom AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.label = '-' GROUP BY T1.molecule_id HAVING COUNT(T2.atom_id) > 5 ) t
|
moderate
|
1,518 |
For the deal happened at 2012/8/24 12:42:00, which country was it?
|
SELECT T2.Country FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T1.Date = '2012-08-24' AND T1.Time = '12:42:00'
|
simple
|
1,281 |
Among the patients who have an abnormal level of glutamic oxaloacetic transaminase, when was the youngest of them born?
|
SELECT T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GOT >= 60 ORDER BY T1.Birthday DESC LIMIT 1
|
moderate
|
339 |
List the atom ID of the carcinogenic molecule that contains oxygen?
|
SELECT T1.atom_id FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.element = 'o' AND T2.label = '+'
|
simple
|
1,027 |
Indicate the full names of the top 10 players with the highest number of penalties.
|
SELECT t2.player_name FROM Player_Attributes AS t1 INNER JOIN Player AS t2 ON t1.id = t2.id ORDER BY t1.penalties DESC LIMIT 10
|
simple
|
471 |
What is the expansion type of the set "Hauptset Zehnte Edition"?
|
SELECT T1.type FROM sets AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.code WHERE T2.translation = 'Hauptset Zehnte Edition'
|
simple
|
683 |
What is the percentage of posts whose owners had a reputation of over 1000 in 2011?
|
SELECT CAST(SUM(IIF(STRFTIME('%Y', T2.CreaionDate) = '2011' AND T1.Reputation > 1000, 1, 0)) AS REAL) * 100 / COUNT(T1.Id) FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId
|
moderate
|
1,145 |
Which top 4 leagues had the most games in the 2015-2016 season?
|
SELECT t1.name FROM League AS t1 INNER JOIN Match AS t2 ON t1.id = t2.league_id WHERE t2.season = '2015/2016' GROUP BY t1.name ORDER BY COUNT(t2.id) DESC LIMIT 4
|
simple
|
1,296 |
What is the anti-nucleus antibody concentration of the patient whose total bilirubin is the highest in the normal range?
|
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
|
moderate
|
93 |
How many male customers who are living in North Bohemia have average salary greater than 8000?
|
SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.gender = 'M' AND T2.A3 = 'north Bohemia' AND T2.A11 > 8000
|
moderate
|
871 |
For the driver who had the Q2 time as 0:01:15 in race No. 347, where is he from?
|
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%'
|
simple
|
992 |
Find the full name, Wiki Pedia page link, and date of birth of German drivers born between 1971 and 1985. List it in descending order of date of birth.
|
SELECT forename, surname, url, dob FROM drivers WHERE nationality = 'German' AND STRFTIME('%Y', dob) BETWEEN '1971' AND '1985' ORDER BY dob DESC
|
moderate
|
626 |
How many votes were made in 2010?
|
SELECT COUNT(id) FROM votes WHERE STRFTIME('%Y', CreationDate) = '2010'
|
simple
|
1,420 |
State the name of major that Vice President has joined.
|
SELECT T1.major_name FROM major AS T1 INNER JOIN member AS T2 ON T1.major_id = T2.link_to_major WHERE T2.position = 'Vice President'
|
simple
|
884 |
List the names of all races that occurred in the earliest recorded year and month.
|
SELECT name FROM races WHERE STRFTIME('%Y', date) = ( SELECT STRFTIME('%Y', date) FROM races ORDER BY date ASC LIMIT 1 ) AND STRFTIME('%m', date) = ( SELECT STRFTIME('%m', date) FROM races ORDER BY date ASC LIMIT 1 )
|
moderate
|
660 |
What is the owner user id of the most valuable post?
|
SELECT OwnerUserId FROM posts WHERE FavoriteCount = ( SELECT MAX(FavoriteCount) FROM posts )
|
simple
|
1,515 |
What segment did the customer have at 2012/8/23 21:20:00?
|
SELECT T2.Segment FROM transactions_1k AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.date = '2012-08-23' AND T1.time = '21:20:00'
|
simple
|
905 |
What is Eddie Irvine's average points scored in year 2000?
|
SELECT AVG(T2.points) FROM drivers AS T1 INNER JOIN driverStandings AS T2 ON T2.driverId = T1.driverId INNER JOIN races AS T3 ON T3.raceId = T2.raceId WHERE T1.forename = 'Eddie' AND T1.surname = 'Irvine' AND T3.year = 2000
|
simple
|
333 |
In the molecule TR008, how many carbons are present?
|
SELECT COUNT(T.atom_id) FROM atom AS T WHERE T.molecule_id = 'TR008' AND T.element = 'c'
|
simple
|
325 |
How many carcinogenic molecules that consisted of Nitrogen?
|
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 = '+'
|
simple
|
789 |
Find the average weight of the heroes who are aliens.
|
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'
|
simple
|
1,454 |
What is the percentage of the cost for the meeting events?
|
SELECT SUM(CASE WHEN T1.type = 'Meeting' THEN T3.cost ELSE 0 END) * 100 / SUM(T3.cost) 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
|
moderate
|
1,278 |
Of the patients with an normal level of IGG, how many of them admitted to the hospital?
|
SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.IGG > 900 AND T2.IGG <2000 AND T1.Admission = '+'
|
simple
|
1,517 |
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
|
simple
|
300 |
What atoms comprise TR186?
|
SELECT T.atom_id FROM atom AS T WHERE T.molecule_id = 'TR186'
|
simple
|
373 |
Name the cards that were illustrated by Aaron Boyd.
|
SELECT DISTINCT name FROM cards WHERE artist = 'Aaron Boyd'
|
simple
|
394 |
How many white bordered cards are powerful?
|
SELECT COUNT(id) FROM cards WHERE borderColor = 'white' AND cardKingdomId IS NOT NULL AND cardKingdomFoilId IS NOT NULL
|
simple
|
1,264 |
Among the patients have blood clots in veins, how many of them have a normal level of complement 4?
|
SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.C4 > 10 AND T1.Diagnosis = 'APS'
|
moderate
|
61 |
How many chartered schools located in the city of Hickman are owned by the Elementary School District?
|
SELECT COUNT(School) FROM schools WHERE DOC = 52 AND Charter = 1 AND City = 'Hickman'
|
simple
|
454 |
Among the cards with a white border color, how many of them have unknown power?
|
SELECT SUM(CASE WHEN power LIKE '%*%' OR power IS NULL THEN 1 ELSE 0 END) FROM cards WHERE borderColor = 'white'
|
simple
|
561 |
What is the title for the post which got the highest score comment?
|
SELECT Title FROM posts WHERE Id = ( SELECT PostId FROM comments ORDER BY Score DESC LIMIT 1 )
|
simple
|
1,446 |
Calculate the percentage of zip codes that are PO boxes.
|
SELECT CAST(SUM(CASE WHEN type = 'PO Box' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(zip_code) FROM zip_code
|
simple
|
803 |
What is the power ID of cryokinesis?
|
SELECT id FROM superpower WHERE power_name = 'Cryokinesis'
|
simple
|
1,010 |
What is the lap record set by Lewis Hamilton in a Formula_1 race?
|
SELECT T1.time FROM lapTimes AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId WHERE T2.forename = 'Lewis' AND T2.surname = 'Hamilton'
|
simple
|
941 |
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'
|
simple
|
1,002 |
As of the present, what is the full name of the youngest racer? Indicate her nationality and the name of the race to which he/she first joined.
|
SELECT T1.forename, T1.surname, T1.nationality, T3.name FROM drivers AS T1 INNER JOIN driverStandings AS T2 on T1.driverId = T2.driverId INNER JOIN races AS T3 on T2.raceId = T3.raceId ORDER BY JULIANDAY(T1.dob) DESC LIMIT 1
|
moderate
|
571 |
For the user No.24, how many times is the number of his/her posts compared to his/her votes?
|
SELECT CAST(COUNT(T2.Id) AS REAL) / COUNT(DISTINCT T1.Id) FROM votes AS T1 INNER JOIN posts AS T2 ON T1.UserId = T2.OwnerUserId WHERE T1.UserId = 24
|
moderate
|
987 |
What is the average fastest lap time of the top 10 drivers in the 2006 United States Grand Prix?
|
SELECT AVG(T1.fastestLapTime) FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T1.rank < 11 AND T2.year = 2006 AND T2.name = 'United States Grand Prix'
|
simple
|
797 |
Which superheroes have blue eyes with brown hair?
|
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'
|
moderate
|
379 |
What are the cards belong to duel deck a? List the ID.
|
SELECT id FROM cards WHERE duelDeck = 'a'
|
simple
|
713 |
What is the up vote number of the user that commented "R is also lazy evaluated."?
|
SELECT T2.UpVotes FROM comments AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T1.Text = 'R is also lazy evaluated.'
|
simple
|
1,362 |
How many cities are there in Orange County, Virginia?
|
SELECT COUNT(city) FROM zip_code WHERE county = 'Orange County' AND state = 'Virginia'
|
simple
|
680 |
What is the average score of Stephen Turner's posts?
|
SELECT AVG(T2.Score) FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId WHERE T1.DisplayName = 'Stephen Turner'
|
simple
|
812 |
List down at least five full names of superheroes with blue eyes.
|
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
|
simple
|
1,426 |
List the last name of members with a major in environmental engineering and include its department and college name.
|
SELECT T2.last_name, T1.department, T1.college FROM major AS T1 INNER JOIN member AS T2 ON T1.major_id = T2.link_to_major WHERE T2.position = 'Member' AND T1.major_name = 'Environmental Engineering'
|
moderate
|
1,068 |
From 2010 to 2015, what was the average overall rating of players who are higher than 170?
|
SELECT CAST(SUM(t2.overall_rating) AS REAL) / COUNT(t2.id) FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.height > 170 AND STRFTIME('%Y',t2.`date`) >= '2010' AND STRFTIME('%Y',t2.`date`) <= '2015'
|
moderate
|
1,422 |
State the category of events were held at MU 215.
|
SELECT DISTINCT T2.category FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.location = 'MU 215'
|
simple
|
1,525 |
What is the percentage of the customers who used EUR in 2012/8/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'
|
simple
|
779 |
How many powers does Amazo hero have?
|
SELECT COUNT(T1.power_id) FROM hero_power AS T1 INNER JOIN superhero AS T2 ON T1.hero_id = T2.id WHERE T2.superhero_name = 'Amazo'
|
simple
|
447 |
Give the code of sets have expansion commander type?
|
SELECT T2.setCode FROM sets AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.code WHERE T1.type = 'commander'
|
simple
|
940 |
Among the drivers that finished the race in the 2008 Chinese Grand Prix, how many of them have participated in Formula_1 races?
|
SELECT COUNT(*) FROM ( SELECT T1.driverId FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T2.name = 'Chinese Grand Prix' AND T2.year = 2008 AND T1.time IS NOT NULL GROUP BY T1.driverId HAVING COUNT(T2.raceId) > 0 )
|
moderate
|
609 |
How many posts have a score of 10 on the list?
|
SELECT COUNT(id) FROM posts WHERE Score = 10
|
simple
|
374 |
How many black border cards are only available on mtgo?
|
SELECT COUNT(id) FROM cards WHERE availability = 'mtgo' AND borderColor = 'black'
|
simple
|
106 |
What is the biggest amount of transaction that the client whose card was opened in 1996/10/21 made?
|
SELECT T4.amount FROM card AS T1 JOIN disp AS T2 ON T1.disp_id = T2.disp_id JOIN account AS T3 on T2.account_id = T3.account_id JOIN trans AS T4 on T3.account_id = T4.account_id WHERE T1.issued = '1996-10-21' ORDER BY T4.amount DESC LIMIT 1
|
simple
|
363 |
How many cards of legalities whose status is restricted are found in a starter deck?
|
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
|
simple
|
1,181 |
For the patient who got the laboratory test of uric acid level as 8.4 on 1991-10-21, how old was he/she at that time?
|
SELECT STRFTIME('%Y', T2.Date) - STRFTIME('%Y', T1.Birthday) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.UA = 8.4 AND T2.Date = '1991-10-21'
|
moderate
|
88 |
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
|
simple
|
138 |
In the branch where the second-highest number of crimes were committed in 1995 occurred, how many male clients are there?
|
SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.gender = 'M' AND T2.A15 = (SELECT T3.A15 FROM district AS T3 ORDER BY T3.A15 DESC LIMIT 1, 1)
|
moderate
|
894 |
What is the best lap time recorded? List the driver and race with such recorded lap time.
|
SELECT T2.milliseconds, T1.forename, T1.surname, T3.name FROM drivers AS T1 INNER JOIN lapTimes AS T2 ON T1.driverId = T2.driverId INNER JOIN races AS T3 ON T2.raceId = T3.raceId ORDER BY T2.milliseconds ASC LIMIT 1
|
moderate
|
12 |
Among the schools with an SAT excellence rate of over 0.3, what is the highest eligible free rate for students aged 5-17?
|
SELECT MAX(CAST(T1.`Free Meal Count (Ages 5-17)` AS REAL) / T1.`Enrollment (Ages 5-17)`) FROM frpm AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds WHERE CAST(T2.NumGE1500 AS REAL) / T2.NumTstTakr > 0.3
|
moderate
|
1,043 |
What is the short name of the football team Queens Park Rangers?
|
SELECT team_short_name FROM Team WHERE team_long_name = 'Queens Park Rangers'
|
simple
|
183 |
How many accounts in Beroun were opened after 1996?
|
SELECT COUNT(account_id) FROM account AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE STRFTIME('%Y', T1.date) > '1996' AND T2.A2 = 'Beroun'
|
simple
|
791 |
Calculate the average height for each superhero.
|
SELECT CAST(SUM(height_cm) AS REAL) / COUNT(id) FROM superhero
|
simple
|
1,408 |
Calculate the total cost spent for Parking in the list.
|
SELECT SUM(cost) FROM expense WHERE expense_description = 'Parking'
|
simple
|
294 |
Which bond ids are double-bond with carcinogenic compound?
|
SELECT T1.bond_id FROM bond AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '+' AND T1.bond_type = '='
|
simple
|
768 |
How many superheroes were published by Dark Horse Comics?
|
SELECT COUNT(T1.id) FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'Dark Horse Comics'
|
simple
|
787 |
What are the race and alignment of Cameron Hicks?
|
SELECT T2.race, T3.alignment FROM superhero AS T1 INNER JOIN race AS T2 ON T1.race_id = T2.id INNER JOIN alignment AS T3 ON T1.alignment_id = T3.id WHERE T1.superhero_name = 'Cameron Hicks'
|
simple
|
776 |
Provide the hero name and race of Charles Chandler.
|
SELECT T1.superhero_name, T2.race FROM superhero AS T1 INNER JOIN race AS T2 ON T1.race_id = T2.id WHERE T1.full_name = 'Charles Chandler'
|
simple
|
1,269 |
Please list the IDs of the patients who had the examination done after 1997/1/1 and had a normal anti-scl70.
|
SELECT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.SC170 IN ('negative','0') AND T2.Date > 1997-01-01
|
moderate
|
908 |
What is the most laps f1 races had? Name the race, year and circuit location where the races with most laps was hosted.
|
SELECT T3.lap, T2.name, T2.year, T1.location FROM circuits AS T1 INNER JOIN races AS T2 ON T1.circuitId = T2.circuitId INNER JOIN lapTimes AS T3 ON T3.raceId = T2.raceId ORDER BY T3.lap DESC LIMIT 1
|
simple
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.