db_id
stringclasses
66 values
question
stringlengths
24
325
evidence
stringlengths
1
673
gold_query
stringlengths
23
804
db_schema
stringclasses
66 values
legislator
State all the Facebook ID for current legislators under the democrat party.
null
SELECT T2.facebook_id FROM `current-terms` AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide = T2.bioguide WHERE T1.party = 'Democrat' GROUP BY T2.facebook_id
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
What is the description of Act 1, Scene 2 in Twelfth Night?
Twelfth Night refers to Title = 'Twelfth Night'
SELECT T2.Description FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Twelfth Night' AND T2.Act = 1 AND T2.Scene = 2
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
legislator
How many districts did John Conyers, Jr. serve in total?
null
SELECT COUNT(T3.district) FROM ( SELECT T2.district FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'John Conyers, Jr.' GROUP BY T2.district ) T3
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
professional_basketball
In the year 1998, how many home wins did the team which had the 1st round, 12th pick have that year?
in 1998 refers to year = 1998; 1st round refers to draftRound = 1; 12th pick refers to draftSelection = 12; home win refers to homeWon
SELECT T2.homeWon FROM draft AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.draftYear = T2.year WHERE T1.draftRound = 1 AND T1.draftSelection = 12 AND T1.draftYear = 1998
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
olympics
What was the name of the Olympic game that John Aalberg took part in when he was 31?
when he was 31 refers to age = 31; name of the Olympic games refers to games_name;
SELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'John Aalberg' AND T2.age = 31
CREATE TABLE event ( event_name TEXT default NULL, -- sport_id INTEGER default NULL, -- foreign key (sport_id) references sport(id), id INTEGER not null primary key, ); CREATE TABLE sport ( id INTEGER not null primary key, sport_name TEXT default NULL, -- ); CREATE TABLE city ( city_name TEXT default NUL...
professional_basketball
What is the name of the university that was drafted from the player who won the NBA Finals MVP in 1990?
name of the university refers to highSchool; NBA refers to lgID = 'NBA'; Finals MVP refers to award = 'Finals MVP'; in 1990 refers to year = 1990
SELECT T1.college FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1990 AND T2.award = 'Finals MVP'
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
How many female legislators become representatives for California in 2015?
female legislators refers to gender_bio = 'F'; representatives refers to type = 'rep'; for California refers to state = 'CA'; in 2015 refers to the year of start date is '2015';
SELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE STRFTIME('%Y', T2.start) = '2015' AND T2.state = 'CA' AND T1.gender_bio = 'F'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
professional_basketball
Among the coaches who won the 'NBA coach of the year' award from 1971 - 1975, how many of them were in 'POR' team?
the 'NBA coach of the year' award refers to award = 'NBA coach of the year'; from 1971 - 1975 refers to year between 1971 and 1975; 'POR' team refers to tmID = 'POR'
SELECT COUNT(T1.id) FROM awards_coaches AS T1 INNER JOIN teams AS T2 ON T1.year = T2.year WHERE T1.year BETWEEN 1971 AND 1975 AND T1.award = 'NBA Coach of the Year' AND T2.tmID = 'POR'
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
Give the type and start date of the term of the legislator born on November 26, 1727.
start date of the term refers to start; born on November 26, 1727 refers to birthday_bio = '1727-11-26';
SELECT T2.type, T2.start FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.birthday_bio = '1727-11-26'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
legislator
Which historical female legislator that have their term ended on the 3rd of March 1791?
female legislator refers to gender_bio = 'F'; term ended on the 3rd of March 1791 refers to end = '1791-03-03';
SELECT T1.first_name, T1.last_name FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.end = '1791-03-03' AND T1.gender_bio = 'F'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
professional_basketball
How many players did not get more than 10 steals between the years 2000 and 2005?
did not get more than 10 steals refers to count(steals) < = 10; between the years 2000 and 2005 refers to season_id between 2000 and 2005
SELECT COUNT(DISTINCT playerID) FROM player_allstar WHERE season_id BETWEEN 2000 AND 2005 AND steals <= 10
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
Among the current legislators who served the term starting on 2013/1/3, how many of them are female?
term starting on 2013/1/3 refers to start = '2013-01-03; female refers to gender_bio = 'F';
SELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.start = '2013-01-03' AND T1.gender_bio = 'F'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
professional_basketball
Which player selected by Portland in 2nd draftRound won Rookie of the Year in 1971?
2nd draftRound refers to draftRound = 2; won Rookie of the Year refers to award = 'Rookie of the Year'; in 1971 refers to draftYear = 1971
SELECT T1.playerID FROM draft AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Rookie of the Year' AND T1.draftYear = 1971 AND T1.draftRound = 2
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
For how many terms has current legislator Sherrod Brown served as a representative for district no.13?
district no. 13 refers to district = 13;
SELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'Sherrod Brown' AND T2.district = 13
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
legislator
State all the district that Benjamin Contee has served before.
null
SELECT T2.district FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name = 'Benjamin' AND T1.last_name = 'Contee'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
legislator
List all the Jewish current legislators that had served in Florida.
Jewish refers to religion_bio = 'Jewish'; in Florida refers to state = 'FL';
SELECT T1.first_name, T1.last_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.religion_bio = 'Jewish' AND T2.state = 'FL' GROUP BY T1.first_name, T1.last_name
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
professional_basketball
Which winning team in the 1947 playoff quarterfinals managed to score 3,513 defensive points that same year?
team refers to tmID; quarterfinal refers to round = 'QF'; score 3,513 defensive points refers to d_pts > = 3513
SELECT T2.tmID FROM series_post AS T1 INNER JOIN teams AS T2 ON T1.tmIDWinner = T2.tmID WHERE T1.year = 1947 AND T1.round = 'QF' AND T2.d_pts = 3513
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
List down the MapLight ID of the representatives in Maine.
representatives refers to type = 'rep'; Maine refers to state = 'ME';
SELECT T1.maplight_id FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.type = 'rep' AND T2.state = 'ME' GROUP BY T1.maplight_id
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
legislator
Please list the full official names of all the current legislators who served the term that started on 2013/1/3.
term that started on 2013/1/3 refers to start = '2013-01-03';
SELECT T1.official_full_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.start = '2013-01-03'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
Which work is the character Lord Abergavenny from? Please give its short or abbreviated title.
Lord Abergavenny refers to CharName = 'Lord Abergavenny'; short or abbreviated title refers to Title
SELECT DISTINCT T1.Title FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T4.CharName = 'Lord Abergavenny'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
professional_basketball
How many awards were given out in 2010 to players who attended high school in Chicago?
in 2010 refers to year = 2010; attended high school in Chicago refers to college = 'Chicago'
SELECT COUNT(T1.award) FROM awards_players AS T1 INNER JOIN players AS T2 ON T1.playerID = T2.playerID WHERE T1.year = 2010 AND T2.hsCity = 'Chicago'
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
Which current legislator has served for more terms, Sherrod Brown or Maria Cantwell?
if sum(official_full_name = 'Maria Cantwell') > sum(official_full_name = 'Sherrod Brown') then Maria Cantwell has served for more term than Sherrod Brown; if sum(official_full_name = 'Sherrod Brown') > sum(official_full_name = 'Maria Cantwell'), then Sherrod Brown has served for more terms than Maria Cantwell;
SELECT CASE WHEN SUM(CASE WHEN T1.official_full_name = 'Maria Cantwell' THEN 1 ELSE 0 END) > SUM(CASE WHEN T1.official_full_name = 'Sherrod Brown' THEN 1 ELSE 0 END) THEN 'Maria Cantwell' ELSE 'Sherrod Brown' END FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
legislator
What is the Twitter ID of Emanuel Cleaver?
null
SELECT T1.twitter_id FROM `social-media` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.first_name = 'Emanuel' AND T2.last_name = 'Cleaver'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
How many paragraphs are there in Act 1, Scene 1 in Twelfth Night?
Twelfth Night refers to Title = 'Twelfth Night'
SELECT SUM(T3.ParagraphNum) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id WHERE T2.Act = 1 AND T2.Scene = 1 AND T1.Title = 'Twelfth Night'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
shakespeare
How many more scenes are there in Act 1 than in Act 5 in Twelfth Night?
in Twelfth Night refers to Title = 'Twelfth Night'; How many more scenes = subtract(sum(Act = 1), sum(Act = 5))
SELECT SUM(IIF(T2.Act = 1, 1, 0)) - SUM(IIF(T2.Act = 5, 1, 0)) AS more FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Twelfth Night'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
legislator
Which legislators do not have instagram account?
do not have instagram account refers to instagram is null;
SELECT T1.first_name, T1.last_name FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.instagram IS NULL
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
How many paragraphs contain the character Lord Abergavenny?
Lord Abergavenny refers to CharName = 'Lord Abergavenny'
SELECT SUM(T1.ParagraphNum) FROM paragraphs AS T1 INNER JOIN characters AS T2 ON T1.character_id = T2.id WHERE T2.CharName = 'Lord Abergavenny'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
legislator
State the address of Amy Klobuchar at the term of 4th of January 2001.
at the term of 4th of January 2001 refers to start = '2001-04-01';
SELECT T2.address FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name = 'Amy' AND T1.last_name = 'Klobuchar' AND T2.start = '2001-04-01'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
Please list the character names of all the characters from the work Twelfth Night.
character names refers to CharName; Twelfth Night refers to Title = 'Twelfth Night'
SELECT DISTINCT T4.CharName FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.Title = 'Twelfth Night'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
legislator
What is the ratio between male and female legislators?
ratio = DIVIDE(SUM(gender_bio = 'M'),  SUM(gender_bio = 'F')); male refers to gender_bio = 'M'; female refers to gender_bio = 'F'
SELECT CAST(SUM(CASE WHEN gender_bio = 'M' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN gender_bio = 'F' THEN 1 ELSE 0 END) FROM historical
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
For how many times has the scene "OLIVIA’S house." appeared in Twelfth Night?
"OLIVIA’S house."  refers to chapters.Description = 'OLIVIA’S house.'; Twelfth Night refers to Title = 'Twelfth Night'
SELECT COUNT(T2.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Description = 'OLIVIA’S house.' AND T1.Title = 'Twelfth Night'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
movie_platform
What is the user avatar url for user 41579158? What is the latest movie rated by him / her?
user avatar url refers to user_avatar_image_url; latest movie rated refers to latest rating_date;
SELECT T3.user_avatar_image_url, T3.rating_date_utc FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id INNER JOIN ratings_users AS T3 ON T3.user_id = T2.user_id WHERE T3.user_id = 41579158 ORDER BY T3.rating_date_utc DESC LIMIT 1
CREATE TABLE ratings_users ( user_cover_image_url TEXT, -- user_avatar_image_url TEXT, -- rating_date_utc TEXT, -- user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value S...
legislator
What is the official full name of the current legislator whose current official Facebook presence is "senjoniernst"?
current official Facebook presence is "senjoniernst" refers to facebook = 'senjoniernst';
SELECT T1.official_full_name FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.facebook = 'senjoniernst'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
Please list all the paragraphs in Act 1, Scene 1 in Twelfth Night.
Twelfth Night refers to Title = 'Twelfth Night'; list the paragraphs refers to PlainText
SELECT T3.PlainText FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id WHERE T2.Act = 1 AND T2.Scene = 1 AND T1.Title = 'Twelfth Night'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
legislator
List all the junior senators in 1997.
junior senators refers to state_rank = 'junior'; in 1997 refers to start like '1997%';
SELECT T1.first_name, T1.last_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.start LIKE '1997%' AND T2.state_rank = 'junior'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
Please list the IDs of the paragraphs in which the character "son to Tamora" appears.
character "son to Tamora"  refers to characters.Description = 'son to Tamora'
SELECT T1.id FROM paragraphs AS T1 INNER JOIN characters AS T2 ON T1.character_id = T2.id WHERE T2.Description = 'son to Tamora'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
legislator
What is the full official name of the current legislator that has served for the most number of terms?
served for the most number of terms refers to MAX(COUNT(bioguide));
SELECT T1.official_full_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide GROUP BY T1.official_full_name, T2.bioguide ORDER BY COUNT(T2.bioguide) DESC LIMIT 1
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
professional_basketball
Give the player id of the man who had the most turnovers whose team missed the playoffs in year 1988.
the most turnovers refers to max(turnovers); missed the playoffs refers to PostGP = 0; in year 1988 refers to year = 1988
SELECT T2.playerID FROM players_teams AS T1 INNER JOIN players AS T2 ON T1.playerID = T2.playerID WHERE T1.PostGP = 0 AND T1.year = 1988 ORDER BY T1.turnovers DESC LIMIT 1
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
Which legislators are woman?
woman refers to gender_bio = 'F';
SELECT first_name, last_name FROM historical WHERE gender_bio = 'F'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
movie_platform
What is the percentage of the ratings were rated by user who was a subcriber?
user is a subscriber refers to user_subscriber = 1; percentage of ratings = DIVIDE(SUM(user_subscriber = 1), SUM(rating_score)) as percent;
SELECT CAST(SUM(CASE WHEN user_subscriber = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM ratings
CREATE TABLE ratings_users ( user_cover_image_url TEXT, -- user_avatar_image_url TEXT, -- rating_date_utc TEXT, -- user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value S...
professional_basketball
What's the name of the player in 1996 who had the most steals that didn't play in the playoffs?
name of the player refers to first_name, middle_name, last_name; in 1996 refers to year = 1996; the most steals refers to max(steals); didn't play in the playoffs refers to playoff = null
SELECT T1.playerID FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1996 AND T2.PostGP = 0 ORDER BY T2.steals DESC LIMIT 1
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
List all the representatives in 1789 along with the districts and state.
representatives refers to type = 'rep'; in 1789 refers to start like '1789%';
SELECT T2.district, T2.state FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.start LIKE '1789%'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
legislator
Among all the current legislators who have served for more than 4 terms, what is the percentage of them being female?
have served for more than 4 years refers to count(bioguide) > 4; percentage = MULTIPLY(DIVIDE(SUM(gender_bio = 'F'), count(bioguide)), 100.0); female refers to gender_bio = 'F'
SELECT CAST(SUM(CASE WHEN gender_bio = 'F' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.bioguide) FROM ( SELECT T2.bioguide, T1.gender_bio FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide GROUP BY T2.bioguide HAVING COUNT(T2.bioguide) > 4 ) T3
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
How many of Shakespeare's works were finished before the year 1602?
finished before the year 1602 refers to Date < 1602
SELECT COUNT(id) FROM works WHERE Date < 1602
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
professional_basketball
How many All Star players who played in the 1973 season were black?
1973 season refers to season_id = 1973; black refers to race = 'B'
SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.season_id = 1973 AND T1.race = 'B'
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
Calculate the percentage of famous_legislatorss.
percentage = MULTIPLY(DIVIDE(SUM(wikipedia_id is not null), (bioguide_id)), 100.0); famous legislators refers to wikipedia_id is not null;
SELECT CAST(SUM(CASE WHEN wikipedia_id IS NOT NULL THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(bioguide_id) FROM historical
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
professional_basketball
Which team did the all league rebound champion play in 1997? Give the full name of the team.
rebound champion refers to max(rebounds); 1997 refers to 1997; full name refers to teams.name
SELECT T1.name FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T2.year = 1997 GROUP BY T1.name ORDER BY SUM(rebounds + dRebounds) DESC LIMIT 1
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
What is the total number of senators New Jersey have?
senators refers to type = 'rep'; New Jersey refers to state = 'NJ';
SELECT COUNT(type) FROM `historical-terms` WHERE state = 'NJ' AND type = 'rep'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
legislator
Provide the Instagram username of the legislator named Benjamin Hawkins.
Instagram username refers to instagram;
SELECT T1.instagram FROM `social-media` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.first_name = 'Benjamin' AND T2.last_name = 'Hawkins'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
professional_basketball
Which team had more than one player who grabbed more than 600 rebounds in 2011? Give the full name of the team.
more than one player refers to count(playerID) > 1; grabbed more than 600 rebounds refers to rebounds > 600; in 2011 refers to 2011; full name refers to teams.name
SELECT T1.tmID FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 2011 AND T2.rebounds > 600
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
What is the name of the legislator with the ID of W000059?
name of the legislator = first_name, last_name; ID of W000059 refers to bioguide_id = 'W000059';
SELECT first_name, last_name FROM historical WHERE bioguide_id = 'W000059'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
professional_basketball
What were the difference of the CHS team's winning rate between 1946 and 1947 in the post-season series games? Please provide your answer in percentages.
CHS team refers to tmIDWinner = 'CHS'; difference = subtract(divide(count(series_post where year = 1947 and tmIDWinner = 'CHS'), count(series_post where year = 1947)), divide(count(series_post where year = 1946 and tmIDWinner = 'CHS'), count(series_post where year = 1946)))
SELECT CAST(SUM(CASE WHEN year = 1947 AND tmIDWinner = 'CHS' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN year = 1947 THEN 1 ELSE 0 END) - CAST(SUM(CASE WHEN year = 1946 AND tmIDWinner = 'CHS' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN year = 1946 THEN 1 ELSE 0 END) FROM series_post
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
professional_basketball
Which team had the most same starting players througout the season? Give the full name of the team.
the same starting player refers to GP = GS; full name of the team refers to teams.name
SELECT DISTINCT T1.tmID FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T2.GP = T2.GS
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
How many districts are in Idaho?
Idaho refers to state = 'ID';
SELECT COUNT(district) FROM `current-terms` WHERE state = 'ID'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
legislator
How many of the legislators are female?
female refers to gender_bio = 'F';
SELECT COUNT(gender_bio) FROM current WHERE gender_bio = 'F'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
professional_basketball
For the 2001 rebounds leader in the league, when was his birthday?
2001 refers to year = 2001; rebounds leader refers to max(rebounds); birthday refers to birthDate
SELECT birthDate FROM players WHERE playerID = ( SELECT playerID FROM players_teams WHERE year = 2001 GROUP BY playerID ORDER BY SUM(rebounds + dRebounds) DESC LIMIT 1 )
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
olympics
How many Olympic competitors are from Finland?
competitors refer to person_id; from Finland refers to region_name = 'Finland';
SELECT COUNT(T1.person_id) FROM person_region AS T1 INNER JOIN noc_region AS T2 ON T1.region_id = T2.id WHERE T2.region_name = 'Finland'
CREATE TABLE event ( event_name TEXT default NULL, -- sport_id INTEGER default NULL, -- foreign key (sport_id) references sport(id), id INTEGER not null primary key, ); CREATE TABLE sport ( id INTEGER not null primary key, sport_name TEXT default NULL, -- ); CREATE TABLE city ( city_name TEXT default NUL...
shakespeare
How many scenes are there in Act 1 in Twelfth Night?
Twelfth Night refers to Title = 'Twelfth Night'
SELECT COUNT(T1.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Act = 1 AND T1.Title = 'Twelfth Night'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
legislator
Does Thomas Carnes have an account on ballotpedia.org?
if first_name = 'Thomas' and last_name = 'Carnes' AND ballotpedia_id is null then Thomas Carnes doesn't have an account on ballotpedia.org; if first_name = 'Thomas' and last_name = 'Carnes' AND ballotpedia_id is NOT null then Thomas Carnes have an account on ballotpedia.org;
SELECT CASE WHEN ballotpedia_id IS NULL THEN 'doesn''t have' ELSE 'have' END AS HaveorNot FROM historical WHERE first_name = 'Thomas' AND last_name = 'Carnes'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
olympics
When John Aalberg took part in the 1994 Winter Olympic Game, how old was he?
how old was he refers to age; 1994 Winter refers to games_name = '1994 Winter';
SELECT T2.age FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'John Aalberg' AND T1.games_name = '1994 Winter'
CREATE TABLE event ( event_name TEXT default NULL, -- sport_id INTEGER default NULL, -- foreign key (sport_id) references sport(id), id INTEGER not null primary key, ); CREATE TABLE sport ( id INTEGER not null primary key, sport_name TEXT default NULL, -- ); CREATE TABLE city ( city_name TEXT default NUL...
professional_basketball
For the player in 2011 who started every game he played, which team had the player who had the most steals?
in 2011 refers to year = 2011; started every game refers to GP = GS; the most steals refers to max(steals); team refers to tmID
SELECT T1.tmID FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 2011 AND T2.GP = T2.GS GROUP BY T1.tmID, T2.steals ORDER BY T2.steals DESC LIMIT 1
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
How many legislators are not senator?
not senator refers to class is null;
SELECT COUNT(bioguide) FROM `current-terms` WHERE class IS NULL
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
professional_basketball
Which team did the youngest player who could be in F-G position play in the NBA?
team refers to tmID; the youngest refers to max(year); F-G position refers to pos like '%F'; NBA refers to lgID = 'NBA'
SELECT T1.tmID FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN players AS T3 ON T2.playerID = T3.playerID WHERE T3.pos = 'F-G' AND T2.lgID = 'NBA' ORDER BY T3.birthDate DESC LIMIT 1
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
How many legislators were born in 1736?
born in 1736 refers to birthday_bio like '1736%';
SELECT COUNT(bioguide_id) FROM historical WHERE birthday_bio LIKE '1736%'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
professional_basketball
For the players who played the most PBLA games, who was graduated from Central Missouri State college?
the most PBLA games refers to max(games_played); Central Missouri State college refers to college = 'Central Missouri State'
SELECT T1.firstName, T1.middleName, T1.lastName FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.lgID = 'PBLA' AND T2.GP = 10 AND T1.college = 'Central Missouri State' GROUP BY T1.firstName, T1.middleName, T1.lastName ORDER BY COUNT(T2.id) DESC LIMIT 1
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
professional_basketball
In the year 1997 allstar game, which teams did the players had the most rebounds play in? List their team ids.
in 1997 refers to year = 1997; the most rebounds refers to max(rebounds); team id refers to tmID
SELECT T2.tmID FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN player_allstar AS T3 ON T3.playerID = T1.playerID WHERE T3.season_id = 1997 ORDER BY T1.rebounds DESC LIMIT 1
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
Among the male legislators born between 1955 to 1965, what is the percentage of the legislators with an independent party?
male refers to gender_bio = 'M'; born between 1955 to 1965 refers to strftime('%Y', birthday_bio) between '1955' and '1965'; percentage = MULTIPLY(DIVIDE(SUM(party = 'Independent' WHERE gender_bio = 'M' AND strftime('%Y', birthday_bio) between '1955' and '1965'), COUNT(party WHERE gender_bio = 'M' AND strftime('%Y', bi...
SELECT CAST(SUM(CASE WHEN T2.party = 'Independent' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.party) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'M' AND strftime('%Y', T1.birthday_bio) BETWEEN '1955' AND '1965'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
professional_basketball
For the latest passing player who could play all the positions in the court, how many points did he have in his career?
the latest passing refers to max(season_id); play all the positions refers to pos like '%C%' or pos like '%F%' or pos like '%G%'
SELECT SUM(T2.points) FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T1.pos = 'C-F-G' GROUP BY T2.playerID, T2.year ORDER BY T2.year DESC LIMIT 1
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
Find the difference between the number of female senators and representatives born between 1930 to 1970.
difference = SUBTRACT(SUM(type = 'sen' WHERE gender_bio = 'F' AND strftime('%Y', birthday_bio) between '1930' and '1970'), SUM(type = 'rep' WHERE gender_bio = 'F' AND strftime('%Y', birthday_bio) between '1930' and '1970')); female refers to gender_bio = 'F'; senators refers to type = 'sen'; representatives refers to t...
SELECT SUM(CASE WHEN T2.type = 'sen' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.type = 'rep' THEN 1 ELSE 0 END) FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'F' AND strftime('%Y', T1.birthday_bio) BETWEEN '1930' AND '1970'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
legislator
List down the district number of the representative of the house named Jonathan Grout.
district number refers to district; representative of the house refers to type = 'rep';
SELECT T2.district FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.last_name = 'Grout' AND T1.first_name = 'Jonathan' AND T2.type = 'rep'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
professional_basketball
For all the full attendence players in 1995, which player had most turnovers? Give the full name of the player.
full attendance refers to GP = 82; in 1995 refers to year = 1995; the most turnovers refers to max(turnovers); full name refers to first_name, last_name
SELECT T1.firstName, T1.middleName, T1.lastName FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.GP = 82 AND T2.year = 1995 ORDER BY T2.turnovers DESC LIMIT 1
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
Provide the full name and birth date of the legislator with a contact form of http://www.brown.senate.gov/contact/.
full name refers to official_full_name; birth date refers to birthday_bio;
SELECT T1.official_full_name, T1.birthday_bio FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.contact_form = 'http://www.brown.senate.gov/contact/'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
professional_basketball
Please list the players who received the "Most Valuable Player" award in the NBA league after the year of 1990, along with their IDs.
player refers to playerID; "Most Valuable Player" award refers to award = 'Most Valuable Player'; after the year of 1990 refers to year > 1990; ID refers to playerID
SELECT playerID FROM awards_players WHERE year > 1990 AND award = 'Most Valuable Player' AND lgID = 'NBA'
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
Give the state and type of term of the legislator with the google entity ID of kg:/m/02pyzk.
type of term refers to type; google entity ID refers to google_entity_id_id; google_entity_id_id = 'kg:/m/02pyzk';
SELECT T2.state, T2.type FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.google_entity_id_id = 'kg:/m/02pyzk'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
olympics
Please list the names of all the Olympic games that John Aalberg has taken part in.
name of the Olympic games refers to games_name;
SELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'John Aalberg'
CREATE TABLE event ( event_name TEXT default NULL, -- sport_id INTEGER default NULL, -- foreign key (sport_id) references sport(id), id INTEGER not null primary key, ); CREATE TABLE sport ( id INTEGER not null primary key, sport_name TEXT default NULL, -- ); CREATE TABLE city ( city_name TEXT default NUL...
professional_basketball
Percentage of games lost out of total games played by the Houston Mavericks
Houston Mavericks refers to name = 'Houston Mavericks'; percentage = divide(sum(lost), sum(games)) * 100%
SELECT CAST(SUM(lost) AS REAL) * 100 / SUM(games) FROM teams WHERE name = 'Houston Mavericks'
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
Give the religion of the legislator with RSS url of http://www.corker.senate.gov/public/index.cfm/rss/feed.
religion refers to religion_bio;
SELECT T1.religion_bio FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.rss_url = 'http://www.corker.senate.gov/public/index.cfm/rss/feed' GROUP BY T1.religion_bio
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
professional_basketball
Where was the high school of the player who had the most rebounds in the NBA allstar history?
the most rebounds refers to max(rebounds)
SELECT T2.highSchool FROM player_allstar AS T1 INNER JOIN players AS T2 ON T1.playerID = T2.playerID ORDER BY T1.rebounds DESC LIMIT 1
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
professional_basketball
Which team that didn't play in playoffs had the most total rebounds in the year 1997?
didn't play in playoffs refers to PostGP = 0; in the year 1997 refers to year = 1997; the most total rebounds refers to max(o_tmRebound)
SELECT T2.tmID FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.PostGP = 0 AND T1.year = 1997 ORDER BY T1.rebounds DESC LIMIT 1
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
What is the party of the legislator named Susan M. Collins?
legislator's name refers to offical_full_name;
SELECT T2.party FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'Susan M. Collins' GROUP BY T2.party
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
legislator
Provide the type and end date of the term of the legislator named John Vining.
end date of the term refers to end;
SELECT T2.type, T2.end FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name = 'John' AND T1.last_name = 'Vining'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
Please give the title of the work of Shakespeare that has the most characters.
most characters refers to max(count(character_id))
SELECT T.Title FROM ( SELECT T1.Title, COUNT(T3.character_id) AS num FROM works T1 INNER JOIN chapters T2 ON T1.id = T2.work_id INNER JOIN paragraphs T3 ON T2.id = T3.chapter_id INNER JOIN characters T4 ON T3.character_id = T4.id GROUP BY T3.character_id, T1.Title ) T ORDER BY T.num DESC LIMIT 1
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
legislator
Give the full name of the legislators with an independent party.
full name refers to official_full_name;
SELECT T1.official_full_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.party = 'Independent' GROUP BY T1.official_full_name
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
legislator
What is the average number of terms served for a current legislator that's famous or impact?
average = DIVIDE(COUNT(bioguide), COUNT(bioguide_id)); legislator that's famous or impact refers to wikipedia_id is not null;
SELECT CAST(COUNT(T2.bioguide) AS REAL) / COUNT(DISTINCT T1.bioguide_id) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.wikipedia_id IS NOT NULL
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
professional_basketball
For the player who was drafted in the 1st round, 6th position in 1976, which team did he play in that year?
drafted in the 1st round refers to draftRound = 1; 6th position refers to draftSelection = 6; in 1976 refers to year = 1976; team refers to tmID
SELECT T2.tmID FROM draft AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.draftYear = T2.year WHERE T1.draftRound = 1 AND T1.draftSelection = 6 AND T1.draftYear = 1976
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
legislator
Provide the address of the legislator with the contact form of http://www.carper.senate.gov/contact/.
null
SELECT address FROM `current-terms` WHERE contact_form = 'http://www.carper.senate.gov/contact/'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
How many scenes are there on average in one act in Twelfth Night?
Twelfth Night refers to Title = 'Twelfth Night'; average scene = divide(sum(Scene), count(Act))
SELECT SUM(T2.Scene) / COUNT(T2.Act) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Twelfth Night'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
legislator
Who is the Pro-Administration senator that runs from March 4, 1789 to December 31, 1791?
Pro-Administration refers to party = 'Pro-Administration'; senator refers to type = 'sen'; runs from March 4, 1789 refers to start = '1789-03-04'; runs to refers to end = '1791-12-31';
SELECT T1.first_name, T1.last_name FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.party = 'Pro-Administration' AND T2.start = '1789-03-04' AND T2.end = '1791-12-31'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
How many characters are there in Twelfth Night?
Twelfth Night refers to Title = 'Twelfth Night'
SELECT COUNT(DISTINCT T4.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.Title = 'Twelfth Night'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
legislator
What is the party and state of the legislator that has an open secrets ID of N00003689 and thomas ID of 186?
null
SELECT T2.party, T2.state FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.opensecrets_id = 'N00003689' AND T1.thomas_id = 186 GROUP BY T2.party, T2.state
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
legislator
List the full name of legislators whose born in 1960.
full name refers to official_full_name; born in 1960 refers to birthday_bio like '1960%';
SELECT official_full_name FROM current WHERE birthday_bio LIKE '1960%'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
When did Shakespeare write the first poem?
first poem refers to GenreType = 'Poem' and Date = 'min'
SELECT MIN(Date) FROM works WHERE GenreType = 'Poem'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
legislator
List down the open secrets and thomas ID of the democrat senators of New Jersey.
open secrets refers to opensecrets_id; democrat refers to party = democrat; senators refers to type = 'sen'; New Jersey refers to state = 'NJ';
SELECT T1.opensecrets_id, T1.thomas_id FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.type = 'sen' AND T2.state = 'NJ' GROUP BY T1.opensecrets_id, T1.thomas_id
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
legislator
What is the google entity ID of Benjamin Hawkins?
null
SELECT google_entity_id_id FROM historical WHERE first_name = 'Benjamin' AND last_name = 'Hawkins'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
legislator
Provide the google entity ID of the senators in New York.
google entity ID refers to google_entity_id_id; senators refers to type = 'sen'; New York refers to state = 'NY';
SELECT T1.google_entity_id_id FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.type = 'sen' AND T2.state = 'NY'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
What is the average number of characters in all the works of Shakespeare?
average number = divide(sum(character_id), count(work_id))
SELECT SUM(DISTINCT T4.id) / COUNT(T1.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
legislator
Provide the facebook ID of the facebook account named "RepWilson".
null
SELECT facebook_id FROM `social-media` WHERE facebook = 'RepWilson'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
How many comedies did Shakespeare create?
comedies refers to GenreType = 'Comedy'
SELECT COUNT(id) FROM works WHERE GenreType = 'Comedy'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
legislator
What is the total number of legislators with "John" as their first name?
null
SELECT COUNT(*) FROM current WHERE first_name = 'John'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
professional_basketball
What's the full name of the team that won the most games in 2001 but didn't make the playoffs?
full name of the team refers to teams.name; in 2001 refers to year = 2001; didn't make the playoffs refers to PostGP = 0; won the most games refers to max(won)
SELECT T2.tmID FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.PostGP = 0 ORDER BY T2.won DESC LIMIT 1
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...