Chinastark/bird_dataset huggingface dataset:
Database: legislator
Note: full name refers to first_name, last_name; have accounts on OpenSecrets.org refers to opensecrets_id IS NOT NULL AND opensecrets_id <> '';
Question: Give the full name of legislators who have accounts on OpenSecrets.org.
SQL: SELECT count(*) FROM CURRENT WHERE opensecrets_id IS NOT NULL AND opensecrets_id <> ''
Database: legislator
Note: birthday was on 8/24/1956 refers to birthday_bio = '1956-08-24';
Question: What is the middle name of the legislator whose birthday was on 8/24/1956?
SQL: SELECT middle_name FROM CURRENT WHERE birthday_bio = '1956-08-24'
Database: legislator
Question: How many legislators hold the title "Majority Leader"?
SQL: SELECT count(bioguide) FROM `current-terms` WHERE title = 'Majority Leader'
Database: legislator
Note: birthday on 2/20/1942 refers to birthday_bio = '1942-02-20';
Question: What is the title of legislator whose birthday on 2/20/1942?
SQL: SELECT current-terms.title FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE CURRENT.birthday_bio = '1942-02-20' GROUP BY current-terms.title
Database: legislator
Note: gender refers to gender_bio;
Question: What is the gender of the legislator whose address at 317 Russell Senate Office Building Washington DC 20510?
SQL: SELECT CURRENT.gender_bio FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE current-terms.address = '317 Russell Senate Office Building Washington DC 20510'
Database: legislator
Note: senior refers to state_rank = 'senior'; only senator has this value 'senior';
Question: List out the first name of legislators who are senior Senator.
SQL: SELECT CURRENT.first_name FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE current-terms.state_rank = 'senior' GROUP BY CURRENT.first_name
Database: legislator
Note: male refers to gender_bio = M; not the senator refers to class IS NULL OR class = '';
Question: Among male legislators, state number of the legislators who are not the senator.
SQL: SELECT count(t3.state) FROM ( SELECT current-terms.state FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE CURRENT.gender_bio = 'M' AND (current-terms.class IS NULL OR current-terms.class = '') GROUP BY current-terms.state ) t3
Database: legislator
Note: 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);
Question: Calculate the percentage of legislators who are Senator and were born in 1964.
SQL: SELECT cast(sum(CASE WHEN current-terms.class IS NOT NULL THEN 1 ELSE 0 END) AS REAL) * 100 / count(*) FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE CURRENT.birthday_bio LIKE '%1964%'
Database: legislator
Note: 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);
Question: Calculate the percentage of legislators who are not Senator and were born before 1975.
SQL: SELECT cast(count(CASE WHEN current-terms.class IS NULL THEN CURRENT.bioguide_id ELSE NULL END) AS REAL) * 100 / count(CURRENT.bioguide_id) FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE cast(CURRENT.birthday_bio AS DATE) <= 1975
Database: legislator
Note: birthday on 5/27/1946 refers to birthday_bio = '1946-05-27';
Question: What is the twitter name of the legislator whose birthday was on 5/27/1946?
SQL: SELECT social-media.twitter FROM CURRENT INNER JOIN `social-media` ON social-media.bioguide = CURRENT.bioguide_id WHERE CURRENT.birthday_bio = '1946-05-27'
Database: legislator
Note: Bluetkemeyer refers to youtube;
Question: State the opensecrets_id of the legislator whose YouTube name is Bluetkemeyer.
SQL: SELECT CURRENT.opensecrets_id FROM CURRENT INNER JOIN `social-media` ON social-media.bioguide = CURRENT.bioguide_id WHERE social-media.youtube = 'BLuetkemeyer'
Database: legislator
Note: username of facebook refers to facebook; Ralph Abraham is an official_full_name; official_full_name refers to first_name, last_name;
Question: Mention the username of Facebook of Ralph Abraham.
SQL: SELECT social-media.facebook FROM CURRENT INNER JOIN `social-media` ON social-media.bioguide = CURRENT.bioguide_id WHERE CURRENT.first_name = 'Ralph' AND CURRENT.last_name = 'Abraham'
Database: legislator
Question: What is the first name of the legislator whose address at 1005 Longworth HOB; Washington DC 20515-1408?
SQL: SELECT CURRENT.first_name FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE current-terms.address = '1005 Longworth HOB Washington DC 20515-1408' GROUP BY CURRENT.first_name
Database: legislator
Note: instagram name refers to instagram; birthday on 8/24/1952 refers to birthday_bio = '1952-08-24';
Question: What is the Instagram name of the legislator whose birthday was on 8/24/1952?
SQL: SELECT social-media.instagram FROM `social-media` INNER JOIN CURRENT ON social-media.bioguide = CURRENT.bioguide_id WHERE CURRENT.birthday_bio = '1952-08-24'
Database: legislator
Note: not the senator refers to class IS NULL OR class = ''; female refers to gender_bio = 'F';
Question: State number of legislators who are not the senator among female legislators.
SQL: SELECT count(*) FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE CURRENT.gender_bio = 'F' AND (current-terms.class IS NULL OR current-terms.class = '')
Database: legislator
Note: MaxineWaters relates to youtube;
Question: Give the religion of the legislator whose YouTube name is MaxineWaters.
SQL: SELECT CURRENT.religion_bio FROM `social-media` INNER JOIN CURRENT ON social-media.bioguide = CURRENT.bioguide_id WHERE social-media.youtube = 'MaxineWaters'
Database: legislator
Note: minority leaders is a title; have not been registered in Federal Election Commission data refers to fec_id IS NULL OR fec_id = '';
Question: How many minority leaders have not been registered in Federal Election Commission data?
SQL: SELECT count(*) FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE current-terms.title = 'Minority Leader' AND (CURRENT.fec_id IS NULL OR CURRENT.fec_id = '')
Database: legislator
Note: male refers to gender_bio = 'M';
Question: How many of the legislators are male?
SQL: SELECT count(*) FROM CURRENT WHERE gender_bio = 'M'
Database: legislator
Question: Provide the facebook ID of the facebook account named "RepWilson".
SQL: SELECT facebook_id FROM `social-media` WHERE facebook = 'RepWilson'
Database: legislator
Question: What is the total number of legislators with "John" as their first name?
SQL: SELECT count(*) FROM CURRENT WHERE first_name = 'John'
Database: legislator
Question: Give the district numbers with an Anti-Administration party.
SQL: SELECT district FROM `historical-terms` WHERE party = 'Anti-Administration' GROUP BY district
Database: legislator
Note: full name refers to official_full_name; born in 1960 refers to birthday_bio like '1960%';
Question: List the full name of legislators whose born in 1960.
SQL: SELECT official_full_name FROM CURRENT WHERE birthday_bio LIKE '1960%'
Database: legislator
Question: What is the google entity ID of Benjamin Hawkins?
SQL: SELECT google_entity_id_id FROM historical WHERE first_name = 'Benjamin' AND last_name = 'Hawkins'
Database: legislator
Note: 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';
Question: Who is the Pro-Administration senator that runs from March 4, 1789 to December 31, 1791?
SQL: SELECT historical.first_name, historical.last_name FROM historical INNER JOIN `historical-terms` ON historical.bioguide_id = historical-terms.bioguide WHERE historical-terms.party = 'Pro-Administration' AND historical-terms.start = '1789-03-04' AND historical-terms.end = '1791-12-31'
Database: legislator
Note: representatives refers to type = 'rep';
Question: What are the first and last name of the representatives of the house in district 9?
SQL: SELECT historical.first_name, historical.last_name FROM `historical-terms` INNER JOIN historical ON historical.bioguide_id = historical-terms.bioguide WHERE historical-terms.district = 9
Database: legislator
Note: full name refers to official_full_name;
Question: Give the full name of the legislators with an independent party.
SQL: SELECT CURRENT.official_full_name FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE current-terms.party = 'Independent' GROUP BY CURRENT.official_full_name
Database: legislator
Note: open secrets refers to opensecrets_id; democrat refers to party = democrat; senators refers to type = 'sen'; New Jersey refers to state = 'NJ';
Question: List down the open secrets and thomas ID of the democrat senators of New Jersey.
SQL: SELECT CURRENT.opensecrets_id, CURRENT.thomas_id FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE current-terms.type = 'sen' AND current-terms.state = 'NJ' GROUP BY CURRENT.opensecrets_id, CURRENT.thomas_id
Database: legislator
Note: google entity ID refers to google_entity_id_id; senators refers to type = 'sen'; New York refers to state = 'NY';
Question: Provide the google entity ID of the senators in New York.
SQL: SELECT historical.google_entity_id_id FROM historical INNER JOIN `historical-terms` ON historical.bioguide_id = historical-terms.bioguide WHERE historical-terms.type = 'sen' AND historical-terms.state = 'NY'
Database: legislator
Note: religion refers to religion_bio;
Question: Give the religion of the legislator with RSS url of http://www.corker.senate.gov/public/index.cfm/rss/feed.
SQL: SELECT CURRENT.religion_bio FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE current-terms.rss_url = 'http://www.corker.senate.gov/public/index.cfm/rss/feed' GROUP BY CURRENT.religion_bio
Database: legislator
Note: legislator's name refers to offical_full_name;
Question: What is the party of the legislator named Susan M. Collins?
SQL: SELECT current-terms.party FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE CURRENT.official_full_name = 'Susan M. Collins' GROUP BY current-terms.party
Database: legislator
Note: district number refers to district; representative of the house refers to type = 'rep';
Question: List down the district number of the representative of the house named Jonathan Grout.
SQL: SELECT historical-terms.district FROM historical INNER JOIN `historical-terms` ON historical.bioguide_id = historical-terms.bioguide WHERE historical.last_name = 'Grout' AND historical.first_name = 'Jonathan' AND historical-terms.type = 'rep'
Database: legislator
Question: What is the party and state of the legislator that has an open secrets ID of N00003689 and thomas ID of 186?
SQL: SELECT current-terms.party, current-terms.state FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE CURRENT.opensecrets_id = 'N00003689' AND CURRENT.thomas_id = 186 GROUP BY current-terms.party, current-terms.state
Database: legislator
Note: full name refers to official_full_name; birth date refers to birthday_bio;
Question: Provide the full name and birth date of the legislator with a contact form of http://www.brown.senate.gov/contact/.
SQL: SELECT CURRENT.official_full_name, CURRENT.birthday_bio FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE current-terms.contact_form = 'http://www.brown.senate.gov/contact/'
Database: legislator
Note: type of term refers to type; google entity ID refers to google_entity_id_id; google_entity_id_id = 'kg:/m/02pyzk';
Question: Give the state and type of term of the legislator with the google entity ID of kg:/m/02pyzk.
SQL: SELECT historical-terms.state, historical-terms.type FROM historical INNER JOIN `historical-terms` ON historical.bioguide_id = historical-terms.bioguide WHERE historical.google_entity_id_id = 'kg:/m/02pyzk'
Database: legislator
Note: end date of the term refers to end;
Question: Provide the type and end date of the term of the legislator named John Vining.
SQL: SELECT historical-terms.type, historical-terms.end FROM historical INNER JOIN `historical-terms` ON historical.bioguide_id = historical-terms.bioguide WHERE historical.first_name = 'John' AND historical.last_name = 'Vining'
Database: legislator
Note: 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 type = 'rep'; born between 1930 to 1970 strftime('%Y', birthday_bio) between '1930' and '1970';
Question: Find the difference between the number of female senators and representatives born between 1930 to 1970.
SQL: SELECT sum(CASE WHEN historical-terms.type = 'sen' THEN 1 ELSE 0 END) - sum(CASE WHEN historical-terms.type = 'rep' THEN 1 ELSE 0 END) FROM historical INNER JOIN `historical-terms` ON historical.bioguide_id = historical-terms.bioguide WHERE historical.gender_bio = 'F' AND strftime('%Y', historical.birthday_bio) BETWEEN '1930' AND '1970'
Database: legislator
Note: 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', birthday_bio) between '1955' and '1965')), 100.0);
Question: Among the male legislators born between 1955 to 1965, what is the percentage of the legislators with an independent party?
SQL: SELECT cast(sum(CASE WHEN current-terms.party = 'Independent' THEN 1 ELSE 0 END) AS REAL) * 100 / count(current-terms.party) FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE CURRENT.gender_bio = 'M' AND strftime('%Y', CURRENT.birthday_bio) BETWEEN '1955' AND '1965'
Database: legislator
Note: name of the legislator = first_name, last_name; ID of W000059 refers to bioguide_id = 'W000059';
Question: What is the name of the legislator with the ID of W000059?
SQL: SELECT first_name, last_name FROM historical WHERE bioguide_id = 'W000059'
Database: legislator
Note: 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;
Question: Does Thomas Carnes have an account on ballotpedia.org?
SQL: 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'
Database: legislator
Note: born in 1736 refers to birthday_bio like '1736%';
Question: How many legislators were born in 1736?
SQL: SELECT count(bioguide_id) FROM historical WHERE birthday_bio LIKE '1736%'
Database: legislator
Note: woman refers to gender_bio = 'F';
Question: Which legislators are woman?
SQL: SELECT first_name, last_name FROM historical WHERE gender_bio = 'F'
Database: legislator
Note: Idaho refers to state = 'ID';
Question: How many districts are in Idaho?
SQL: SELECT count(district) FROM `current-terms` WHERE state = 'ID'
Database: legislator
Note: not senator refers to class is null;
Question: How many legislators are not senator?
SQL: SELECT count(bioguide) FROM `current-terms` WHERE CLASS IS NULL
Database: legislator
Note: ratio = DIVIDE(SUM(gender_bio = 'M'),  SUM(gender_bio = 'F')); male refers to gender_bio = 'M'; female refers to gender_bio = 'F';
Question: What is the ratio between male and female legislators?
SQL: 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
Database: legislator
Note: percentage = MULTIPLY(DIVIDE(SUM(wikipedia_id is not null), (bioguide_id)), 100.0); famous legislators refers to wikipedia_id is not null;
Question: Calculate the percentage of famous_legislatorss.
SQL: SELECT cast(sum(CASE WHEN wikipedia_id IS NOT NULL THEN 1 ELSE 0 END) AS REAL) * 100 / count(bioguide_id) FROM historical
Database: legislator
Note: do not have instagram account refers to instagram is null;
Question: Which legislators do not have instagram account?
SQL: SELECT CURRENT.first_name, CURRENT.last_name FROM CURRENT INNER JOIN `social-media` ON CURRENT.bioguide_id = social-media.bioguide WHERE social-media.instagram IS NULL
Database: legislator
Note: representatives refers to type = 'rep'; in 1789 refers to start like '1789%';
Question: List all the representatives in 1789 along with the districts and state.
SQL: SELECT historical-terms.district, historical-terms.state FROM historical INNER JOIN `historical-terms` ON historical.bioguide_id = historical-terms.bioguide WHERE historical-terms.start LIKE '1789%'
Database: legislator
Question: State all the district that Benjamin Contee has served before.
SQL: SELECT historical-terms.district FROM historical INNER JOIN `historical-terms` ON historical.bioguide_id = historical-terms.bioguide WHERE historical.first_name = 'Benjamin' AND historical.last_name = 'Contee'
Database: legislator
Note: at the term of 4th of January 2001 refers to start = '2001-04-01';
Question: State the address of Amy Klobuchar at the term of 4th of January 2001.
SQL: SELECT current-terms.address FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE CURRENT.first_name = 'Amy' AND CURRENT.last_name = 'Klobuchar' AND current-terms.start = '2001-04-01'
Database: legislator
Note: junior senators refers to state_rank = 'junior'; in 1997 refers to start like '1997%';
Question: List all the junior senators in 1997.
SQL: SELECT CURRENT.first_name, CURRENT.last_name FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE current-terms.start LIKE '1997%' AND current-terms.state_rank = 'junior'
Database: legislator
Note: 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';
Question: How many female legislators become representatives for California in 2015?
SQL: SELECT count(*) FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE strftime('%Y', current-terms.start) = '2015' AND current-terms.state = 'CA' AND CURRENT.gender_bio = 'F'
Database: legislator
Question: What is the Twitter ID of Emanuel Cleaver?
SQL: SELECT social-media.twitter_id FROM `social-media` INNER JOIN CURRENT ON CURRENT.bioguide_id = social-media.bioguide WHERE CURRENT.first_name = 'Emanuel' AND CURRENT.last_name = 'Cleaver'
Database: legislator
Question: State all the Facebook ID for current legislators under the democrat party.
SQL: SELECT social-media.facebook_id FROM `current-terms` INNER JOIN `social-media` ON current-terms.bioguide = social-media.bioguide WHERE current-terms.party = 'Democrat' GROUP BY social-media.facebook_id
Database: legislator
Note: female legislator refers to gender_bio = 'F'; term ended on the 3rd of March 1791 refers to end = '1791-03-03';
Question: Which historical female legislator that have their term ended on the 3rd of March 1791?
SQL: SELECT historical.first_name, historical.last_name FROM historical INNER JOIN `historical-terms` ON historical.bioguide_id = historical-terms.bioguide WHERE historical-terms.end = '1791-03-03' AND historical.gender_bio = 'F'
Database: legislator
Note: Jewish refers to religion_bio = 'Jewish'; in Florida refers to state = 'FL';
Question: List all the Jewish current legislators that had served in Florida.
SQL: SELECT CURRENT.first_name, CURRENT.last_name FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide WHERE CURRENT.religion_bio = 'Jewish' AND current-terms.state = 'FL' GROUP BY CURRENT.first_name, CURRENT.last_name
Database: legislator
Note: 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;
Question: What is the ratio between famous current legislators and famous historical legislators?
SQL: 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
Database: legislator
Note: 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';
Question: Based on the number of current legislators, calculate the percentage of legislators that served in 21st-Century.
SQL: SELECT cast(sum(CASE WHEN strftime('%Y', current-terms.start) BETWEEN '2000' AND '2017' THEN 1 ELSE 0 END) AS REAL) * 100 / count(CURRENT.bioguide_id) FROM CURRENT INNER JOIN `current-terms` ON CURRENT.bioguide_id = current-terms.bioguide
Database: legislator
Note: Catholic refers to religion_bio = 'Catholic'; do not have an account on ballotpedia.org refers to ballotpedia_id is null;
Question: How many Catholic legislators do not have an account on ballotpedia.org?
SQL: SELECT count(bioguide_id) FROM historical WHERE religion_bio = 'Catholic' AND ballotpedia_id IS NULL
Database: legislator
Note: senators refers to type = 'sen';
Question: How many class 1 senators belong to the Republican party?
SQL: SELECT count(bioguide) FROM `current-terms` WHERE CLASS = 1 AND party = 'Republican'
Database: legislator
Note: 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;
Question: What are the full names of the non-google female entity legislators that have not been registered in Federal Election Commission data?
SQL: SELECT first_name, last_name FROM historical WHERE gender_bio = 'F' AND google_entity_id_id IS NULL AND fec_id IS NULL
Database: legislator
Note: California refers to state = 'CA'; representatives refers to type = 'rep'; ended the term in 1995 refers to end like '1995%';
Question: In California, how many representatives ended their term in 1995?
SQL: SELECT count(*) FROM `current-terms` WHERE state = 'CA' AND TYPE = 'rep' AND END LIKE '1995%'
Database: legislator
Note: full name = first_name, last_name; oldest legislator refers to MIN(birthday_bio);
Question: What is the full name of the oldest legislator?
SQL: SELECT first_name, last_name FROM historical ORDER BY birthday_bio LIMIT 1
Database: legislator
Note: ids refers to bioguide; representatives refers to type = 'rep'; ended the term on 1/3/2019 refers to end = '2019-01-03';
Question: List all of the ids of the representatives belonging to the Democrat party in district 13 that ended their term on 1/3/2019?
SQL: SELECT bioguide FROM `current-terms` WHERE TYPE = 'rep' AND party = 'Democrat' AND END = '2019-01-03' AND district = 13
Database: legislator
Note: official twitter handle refers to twitter;
Question: What is the official Twitter handle of Jason Lewis?
SQL: SELECT social-media.twitter FROM CURRENT INNER JOIN `social-media` ON CURRENT.bioguide_id = social-media.bioguide WHERE CURRENT.official_full_name = 'Jason Lewis'