db_id
stringclasses
69 values
schema
stringclasses
69 values
m_schema
stringclasses
69 values
question
stringlengths
24
325
sql
stringlengths
23
804
evidence
stringlengths
0
673
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
List the IDs and full names of legislators from the Liberal Republican party.
SELECT T2.bioguide_id, T2.first_name, T2.last_name FROM `historical-terms` AS T1 INNER JOIN historical AS T2 ON T2.bioguide_id = T1.bioguide WHERE T1.party = 'Liberal Republican'
full_name refers to first_name, last_name; from the Liberal Republican party refers to party = 'Liberal Republican'
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Among the legislators who started a term on 2nd December 1793, how many of them were males?
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'
started a term on 2nd December 1793 refers to start = '1793-12-02'; male refers to gender_bio = 'M'
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Compare the number of legislators who started the term in 1875 and 2005.
SELECT SUM(CASE WHEN `current-terms`.start LIKE '2005%' THEN 1 ELSE 0 END) - ( SELECT SUM(CASE WHEN start LIKE '1875%' THEN 1 ELSE 0 END) FROM `historical-terms` ) FROM `current-terms`
started the term in 1875 refers to start LIKE '1875%'; started the term in 2005 refers to start LIKE '2005%'
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
List the full names, Twitter IDs, and YouTube IDs of legislators who have Richard as their first name.
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'
full names refers to official_full_name; Richard as their first name refers to first_name = 'Richard'
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Provide the start date, end date, and party of Pearl Peden Oldfield.
SELECT T2.start, T2.`end`, T2.party FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name = 'Pearl' AND T1.middle_name = 'Peden' AND T1.last_name = 'Oldfield'
start date refers to start; end date refers to end date; Pearl Peden Oldfield refers to official_full_name; official_full_name refers to first_name, middle_name, last_name
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the birthday of Amy Klobuchar?
SELECT birthday_bio FROM current WHERE first_name = 'Amy' AND last_name = 'Klobuchar'
birthday refers to birthday_bio; Amy Klobuchar refers to full name; full name refers to first_name, last_name
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
How many legislators have not been registered in Federal Election Commission data?
SELECT COUNT(*) FROM current WHERE fec_id IS NULL OR fec_id = ''
have not been registered in Federal Election Commission data refers to fec_id is null OR fec_id = ''
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
State the number of female legislators in the list.
SELECT COUNT(*) FROM current WHERE gender_bio = 'F'
female refers to gender_bio = 'F'
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Give the full name of legislators who have accounts on OpenSecrets.org.
SELECT COUNT(*) FROM current WHERE opensecrets_id IS NOT NULL AND opensecrets_id <> ''
full name refers to first_name, last_name; have accounts on OpenSecrets.org refers to opensecrets_id IS NOT NULL AND opensecrets_id <> ''
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the middle name of the legislator whose birthday was on 8/24/1956?
SELECT middle_name FROM current WHERE birthday_bio = '1956-08-24'
birthday was on 8/24/1956 refers to birthday_bio = '1956-08-24'
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
How many legislators hold the title "Majority Leader"?
SELECT COUNT(bioguide) FROM `current-terms` WHERE title = 'Majority Leader'
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the title of legislator whose birthday on 2/20/1942?
SELECT T2.title FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.birthday_bio = '1942-02-20' GROUP BY T2.title
birthday on 2/20/1942 refers to birthday_bio = '1942-02-20'
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the gender of the legislator whose address at 317 Russell Senate Office Building Washington DC 20510?
SELECT T1.gender_bio FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.address = '317 Russell Senate Office Building Washington DC 20510'
gender refers to gender_bio
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
List out the first name of legislators who are senior Senator.
SELECT T1.first_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.state_rank = 'senior' GROUP BY T1.first_name
senior refers to state_rank = 'senior'; only senator has this value 'senior'
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Among male legislators, state number of the legislators who are not the senator.
SELECT COUNT(T3.state) FROM ( SELECT T2.state FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'M' AND (T2.class IS NULL OR T2.class = '') GROUP BY T2.state ) T3
male refers to gender_bio = M; not the senator refers to class IS NULL OR class = ''
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Calculate the percentage of legislators who are Senator and were born in 1964.
SELECT CAST(SUM(CASE WHEN T2.class IS NOT NULL THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.birthday_bio LIKE '%1964%'
are senator refers to class IS NOT NULL; born in 1964 refers to birthday_bio = 1964; calculation = MULTIPLY(DIVIDE(COUNT(class IS NOT NULL THEN bioguide_id), COUNT(bioguide_id)), 1.0)
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Calculate the percentage of legislators who are not Senator and were born before 1975.
SELECT CAST(COUNT(CASE WHEN T2.class IS NULL THEN T1.bioguide_id ELSE NULL END) AS REAL) * 100 / COUNT(T1.bioguide_id) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE CAST(T1.birthday_bio AS DATE) <= 1975
not Senator refers to class is NULL; born before 1975 refers to birthday_bio < = 1975; calculation = MULTIPLY(DIVIDE(COUNT(class IS NULL THEN bioguide_id), COUNT(bioguide_id)), 1.0)
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the twitter name of the legislator whose birthday was on 5/27/1946?
SELECT T2.twitter FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T1.birthday_bio = '1946-05-27'
birthday on 5/27/1946 refers to birthday_bio = '1946-05-27'
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
State the opensecrets_id of the legislator whose YouTube name is Bluetkemeyer.
SELECT T1.opensecrets_id FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T2.youtube = 'BLuetkemeyer'
Bluetkemeyer refers to youtube
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Mention the username of Facebook of Ralph Abraham.
SELECT T2.facebook FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T1.first_name = 'Ralph' AND T1.last_name = 'Abraham'
username of Facebook refers to facebook; Ralph Abraham is an official_full_name; official_full_name refers to first_name, last_name
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the first name of the legislator whose address at 1005 Longworth HOB; Washington DC 20515-1408?
SELECT T1.first_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.address = '1005 Longworth HOB Washington DC 20515-1408' GROUP BY T1.first_name
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the Instagram name of the legislator whose birthday was on 8/24/1952?
SELECT T1.instagram FROM `social-media` AS T1 INNER JOIN current AS T2 ON T1.bioguide = T2.bioguide_id WHERE T2.birthday_bio = '1952-08-24'
Instagram name refers to instagram; birthday on 8/24/1952 refers to birthday_bio = '1952-08-24'
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
State number of legislators who are not the senator among female legislators.
SELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'F' AND (T2.class IS NULL OR T2.class = '')
not the senator refers to class IS NULL OR class = ''; female refers to gender_bio = 'F';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Give the religion of the legislator whose YouTube name is MaxineWaters.
SELECT T2.religion_bio FROM `social-media` AS T1 INNER JOIN current AS T2 ON T1.bioguide = T2.bioguide_id WHERE T1.youtube = 'MaxineWaters'
MaxineWaters relates to youtube
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
How many minority leaders have not been registered in Federal Election Commission data?
SELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.title = 'Minority Leader' AND (T1.fec_id IS NULL OR T1.fec_id = '')
minority leaders is a title; have not been registered in Federal Election Commission data refers to fec_id IS NULL OR fec_id = ''
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
How many of the legislators are male?
SELECT COUNT(*) FROM current WHERE gender_bio = 'M'
male refers to gender_bio = 'M';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Provide the facebook ID of the facebook account named "RepWilson".
SELECT facebook_id FROM `social-media` WHERE facebook = 'RepWilson'
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the total number of legislators with "John" as their first name?
SELECT COUNT(*) FROM current WHERE first_name = 'John'
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Give the district numbers with an Anti-Administration party.
SELECT district FROM `historical-terms` WHERE party = 'Anti-Administration' GROUP BY district
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
List the full name of legislators whose born in 1960.
SELECT official_full_name FROM current WHERE birthday_bio LIKE '1960%'
full name refers to official_full_name; born in 1960 refers to birthday_bio like '1960%';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the google entity ID of Benjamin Hawkins?
SELECT google_entity_id_id FROM historical WHERE first_name = 'Benjamin' AND last_name = 'Hawkins'
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Who is the Pro-Administration senator that runs from March 4, 1789 to December 31, 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 T2.start = '1789-03-04' AND T2.end = '1791-12-31'
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';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What are the first and last name of the representatives of the house in district 9?
SELECT T2.first_name, T2.last_name FROM `historical-terms` AS T1 INNER JOIN historical AS T2 ON T2.bioguide_id = T1.bioguide WHERE T1.district = 9
representatives refers to type = 'rep';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Give the full name of the legislators with an independent party.
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
full name refers to official_full_name;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
List down the open secrets and thomas ID of the democrat senators of New Jersey.
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
open secrets refers to opensecrets_id; democrat refers to party = democrat; senators refers to type = 'sen'; New Jersey refers to state = 'NJ';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Provide the google entity ID of the senators in New York.
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'
google entity ID refers to google_entity_id_id; senators refers to type = 'sen'; New York refers to state = 'NY';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Give the religion of the legislator with RSS url of http://www.corker.senate.gov/public/index.cfm/rss/feed.
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
religion refers to religion_bio;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the party of the legislator named Susan M. Collins?
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
legislator's name refers to offical_full_name;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
List down the district number of the representative of the house named Jonathan Grout.
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'
district number refers to district; representative of the house refers to type = 'rep';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the party and state of the legislator that has an open secrets ID of N00003689 and thomas ID of 186?
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
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Provide the full name and birth date of the legislator with a contact form of http://www.brown.senate.gov/contact/.
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/'
full name refers to official_full_name; birth date refers to birthday_bio;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Give the state and type of term of the legislator with the google entity ID of 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'
type of term refers to type; google entity ID refers to google_entity_id_id; google_entity_id_id = 'kg:/m/02pyzk';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Provide the type and end date of the term of the legislator named John Vining.
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'
end date of the term refers to end;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Find the difference between the number of female senators and representatives born between 1930 to 1970.
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'
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...
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Among the male legislators born between 1955 to 1965, what is the percentage of the legislators with an independent party?
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'
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...
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the name of the legislator with the ID of W000059?
SELECT first_name, last_name FROM historical WHERE bioguide_id = 'W000059'
name of the legislator = first_name, last_name; ID of W000059 refers to bioguide_id = 'W000059';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Does 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'
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;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
How many legislators were born in 1736?
SELECT COUNT(bioguide_id) FROM historical WHERE birthday_bio LIKE '1736%'
born in 1736 refers to birthday_bio like '1736%';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Which legislators are woman?
SELECT first_name, last_name FROM historical WHERE gender_bio = 'F'
woman refers to gender_bio = 'F';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
How many districts are in Idaho?
SELECT COUNT(district) FROM `current-terms` WHERE state = 'ID'
Idaho refers to state = 'ID';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
How many legislators are not senator?
SELECT COUNT(bioguide) FROM `current-terms` WHERE class IS NULL
not senator refers to class is null;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the ratio between male and female legislators?
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
ratio = DIVIDE(SUM(gender_bio = 'M'),  SUM(gender_bio = 'F')); male refers to gender_bio = 'M'; female refers to gender_bio = 'F'
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Calculate the percentage of famous_legislatorss.
SELECT CAST(SUM(CASE WHEN wikipedia_id IS NOT NULL THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(bioguide_id) FROM historical
percentage = MULTIPLY(DIVIDE(SUM(wikipedia_id is not null), (bioguide_id)), 100.0); famous legislators refers to wikipedia_id is not null;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Which legislators do not have instagram account?
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
do not have instagram account refers to instagram is null;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
List all the representatives in 1789 along with the districts and state.
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%'
representatives refers to type = 'rep'; in 1789 refers to start like '1789%';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
State all the district that Benjamin Contee has served before.
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'
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
State the address of Amy Klobuchar at the term of 4th of January 2001.
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'
at the term of 4th of January 2001 refers to start = '2001-04-01';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
List all the junior senators in 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'
junior senators refers to state_rank = 'junior'; in 1997 refers to start like '1997%';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
How many female legislators become representatives for California in 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'
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';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the Twitter ID of Emanuel Cleaver?
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'
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
State all the Facebook ID for current legislators under the democrat party.
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
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Which historical female legislator that have their term ended on the 3rd of March 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.end = '1791-03-03' AND T1.gender_bio = 'F'
female legislator refers to gender_bio = 'F'; term ended on the 3rd of March 1791 refers to end = '1791-03-03';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
List all the Jewish current legislators that had served in Florida.
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
Jewish refers to religion_bio = 'Jewish'; in Florida refers to state = 'FL';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the ratio between famous current legislators and famous historical legislators?
SELECT CAST(COUNT(CASE WHEN wikipedia_id IS NOT NULL THEN bioguide_id ELSE 0 END) AS REAL) * 100 / ( SELECT COUNT(CASE WHEN wikipedia_id IS NOT NULL THEN bioguide_id ELSE 0 END) FROM historical ) FROM current
ratio = DIVIDE(COUNT(current.bioguide_id WHERE current.wikipedia_id is not null), COUNT(historical.bioguide_id WHERE historical.wikipedia_id is not null)); famous current legislators refers to current.wikipedia_id is not null; famous historical legislators refers to historical.wikipedia_id is not null;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Based on the number of current legislators, calculate the percentage of legislators that served in 21st-Century.
SELECT CAST(SUM(CASE WHEN strftime('%Y', T2.start) BETWEEN '2000' AND '2017' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.bioguide_id) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide
percentage = MULTIPLY(DIVIDE(SUM(strftime('%Y', start) between '2000' and '2017'), COUNT(bioguide_id)), 100.0); 1st-Century refers to strftime('%Y', T2.start) between '2000' and '2017';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
How many Catholic legislators do not have an account on ballotpedia.org?
SELECT COUNT(bioguide_id) FROM historical WHERE religion_bio = 'Catholic' AND ballotpedia_id IS NULL
Catholic refers to religion_bio = 'Catholic'; do not have an account on ballotpedia.org refers to ballotpedia_id is null;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
How many class 1 senators belong to the Republican party?
SELECT COUNT(bioguide) FROM `current-terms` WHERE class = 1 AND party = 'Republican'
senators refers to type = 'sen';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What are the full names of the non-google female entity legislators that have not been registered in Federal Election Commission data?
SELECT first_name, last_name FROM historical WHERE gender_bio = 'F' AND google_entity_id_id IS NULL AND fec_id IS NULL
full names = first_name, last_name; non-google entity refers to google_entity_id_id is null; female refers to gender_bio = 'F'; have not been registered in Federal Election Commission data refers to fec_id is null;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
In California, how many representatives ended their term in 1995?
SELECT COUNT(*) FROM `current-terms` WHERE state = 'CA' AND type = 'rep' AND end LIKE '1995%'
California refers to state = 'CA'; representatives refers to type = 'rep'; ended the term in 1995 refers to end like '1995%';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the full name of the oldest legislator?
SELECT first_name, last_name FROM historical ORDER BY birthday_bio LIMIT 1
full name = first_name, last_name; oldest legislator refers to MIN(birthday_bio);
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
List all of the ids of the representatives belonging to the Democrat party in district 13 that ended their term on 1/3/2019?
SELECT bioguide FROM `current-terms` WHERE type = 'rep' AND party = 'Democrat' AND end = '2019-01-03' AND district = 13
ids refers to bioguide; representatives refers to type = 'rep'; ended the term on 1/3/2019 refers to end = '2019-01-03';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the official Twitter handle of Jason Lewis?
SELECT T2.twitter FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'Jason Lewis'
official Twitter handle refers to twitter;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Among the Independent senators that started their term in 2011 and onwards, what are the official full names of the senators that caucused with the Democrat?
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' AND strftime('%Y', T2.start) >= '2011' AND T2.type = 'sen' AND T2.caucus = 'Democrat'
Independent refers to party = 'Independent'; senators refers to type = 'sen'; started the term in 2011 and onwards refers to strftime('%Y', start) > = '2011'; caucused with the Democrat refers to caucus = 'Democrat';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
How many Jewish legislators do not have facebook?
SELECT COUNT(T3.bioguide_id) FROM ( SELECT T1.bioguide_id FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.facebook IS NULL GROUP BY T1.bioguide_id ) T3
Jewish legislators refers to religion_bio = 'Jewish'; do not have facebook refers to facebook is null;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Which party has the highest number of legislators who are Baptist?
SELECT T2.party FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.religion_bio = 'Baptist' GROUP BY T2.party ORDER BY COUNT(T2.party) DESC LIMIT 1
party that has the highest number of legislators refers to MAX(COUNT(party)); Baptist refers to religion_bio = 'Baptist';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
List the official full names of all the legislators who have facebook, instagram, twitter and youtube accounts.
SELECT T1.official_full_name FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.facebook IS NOT NULL AND T2.instagram IS NOT NULL AND T2.twitter IS NOT NULL AND T2.youtube IS NOT NULL
have facebook, instagram, twitter and youtube accounts refers to 'facebook' is not null AND 'instagram' is not null AND 'twitter' is not null AND 'youtube' is not null;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
How many districts did John Conyers, Jr. serve in total?
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
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What are the Wikipedia page names of all the anti-administration senators?
SELECT T1.wikipedia_id FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.type = 'sen' AND T2.party = 'Anti-Administration'
Wikipedia page names refers to wikipedia_id; anti-administration refers to party = 'Anti-Administration'; senators refers to type = 'sen';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
List the official full names of all the legislators that served 13 district for 26 consecutive years.
SELECT DISTINCT CASE WHEN SUM(CAST(strftime('%Y', T2.end) AS int) - CAST(strftime('%Y', T2.start) AS int)) = 26 THEN T1.official_full_name END FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide GROUP BY T1.official_full_name, T2.district HAVING COUNT(T1.official_full_name) = 13
served only one district for 26 consecutive years refers to SUBTRACT(SUM(cast(strftime('%Y', end)), CAST(strftime('%Y', start)))) = 26
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
How many Federalist representatives are there whose first names are Benjamin?
SELECT COUNT(T.bioguide_id) FROM ( SELECT T1.bioguide_id FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name = 'Benjamin' AND T2.party = 'Federalist' AND T2.type = 'rep' GROUP BY T1.bioguide_id ) AS T
Federalist refers to party = 'Federalist'; representatives refers to type = 'rep';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
How many female representatives served in the state of California for at least 10 years?
SELECT SUM(T3.result) FROM ( SELECT CASE WHEN SUM(CAST(strftime('%Y', T2.`end`) AS int) - CAST(strftime('%Y', T2.start) AS int)) > 10 THEN 1 ELSE 0 END AS result FROM current AS T1 INNER JOIN "current-terms" AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'F' AND T2.state = 'CA' AND T2.type = 'rep' ) AS T3
female refers to gender_bio = 'F'; representatives refers to type = 'rep'; served for at least 10 years refers to SUBTRACT(SUM(CAST(strftime('%Y', end)), CAST(strftime('%Y', start)))) > 10;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the party of the oldest legislator?
SELECT T1.party FROM `historical-terms` AS T1 INNER JOIN historical AS T2 ON T2.bioguide_id = T1.bioguide ORDER BY T2.birthday_bio LIMIT 1
oldest legislator refers to MIN(birthday_bio);
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Who is the Lutheran representative that served in the state of Ohio for 14 years before becoming a senator?
SELECT CASE WHEN SUM(CAST(strftime('%Y', T2.end) AS int) - CAST(strftime('%Y', T2.start) AS int)) = 14 THEN official_full_name END FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.religion_bio = 'Lutheran' AND T2.state = 'OH' AND T2.type = 'rep'
Lutheran refers to religion_bio = 'Lutheran'; representative refers to type = 'rep'; served for 14 years refers to SUBTRACT(SUM(CAST(strftime('%Y', end)), CAST(strftime('%Y', start)))) = 14;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Among all the current legislators born after the year 1960, how many of them are not google entities?
SELECT COUNT(*) FROM current WHERE strftime('%Y', birthday_bio) > '1960' AND google_entity_id_id IS NULL
born after the year 1960 refers to strftime('%Y', birthday_bio) > '1960'; not google entities refers to google_entity_id_id is null;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Please list the official full names of all the current legislators who have served in the U.S. House.
SELECT official_full_name FROM current WHERE house_history_id IS NOT NULL
have served in the U.S. House refers to house_history_id is not null;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
How many current legislators have both accounts on both VoteView.com and maplight.org?
SELECT COUNT(*) FROM current WHERE icpsr_id IS NOT NULL AND maplight_id IS NOT NULL
have both accounts on both VoteView.com and maplight.org refers to icpsr_id is not null AND maplight_id is not null;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Among all the current female legislators, how many of them have attended in Senate roll call votes?
SELECT COUNT(lis_id) FROM current WHERE gender_bio = 'F' AND lis_id IS NOT NULL
female refers to gender_bio = 'F'; have attended in Senate roll call votes refers to lis_id is not null;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the religion of current legislator Sherrod Brown?
SELECT religion_bio FROM current WHERE official_full_name = 'Sherrod Brown'
religion refers to religion_bio;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the religion with the most occurrrence of the current legislators?
SELECT religion_bio FROM current GROUP BY religion_bio ORDER BY COUNT(religion_bio) DESC LIMIT 1
religion with the most occurrrence of the current legislators refers to MAX(count(religion_bio));
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the current official Instagram handle of current legislator Bob Corker?
SELECT T2.instagram FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'Bob Corker'
official Instagram handle refers to instagram;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Among the current legislators who have accounts on both http://thomas.gov, how many of them have accounts on instagram?
SELECT COUNT(DISTINCT T1.bioguide_id) FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.thomas_id IS NOT NULL AND T2.instagram IS NOT NULL
have accounts on both http://thomas.gov refers to thomas_id is NOT null; have accounts on instagram refers to instagram is not null;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Please list the username of the current official Facebook presence of all the current legislators that are famous or impact.
SELECT T2.facebook FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.wikipedia_id IS NOT NULL GROUP BY T2.facebook
username of the current official Facebook presence of the legislators refers to facebook; legislators that are famous or impact refers to wikipedia_id is not null;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
For how many terms have the oldest current legislator served?
SELECT COUNT(T2.bioguide) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.birthday_bio = ( SELECT MIN(birthday_bio) FROM current )
oldest legislator refers to MIN(birthday_bio);
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What was current legislator Sherrod Brown's Washington, D.C. office phone number during his term starting on 2013/1/3?
SELECT T1.phone FROM `current-terms` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.official_full_name = 'Sherrod Brown' AND T1.start = '2013-01-03'
Washington, DC office phone number refers to phone; terms starting on 2013/1/3 refers to start = '2013-01-03';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Current legislator Sherrod Brown has been in the Democrat party during how many terms that he has served?
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.party = 'Democrat'
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Please list the full official names of all the current legislators who served the term that started on 2013/1/3.
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'
term that started on 2013/1/3 refers to start = '2013-01-03';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
Among the current legislators who served the term starting on 2013/1/3, how many of them are female?
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'
term starting on 2013/1/3 refers to start = '2013-01-03; female refers to gender_bio = 'F';
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the full official name of the current legislator that has served for the most number of terms?
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
served for the most number of terms refers to MAX(COUNT(bioguide));
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
For how many terms has current legislator Sherrod Brown served as a representative for district no.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
district no. 13 refers to district = 13;
legislator
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
【DB_ID】 legislator 【Schema】 # Table: main.current [ (ballotpedia_id:TEXT, Examples: [Sherrod Brown, Maria Cantwell, Ben Cardin]), (bioguide_id:TEXT, Primary Key, Examples: [A000055, A000360, A000367]), (birthday_bio:DATE, Examples: [1952-11-09]), (cspan_id:REAL, Primary Key, Examples: [45516.0, 5.0, 1033767.0]), (fec_i...
What is the official full name of the current legislator whose current official Facebook presence is "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'
current official Facebook presence is "senjoniernst" refers to facebook = 'senjoniernst';