db_id stringclasses 66
values | question stringlengths 24 325 | evidence stringlengths 1 673 ⌀ | gold_query stringlengths 23 804 | db_schema stringclasses 66
values |
|---|---|---|---|---|
simpson_episodes | What is the voting numbers and percentage of the best rating scale of the episode which had keyword of "arab stereotype"? | best rating scale refers to stars = 10 | SELECT T2.votes, T2.percent FROM Keyword AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.keyword = 'arab stereotype' AND T2.stars = 10; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | Please list the names of the institutes in the state of Alabama whose all graduates in total exceeded 500 in 2011? | names of the institutes refers to chronname; graduates refers to grad_cohort; grad_cohort > 500; in 2011 refers to year = 2011; all students refer to race = 'X'. | SELECT DISTINCT T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.state = 'Alabama' AND T2.year = 2011 AND T2.race = 'X' AND T2.grad_cohort > 500 | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | Calculate the average number of current male legislators who chose Democrat from 2000 until 2021. | male refers to gender_bio = 'M'; legislators who chose Democrat refers to party = 'Democrat'; from 2000 until 2021 refers to start > = 2000 AND END < = 2021; calculation = DIVIDE(COUNT(bioguide_id), 22) | SELECT CAST(COUNT(T1.bioguide_id) AS REAL) / 22 FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'M' AND CAST(T2.start AS DATE) >= 2000 AND CAST(T2.END AS DATE) <= 2021 AND T2.party = 'Democrat' | 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, -- ... |
simpson_episodes | Provide the number of credits, category, role and birthplace of the crew member who was born in North Korea. | number of credits refers to credited; born in North Korea refers to birth_country = 'North Korea' | SELECT DISTINCT T2.credited, T2.category, T2.role, T1.birth_place FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.birth_country = 'North Korea'; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
legislator | What are the Facebook, Twitter and YouTube usernames of Adam Kinzinger? | Facebook, Twitter and YouTube usernames refers to facebook, twitter, youtube; Adam Kinzinger is an official_full_name | SELECT T2.facebook FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T1.official_full_name = 'Adam Kinzinger' | 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 all past legislators that chose Pro-Administration as their political party in year 1791. | full name refers to official_full_name; chose Pro-Administration as their political party refers to party = 'Pro-Administration'; 1791 refers to start < = 1791 AND END > = 1791 | 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 CAST(T2.start AS DATE) <= 1791 AND CAST(T2.END AS DATE) >= 1791 | 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, -- ... |
simpson_episodes | Mention the episode ID, title and any three keywords of the episode which get the most number of votes in star classification of worst. | star classification of worst refers to stars = 1; most number of votes refers to MAX(votes) | SELECT DISTINCT T3.episode_id, T2.title, T1.keyword FROM Keyword AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Vote AS T3 ON T2.episode_id = T3.episode_id WHERE T3.stars = 1 ORDER BY T3.votes DESC LIMIT 3; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | Provide the institute name with less than 200 graduate cohort of all races and genders in 2013. Also, please state the total number of full-time equivalent undergraduates for the institute. | institute name refers to chronname; less than 200 graduate cohort refers to grad_cohort < 200; all races refers to race = 'X'; all genders refers to gender = 'B'; in 2013 refers to year = 2013; total number of full-time equivalent undergraduates refers to fte_value; | SELECT T1.chronname, T2.grad_cohort FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T2.year = 2013 AND T2.gender = 'B' AND T2.race = 'X' AND T2.grad_cohort < 200 | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | Provide the full name of all current female legislators that chose Republican as their political party. | full name refers to official_full_name; official_full_name refers to first_name, last_name; female refers to gender_bio = 'F'; chose Republican as their political party refers to party = 'Republican'; current legislators refers to END > Date() | 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.party = 'Republican' AND T1.gender_bio = 'F' AND T2.END > DATE() GROUP BY T1.bioguide_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, -- ... |
simpson_episodes | Describe name, birth country, role in episode and age in 2022 of the oldest crew member.. | age in 2022 refers to SUBTRACT(2022, substr(birthdate, 0, 5)); oldest refers to MIN(birthdate) | SELECT T1.name, T1.birth_place, T2.role, 2022 - CAST(SUBSTR(T1.birthdate, 1, 4) AS int) AS age FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.birthdate IS NOT NULL ORDER BY T1.birthdate LIMIT 1; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | What is the average percentage of students graduating within 100 percent of normal/expected time for Central Alabama Community College? | average = DIVIDE(SUM(grad_100_rate), (SUM(grad_100), SUM(grad_150))); percentage of students graduating within 100 percent of normal/expected time refers to grade_100_rate; Central Alabama Community College refers to chronname = 'Central Alabama Community College'; | SELECT AVG(T2.grad_100_rate) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Central Alabama Community College' | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | How old was Jr. F. James Sensenbrenner when he first started as a legislator? | Jr. F. James Sensenbrenner is an official_full_name; How old refers to SUBTRACT(MIN(start), birthday_bio) | SELECT CAST(MIN(T2.start) - T1.birthday_bio AS DATE) AS AGE FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'F. James Sensenbrenner, Jr.' | 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, -- ... |
college_completion | Among the public institutes in the state of Alabama, how many of them have over 30 students who graduated within 100 percent of normal/expected time in 2011? | public refers to control = 'Public'; over 30 students who graduated within 100 percent of normal/expected time refers to grad_100 > 30; in 2011 refers to year = 2011; | SELECT COUNT(T1.chronname) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.state = 'Alabama' AND T1.control = 'Public' AND T2.year = 2011 AND T2.grad_100 > 30 | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
movie_platform | For all movies where users left a critic, find the movie name, user, rating and critics comments from the user. | movies where users left a critic refers to critic IS NOT NULL; critic comments refers to critic; | SELECT T2.movie_title, T1.user_id, T1.rating_score, T1.critic FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.critic IS NOT NULL | 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 numeric ID of Chris Van Hollen on GovTrack.us? | Chris Van Hollen is an official_full_name; numeric ID on GovTrack.us refers to govtrack | SELECT T2.govtrack FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T1.official_full_name = 'Chris Van Hollen' | 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, -- ... |
simpson_episodes | In "No Loan Again, Naturally", how many stars received votes of no more than 50? | "No Loan Again, Naturally" is the title of episode; votes of no more than 50 refers to votes < 50; number of stars refers to SUM(stars) | SELECT COUNT(*) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'No Loan Again, Naturally' AND T2.votes < 50; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
legislator | List the full name of all current female senators. | full name refers to official_full_name; female refers to gender_bio = 'F'; senators refers to type = 'sen' | SELECT T2.first_name, T2.last_name FROM `current-terms` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T1.type = 'sen' AND T2.gender_bio = 'F' GROUP BY T2.ballotpedia_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, -- ... |
college_completion | Which state is "Mercer University" located in? | Mercer University refers to chronname = 'Mercer University'; | SELECT T FROM ( SELECT DISTINCT CASE WHEN chronname = 'Mercer University' THEN state ELSE NULL END AS T FROM institution_details ) WHERE T IS NOT NULL | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
simpson_episodes | Name the title of the episode that received the highest star score and the highest number of votes. | received the highest star score refers to MAX(stars); the highest number of votes refers to MAX(votes) | SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id ORDER BY T2.stars DESC, T2.votes DESC LIMIT 1; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | What's the average number of graduates for Central Alabama Community College in the 3 consecutive years from 2011 to 2013? | graduates refers to grad_cohort; Central Alabama Community College refers to chronname = 'Central Alabama Community College'; average number of graduates for 3 consecutive years = DIVIDE(SUM(SUM(grad_cohort WHERE year = 2011), SUM(grad_cohort WHERE year = 2012), SUM(grad_cohort WHERE year = 2013)), 3); | SELECT AVG(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Central Alabama Community College' AND T2.year IN (2011, 2012, 2013) AND T2.gender = 'B' AND T2.race = 'X' | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | What is the current official Twitter handle of Roger F. Wicker? | Twitter handle refers to twitter; Roger F. Wicker is an official_full_name | SELECT T2.twitter FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T1.official_full_name = 'Roger F. Wicker' | 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, -- ... |
college_completion | Give the web site address for "Swarthmore College". | website address refers to site; Swarthmore College refers to chronname = 'Swarthmore College'; | SELECT T FROM ( SELECT DISTINCT CASE WHEN chronname = 'Swarthmore College' THEN site ELSE NULL END AS T FROM institution_details ) WHERE T IS NOT NULL | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | Among the legislators who started a term on 2nd December 1793, how many of them were males? | started a term on 2nd December 1793 refers to start = '1793-12-02'; male refers to gender_bio = 'M' | SELECT COUNT(T1.bioguide_id) FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'M' AND T2.start = '1793-12-02' | 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 last name of all current legislators who live in California. | California refers to state = 'CA' | SELECT T1.last_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.state = 'CA' GROUP BY 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, -- ... |
simpson_episodes | Describe the award title, person and character name of the award ID 326. | null | SELECT DISTINCT T1.award, T1.person, T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T2.award_id = 326; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | Tell the abbreviation for "Delaware" state. | abbreviation for state refers to state_abbr; | SELECT T FROM ( SELECT DISTINCT CASE WHEN state = 'Delaware' THEN state_abbr ELSE NULL END AS T FROM state_sector_grads ) WHERE T IS NOT NULL | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | What is the current official Youtube username of Chris Van Hollen? | Youtube username refers to youtube; Chris Van Hollen is an official_full_name | SELECT T2.youtube FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T1.official_full_name = 'Chris Van Hollen' | 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, -- ... |
college_completion | State the average median SAT value for institutes in the state with the most male graduate cohort in 2013. | median SAT value refers to med_sat_value; average = AVG(med_sat_value); male refers to gender = 'M'; graduate cohort refers to grad_cohort; most male graduate cohort refers to MAX(COUNT(grad_cohort WHERE gender = 'M')); in 2013 refers to year = 2013; | SELECT AVG(T1.med_sat_value) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T1.state = T2.state WHERE T2.year = 2013 AND T2.gender = 'M' GROUP BY T2.grad_cohort ORDER BY COUNT(T2.grad_cohort) DESC LIMIT 1 | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | What type of political party Sherrod Brown has in 2005? | political party refers to party; Sherrod Brown is an official_full_name; official_full_name refers to first_name, last_name; 2005 refers to start = 2005 | SELECT T1.party FROM `current-terms` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.first_name = 'Sherrod' AND T2.last_name = 'Brown' AND T1.start LIKE '%2005%' | 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, -- ... |
college_completion | Give the post name of "Idaho" state. | post name refers to state_post; | SELECT T FROM ( SELECT DISTINCT CASE WHEN state = 'Idaho' THEN state_post ELSE NULL END AS T FROM state_sector_details ) WHERE T IS NOT NULL | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | Among the legislators who have served in the U.S. House, provide the party and the state of the legislators who were born in 1738. | have served in the U.S. House refers to house_history_id IS NOT NULL; born in 1738 refers to birthday_bio = 1738 | SELECT T1.party, T1.state FROM `historical-terms` AS T1 INNER JOIN historical AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.house_history_id IS NOT NULL AND T2.birthday_bio LIKE '%1738%' | 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 all the senior senators in year 2013. | full name refers to official_full_name; senior refers to state_rank = 'senior'; senators refers to type = 'sen'; 2013 refers to start LIKE '2013%' | SELECT T2.official_full_name FROM `current-terms` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T1.state_rank = 'senior' AND T1.type = 'sen' AND T1.start LIKE '2013%' | 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, -- ... |
simpson_episodes | Name the title of the episode that was nominated for Emmy's Outstanding Animated Program 21 times. | nominated for refers to result = 'Nominee'; Outstanding Animated Program refers to award = 'Outstanding Animated Program (For Programming Less Than One Hour)'; Emmy's refers to organization = 'Primetime Emmy Awards'; 21 times refers to COUNT(episode_id) = 21; | SELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.organization = 'Primetime Emmy Awards' AND T1.award = 'Outstanding Animated Program (For Programming Less Than One Hour)' AND T1.result = 'Nominee' GROUP BY T1.episode_id HAVING COUNT(T1.episode_id) = 21; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | Which city is "Rensselaer Polytechnic Institute" located in? | Rensselaer Polytechnic Institute refers to chronname = 'Rensselaer Polytechnic Institute'; | SELECT T FROM ( SELECT DISTINCT CASE WHEN chronname = 'Rensselaer Polytechnic Institute' THEN city ELSE NULL END AS T FROM institution_details ) WHERE T IS NOT NULL | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | How many official social media does Mark Warner have? | official social media refers to facebook is not null, instagram is not null, twitter is not null, youtube is not null; Mark Warner is an official_full_name; official_full_name refers to first_name, last_name | SELECT CASE WHEN T1.facebook IS NOT NULL THEN 1 END + CASE WHEN T1.instagram IS NOT NULL THEN 1 END + CASE WHEN T1.twitter IS NOT NULL THEN 1 END + CASE WHEN T1.youtube IS NOT NULL THEN 1 END AS COUNTSOCIAL FROM `social-media` AS T1 INNER JOIN current AS T2 ON T1.bioguide = T2.bioguide_id WHERE T2.first_name = 'Mark' A... | 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, -- ... |
simpson_episodes | Find the winning rate of award in 2010. Describe the winner name, award name, episode title and role of the winner in that episode. | in 2010 refers to year = 2010; winning rate refers to DIVIDE(COUNT(result = 'winner'), COUNT(*)); | SELECT T3.rate, T4.person, T4.award, T5.title, T4.role FROM ( SELECT CAST(SUM(CASE WHEN T1.result = 'Winner' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.result IN ('Winner', 'Nominee') THEN 1 ELSE 0 END) AS rate , T1.person, T1.award, T2.title, T1.role FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.... | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | How many 2-year public schools are there in "California"? | 2-year refers to level = '2-year'; public refers to control = 'public'; California refers to state = 'California'; | SELECT COUNT(stateid) FROM state_sector_details WHERE state = 'California' AND level = '2-year' AND control = 'Public' | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
college_completion | Give the web site address for the school in "PA" state with the highest latitude. | web site address refers to site; PA refers to state_abbr = 'PA'; highest latitude refers to MAX(lat_y); | SELECT DISTINCT T1.site FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'PA' AND T1.lat_y = ( SELECT MAX(T1.lat_y) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'PA' ) | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | How many male legislators are Roman Catholic? | male refers to gender_bio = 'M'; Roman Catholic is a religion_bio | SELECT COUNT(*) FROM current WHERE religion_bio = 'Roman Catholic' AND gender_bio = 'M' | 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, -- ... |
simpson_episodes | What is the birth name of Al Jean and his role in creating The simpson 20s: Season 20? | null | SELECT DISTINCT T1.birth_name, T2.role FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.name = 'Al Jean'; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
simpson_episodes | What is the total number of awards won by The simpson 20s: Season 20? | total number of awards refers to COUNT(award); awards won refers to result = 'Winner'; | SELECT COUNT(award_id) FROM Award WHERE result = 'Winner'; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | State the name and website of the institutes from the state with 209 graduate cohort in 2011. | name of the institutes refers to chronname; website refers to site; graduate cohort refers to grad_cohort; in 2011 refers to year = '2011'; | SELECT T1.chronname, T1.site FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T1.state = T2.state WHERE T2.year = 2011 AND T2.grad_cohort = 209 | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
simpson_episodes | Name the performer who won Emmy Award for Outstanding Voice-Over Performance by playing Homer simpson 20. | Outstanding Voice-Over Performance refers to award = 'Outstanding Voice-Over Performance'; who won refers to result = 'Winner'; Emmy refers to organization = 'Primetime Emmy Awards'; playing Homer simpson 20 refers to character = 'Homer simpson 20' | SELECT T1.person FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T2.character = 'Homer simpson 20' AND T1.organization = 'Primetime Emmy Awards' AND T1.award = 'Outstanding Voice-Over Performance' AND T1.result = 'Winner'; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | How many 2-year private nonprofit schools in "CT" whose graduation rate falls below the average for the state? | 2-year refers to level = '2-year'; private nonprofit refers to control = 'Private not-for-profit'; CT refers to state_abbr = 'CT'; graduation rate falls below the average for the state refers to awards_per_value < awards_per_natl_value; | SELECT COUNT(DISTINCT T1.chronname) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'CT' AND T2.level = '2-year' AND T1.control = 'Private not-for-profit' AND T1.awards_per_value < T1.awards_per_natl_value | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
disney | Determine the average gross for Disney's PG-13-rated action movies. | DIVIDE(SUM(total_gross where genre = 'Action' and MPAA_rating = 'PG-13'), COUNT(movie_title where genre = 'Action' and MPAA_rating = 'PG-13')); | SELECT SUM(CAST(REPLACE(trim(total_gross, '$'), ',', '') AS REAL)) / COUNT(movie_title) FROM movies_total_gross WHERE MPAA_rating = 'PG-13' | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEX... |
simpson_episodes | List all keywords associated with the episode 'Take My Life, Please'. | episode 'Take My Life, Please' refers to title = 'Take My Life, Please' | SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Take My Life, Please'; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | Tell the name of school in "NJ" that could get the bachelor's degree with highest students number. | name of school refers to chronname; NJ refers to state_abbr = 'NJ'; bachelor's degree refers to level = '4-year'; highest students number refers to MAX(student_count); | SELECT DISTINCT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'NJ' AND T1.level = '4-year' AND T1.student_count = ( SELECT MAX(T1.student_count) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE ... | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | How many current legislators chose Republican as their political party? | chose Republican as their political party refers to party = 'Republican' | SELECT COUNT(*) FROM `current-terms` WHERE party = 'Republican' | 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 females were members of the past legislators? | female refers to gender_bio = 'F' | SELECT COUNT(*) 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, -- ... |
college_completion | Tell the number of 4-year public schools in UT whose graduation rate exceeds the average for the state. | 4-year refers to level = '4-year'; public refers to control = 'Public'; UT refers to state_abbr = 'UT'; graduation rate exceeds the average for the state refers to awards_per_value > awards_per_state_value; | SELECT COUNT(DISTINCT T1.chronname) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'UT' AND T1.level = '4-year' AND T1.control = 'Public' AND T1.awards_per_value > T1.awards_per_state_value | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | How many legislators have an Instagram account? | have an Instagram account refers to instagram is NOT null and instagram <>'' | SELECT COUNT(*) FROM `social-media` WHERE instagram IS NOT NULL AND instagram <> '' | 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, -- ... |
simpson_episodes | What is the average number of stars assigned to The simpson 20s: S20-E12? What is the said episode all about? | average number of stars refers to AVG(stars); simpson 20s: S20-E12 refers to episode_id = 'S20-E12'; episode all about refers to summary | SELECT AVG(T2.stars), T1.summary FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.episode_id = 'S20-E12'; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | Which 4-year private for-profit school in "KY" has the highest graudation 150 value? Give the ID for the school. | 4-year refers to level = '4-year'; private for profit refers to control = 'Private for-profit'; KY refers to state_abbr = 'KY'; highest graduation 150 value refers to MAX(grad_150_value); ID of the school refers to unitid; | SELECT T1.chronname, T1.unitid FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'KY' AND T1.level = '4-year' AND T1.control = 'Private for-profit' GROUP BY T1.chronname ORDER BY SUM(T1.grad_150_value) DESC LIMIT 1 | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
simpson_episodes | How many episodes were aired between October and November 2008? | between October and November 2008 refers to air_date BETWEEN '2008-10-01' and '2008-11-30' | SELECT COUNT(episode_id) FROM Episode WHERE air_date LIKE '2008-10%' OR air_date LIKE '2008-11%'; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | Name the state with the most number of graduate cohort in 2012 from private institute for profit? List all such institutes in the mentioned state. | most number of graduate cohort refers to MAX(SUM(grad_cohort)); in 2012 refers to year = 2012; private institute for profit refers to control = 'Private for-profit'; institutes refers to chronname; | SELECT T1.state, T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T1.state = T2.state WHERE T2.year = 2012 AND T1.control = 'Private for-profit' GROUP BY T2.grad_cohort ORDER BY COUNT(T2.grad_cohort) DESC LIMIT 1 | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | List the full names, Twitter IDs, and YouTube IDs of legislators who have Richard as their first name. | full names refers to official_full_name; Richard as their first name refers to first_name = 'Richard' | SELECT T2.official_full_name, T1.twitter_id, T1.youtube_id FROM `social-media` AS T1 INNER JOIN current AS T2 ON T1.bioguide = T2.bioguide_id WHERE T2.first_name = 'Richard' | 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, -- ... |
simpson_episodes | How many nominations have Billy Kimball received in 2010 for The simpson 20s: Season 20? | in 2010 refers to year = 2010; nominations refers to result = 'Nominee' | SELECT COUNT(award_id) FROM Award WHERE person = 'Billy Kimball' AND SUBSTR(year, 1, 4) = '2010' AND result = 'Nominee'; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | Give the cohort name for the school with biggest cohort size. | biggest cohort size refers to MAX(cohort_size); cohort = '4y bach' means bachelor's or equivalent-seeking cohort at 4-year institutions; cohort = '4y other' means students seeking another type of degree or certificate at a 4-year institution; cohort = '2y all' means degree-seeking students at 2-year institutions; | SELECT DISTINCT T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.cohort_size = ( SELECT MAX(T1.cohort_size) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid ) | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | Among all the current legislators whose religion is Roman Catholic, what is the percentage of the ones without an instagram account? | religion is Roman Catholic refers to religion_bio = 'Roman Catholic'; calculation = MULTIPLY(DIVIDE(COUNT(instagram is null), COUNT(bioguide_id)), 1.0) | SELECT CAST(SUM(CASE WHEN T1.instagram IS NULL THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM `social-media` AS T1 INNER JOIN current AS T2 ON T1.bioguide = T2.bioguide_id WHERE T2.religion_bio = 'Roman Catholic' | 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, -- ... |
simpson_episodes | What is The simpson 20s: Season 20 average awards winning rate? | average awards winning rate refers to DIVIDE(SUM(result = 'winner'), COUNT(award)); | SELECT CAST(SUM(CASE WHEN result = 'Winner' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(award) AS rate FROM Award; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | Give the name of the 4-year public school in "ID" with the lowest graduation 100 value. | name of the school refers to chronname; 4-year refers to level = '4-year'; public refers to control = 'Public'; ID refers to state_abbr = 'ID'; lowest graduation 100 value refers to MIN(grad_100_value); | SELECT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'ID' AND T1.level = '4-year' AND T1.control = 'Public' GROUP BY T1.chronname ORDER BY SUM(T1.grad_100_value) ASC LIMIT 1 | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
simpson_episodes | How many 10 star votes did the top 4 episodes with the highest rating received? | 10 stars votes refers to stars = 10; highest rating refers to Max(rating); number of votes refers to SUM(votes) | SELECT SUM(T1.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 10 ORDER BY T1.rating DESC LIMIT 4; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | What was the number of female Hispanic students who graduated within 100 percent of expected time for "Pennsylvania State University-Altoona"? | female refers to gender = 'F'; Hispanic refers to race = 'H'; graduated within 100 percent of expected time refers to grad_100; Pennsylvania State University-Altoona refers to chronname = 'Pennsylvania State University-Altoona'; | SELECT SUM(T2.grad_100) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Pennsylvania State University-Altoona' AND T2.gender = 'F' AND T2.race = 'H' | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | When was the last serving date of Matt Salmon? | Matt Salmon is an official_full_name | SELECT T1.END FROM `historical-terms` AS T1 INNER JOIN historical AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.official_full_name = 'Matt Salmon' | 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 males were members of the current legislators? | male refers to gender_bio = 'M' | SELECT COUNT(*) FROM current WHERE gender_bio = 'M' | 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, -- ... |
college_completion | Give the total number of all graduated students from a 2-year public schools in Alabama in 2011. | number of graduated students refers to grad_cohort; 2-year refers to level = '2-year'; public refers to control = 'Public'; Alabama refers to state = 'Alabama'; in 2011 refers to year = '2011'; reace = 'X' means all students. | SELECT SUM(T2.grad_cohort) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T1.state = 'Alabama' AND T2.year = 2011 AND T1.level = '2-year' AND T1.control = 'Public' AND T2.race = 'X' | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
simpson_episodes | What is the birth place of the cast or crew member who won the Best Voice-Over Performance in Online Film & Television Association in 2009? | won refers to result = 'Winner'; 'Best Voice-Over Performance' is the award; ' Online Film & Television Association' is the organization; in 2009 refers to year = 2009 | SELECT T1.birth_place FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.award = 'Best Voice-Over Performance' AND T2.organization = 'Online Film & Television Association' AND T2.year = 2009; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | What is the number of female graduates between 2011 to 2013 from the state where 'Gateway Community College' is located? | female refers to gender = 'F'; graduates refers to grad_cohort; between 2011 to 2013 refers to year BETWEEN 2011 AND 2013; Gateway Community College refers to chronname = 'Gateway Community College'; | SELECT COUNT(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T1.state = T2.state WHERE T2.year BETWEEN 2011 AND 2013 AND T1.chronname = 'Gateway Community College' AND T2.gender = 'F' | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | Among the current legislators who have served for more than 6 terms, how many of them were born after 1960? | served for more than 6 terms refers to COUNT(bioguide > 6); born after 1960 refers to birthday_bio > = '1960-01-01' | SELECT COUNT(CID) FROM ( SELECT T1.bioguide_id AS CID FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.birthday_bio >= '1960-01-01' GROUP BY T2.bioguide HAVING COUNT(T2.bioguide) > 6 ) | 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, -- ... |
simpson_episodes | List the categories for which Bonita Pietila was given credit and her role in creating the episodes. | null | SELECT DISTINCT category, role FROM Credit WHERE person = 'Bonita Pietila'; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
simpson_episodes | Indicate the name and category of the most recent award received by the show. | most recent refers to MAX(year); received refers to result = 'Winner'; name of award refers to award; category refers to award_category | SELECT award, award_category FROM Award WHERE result = 'Winner' ORDER BY year DESC LIMIT 1; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | What is the percentage of the number of 4-year public schools from Madison Area Technical College's home state in the Alabama? | percentage = MULTIPLY(DIVIDE(SUM(chronname = 'Madison Area Technical College'), SUM(state = 'Alabama')), 100); 4-year refers to level = '4-year'; public refers to control = 'Public'; Madison Area Technical College refers to chronname = 'Madison Area Technical College'; home state in the United States refers to state; | SELECT CAST(COUNT(DISTINCT CASE WHEN T1.state = ( SELECT T1.state FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state WHERE T1.chronname = 'Madison Area Technical College' ) AND T1.level = '4-year' AND T1.control = 'Public' THEN T1.chronname ELSE NULL END) AS REAL) * 100 / COUNT(... | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
simpson_episodes | Who produced The simpson 20s: Season 20? | produced refers to role = 'producer' | SELECT DISTINCT person FROM Credit WHERE role = 'producer'; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
legislator | What is the average number of terms for a current female legislator? | female refers to gender_bio = 'F'; calculation refers to DIVIDE(COUNT(bioguide WHERE gender_bio = 'F'), COUNT(bioguide_id)) | 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.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, -- ... |
college_completion | Tell the number of 4-year private not-for-profit schools in the home state of "Brevard Community College". | 4-year refers to level = '4-year'; private not-for-profit refers to control = 'Private not-for-profit'; Brevard Community College refers to chronname = 'Brevard Community College'; | SELECT COUNT(T1.chronname) FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state WHERE T2.level = '4-year' AND T2.control = 'Private not-for-profit' AND T1.chronname = 'Brevard Community College' | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | How many years had Jr. John Conyers served in total? | Jr. John Conyers is an official_full_name; years served refers to SUM(SUBTRACT(END, start)) | SELECT SUM(CAST(T2.END - T2.start AS DATE)) AS sum FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'John Conyers, Jr.' | 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, -- ... |
simpson_episodes | Among episodes aired in 2009, which episode has received the worst response based on the rating. | aired in 2009 refers to year(air_date) = 2009; received the worst response based on the rating refers to MIN(rating) | SELECT episode_id FROM Episode WHERE air_date LIKE '2009%' ORDER BY rating LIMIT 1; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | List down the states in 2011 with a national sector average of 20 and below. | in 2011 refers to year = '2011'; national sector average of 20 and below refers to awards_per_natl_value < 20; | SELECT DISTINCT T1.state FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.year = 2011 AND T1.awards_per_natl_value <= 20 | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | For which state did current legislator Sherrod Brown serve during his term that started on 1993/1/5? | Sherrod Brown is an full official name; started on 1993/1/5 refers to start = '1993-01-05'; | SELECT T1.state FROM `current-terms` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T1.start = '1993-01-05' AND T2.official_full_name = 'Sherrod Brown' | 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, -- ... |
simpson_episodes | Which episode of The simpson 20s: Season 20 has received the most nominations? Indicate the title. | received the most nomination refers to MAX(COUNT(episode_id)) | SELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id GROUP BY T1.episode_id ORDER BY COUNT(*) DESC LIMIT 1; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | For the state which has the 113 2-year public schools, tell the number of graduated Asian students who seeks another type of degree or certificate at a 2-year institution in 2013. | schools_count = 113; 2-year refers to level = '2-year'; public refers to control = 'public'; Asian refers to race = 'A'; seeks another type of degree or certificate at a 2-year institution refers to cohort = '2y all'; in 2013 refers to year = 2013; | SELECT COUNT(T2.grad_cohort) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.level = '2-year' AND T2.control = 'Public' AND T2.gender = 'B' AND T2.race = 'A' AND T2.cohort = '2y all' AND T1.schools_count = 113 | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
simpson_episodes | Who from The simpson 20s: Season 20 cast and crew was born in October 29, 1957 in Chicago, Illinois? | born in October 29, 1957 refers to birthdate = '1957-10-29'; in Chicago refers to birth_place = 'Chicago'; Illinois refers to birth_region = 'Illinois' | SELECT name FROM Person WHERE birthdate = '1957-10-29' AND birth_place = 'Chicago' AND birth_region = 'Illinois'; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | Give the state and name of institutions in year of data release from 2010 to 2012 with black students. | name of institutions refers to chronname; year of data release refers to year; from '2010' to '2012' refers to year BETWEEN 2010 AND 2012; Black refers to race = 'B'; | SELECT DISTINCT T1.state, T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.race = 'B' AND T2.year BETWEEN 2010 AND 2012 | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
simpson_episodes | Please list the name of crew that were born before 1970. | born before 1970 refers to birthdate < '1970-01-01' | SELECT name FROM Person WHERE SUBSTR(birthdate, 1, 4) < '1970'; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | Among the states with a public school count of 20 and below, list their race. | public refers to control = 'Public'; school_count < 20; | SELECT DISTINCT T2.race FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T1.schools_count <= 20 AND T1.control = 'Public' | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | How many legislators hold the title "Majority Leader"? | null | SELECT COUNT(bioguide) FROM `current-terms` WHERE title = 'Majority Leader' | 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, -- ... |
simpson_episodes | How old was composer of the show when he was nominated for Emmy's Outstanding Music Composition for a Series in 2009. Indicate his full name as well. | in 2009 refers to year = 2009; old refers to SUBTRACT(2009, birthdate); composer of the show refers to role = 'composer'; Emmy's refers to organization = 'Primetime Emmy Awards'; nominated refers to result = 'Nominee'; Outstanding Music Composition refers to award = 'Outstanding Music Composition for a Series (Original... | SELECT T1.year - T2.birthdate AS ageIn2009, T2.name FROM Award AS T1 INNER JOIN Person AS T2 ON T1.person = T2.name WHERE T1.role = 'composer' AND T1.organization = 'Primetime Emmy Awards' AND T1.award = 'Outstanding Music Composition for a Series (Original Dramatic Score)' AND T1.result = 'Nominee' AND T1.year = 2009; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
authors | What is the full name of the conference in which the paper "2004 YD5" was published? | '2004 YD5' is the title of paper | SELECT T1.FullName FROM Conference AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.ConferenceId WHERE T2.Title = '2004 YD5' | CREATE TABLE Journal
(
FullName TEXT, --
ShortName TEXT, --
HomePage TEXT, --
Id INTEGER constraint Journal_pk primary key,
);
CREATE TABLE Conference
(
ShortName TEXT, --
Id INTEGER constraint Conference_pk primary key,
HomePage TEXT, --
FullName TEXT, --
);
CREATE TABLE Paper
(
Title TEXT, -- ... |
legislator | Among all the female current legislators, how many of them have served for more than 4 terms? | female refers to gender_bio = 'F'; served for more than 4 terms refers to COUNT(bioguide > 4) | SELECT COUNT(CID) FROM ( SELECT T1.bioguide_id AS CID FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'F' GROUP BY T2.bioguide HAVING COUNT(T2.bioguide) > 4 ) | 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, -- ... |
simpson_episodes | How many crews were born in the USA? | born in the USA refers to birth_country = 'USA' | SELECT COUNT(name) FROM Person WHERE birth_country = 'USA'; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | In Alaska with school count of 1 from year 2011 to 2013, how many of the students are white? | Alaska refers to state = 'Alaska'; from year 2011 to 2013 refers to year BETWEEN '2011' AND '2013'; white refers to race = 'W'; | SELECT COUNT(T2.race) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T1.schools_count = 1 AND T2.year BETWEEN 2011 AND 2013 AND T2.race = 'W' AND T1.state = 'Alaska' | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
cars | Calculate the percentage of American cars among all cars. | American car refers to country = 'USA'; percentage = divide(count(ID where country = 'USA'), count(ID)) * 100% | SELECT CAST(SUM(CASE WHEN T3.country = 'USA' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country | CREATE TABLE data
(
foreign key (ID) references price(ID),
acceleration REAL, --
model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0
horsepower INTEGER, --
weight INTEGER, --
displacement REAL, --
ID INTEGER primary key,
c... |
legislator | How many legislators have not been registered in Federal Election Commission data? | have not been registered in Federal Election Commission data refers to fec_id is null OR fec_id = '' | SELECT COUNT(*) FROM current WHERE fec_id IS NULL OR fec_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, -- ... |
simpson_episodes | What character did Dan Castellaneta play that won him an award for Outstanding Voice-Over Performance in 2009 in the Primetime Emmy Awards? | "Dan Castellaneta" is the person; won refers to result = 'Winner'; 'Outstanding Voice-Over Performance' is the award; 'Primetime Emmy Awards' is the organization; in 2009 refers to year = 2009 | SELECT DISTINCT T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.person = 'Dan Castellaneta' AND T1.award = 'Outstanding Voice-Over Performance' AND T1.organization = 'Primetime Emmy Awards' AND T1.year = 2009; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | Among the race of all students, what is the control of institution and level of institution with highest number of students? | highest number of students refers to student_count; all students refer to race = 'X'. | SELECT DISTINCT T1.control, T1.level FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.race = 'X' AND T1.student_count = ( SELECT MAX(T1.student_count) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.race = 'X' ) | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
simpson_episodes | Which episode ids are rated 5 stars and have more than 100 votes? | more than 100 votes refers to votes > 100 | SELECT episode_id FROM Vote WHERE stars = 5 AND votes > 100; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | Among the states that start with letter A and attained a national sector average of 16.5, give the number of degree-seeking students in the cohort of those students in 2012 . | state that starts with letter A refers to state LIKE 'A%'; national sector average of 16.5 refers to awards_per_natl_value = 16.5; number of degree-seeking students in the cohort refers to grad_cohort; in 2012 refers to year = '2012'; | SELECT SUM(T2.grad_cohort) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.state LIKE 'A%' AND T1.awards_per_natl_value = 16.5 AND T2.year = 2012 | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
simpson_episodes | Please indicate the birthplace of the crew which name is Dan Castellaneta. | null | SELECT birth_place FROM Person WHERE name = 'Dan Castellaneta'; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
college_completion | List the basic of the institution in 2012 with race of all male students. | in 2012 refers to year = '2012'; male refers to gender = 'M'; all students refer to race = 'X'. | SELECT DISTINCT T1.basic, T2.race FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.year = 2012 AND T2.gender = 'M' AND t2.race = 'X' | CREATE TABLE institution_details
(
vsa_enroll_after6_transfer TEXT, --
chronname TEXT, --
vsa_enroll_elsewhere_after6_first TEXT, --
lat_y REAL, --
retain_percentile INTEGER, --
exp_award_state_value INTEGER, --
basic TEXT, --
grad_100_value REAL, --
vsa_grad_after6_transfer TEXT, --
endow_p... |
legislator | For how many terms has current legislator Sherrod Brown served? | Sherrod Brown is an official_full_name | 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' | 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, -- ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.