Chinastark/bird_dataset huggingface dataset:
Database: legislator
Question: How many legislators were born in 1736?
Evidence: born in 1736 refers to birthday_bio like '1736%';
SQL: SELECT COUNT(bioguide_id) FROM historical WHERE birthday_bio LIKE '1736%'
Database: legislator
Question: Which legislators are woman?
Evidence: woman refers to gender_bio = 'F';
SQL: SELECT first_name, last_name FROM historical WHERE gender_bio = 'F'
Database: legislator
Question: How many districts are in Idaho?
Evidence: Idaho refers to state = 'ID';
SQL: SELECT COUNT(district) FROM `current-terms` WHERE state = 'ID'
Database: legislator
Question: How many legislators are not senator?
Evidence: not senator refers to class is null;
SQL: SELECT COUNT(bioguide) FROM `current-terms` WHERE class IS NULL
Database: legislator
Question: What is the ratio between male and female legislators?
Evidence: ratio = DIVIDE(SUM(gender_bio = 'M'),  SUM(gender_bio = 'F')); male refers to gender_bio = 'M'; female refers to gender_bio = 'F'
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
Question: Calculate the percentage of famous_legislatorss.
Evidence: percentage = MULTIPLY(DIVIDE(SUM(wikipedia_id is not null), (bioguide_id)), 100.0); famous legislators refers to wikipedia_id is not null;
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
Question: Which legislators do not have instagram account?
Evidence: do not have instagram account refers to instagram is null;
SQL: 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
Database: legislator
Question: List all the representatives in 1789 along with the districts and state.
Evidence: representatives refers to type = 'rep'; in 1789 refers to start like '1789%';
SQL: 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%'
Database: legislator
Question: State all the district that Benjamin Contee has served before.
SQL: 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'
Database: legislator
Question: State the address of Amy Klobuchar at the term of 4th of January 2001.
Evidence: at the term of 4th of January 2001 refers to start = '2001-04-01';
SQL: 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'
Database: legislator
Question: List all the junior senators in 1997.
Evidence: junior senators refers to state_rank = 'junior'; in 1997 refers to start like '1997%';
SQL: 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'
Database: legislator
Question: How many female legislators become representatives for California in 2015?
Evidence: 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';
SQL: 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'
Database: legislator
Question: What is the Twitter ID of Emanuel Cleaver?
SQL: 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'
Database: legislator
Question: State all the Facebook ID for current legislators under the democrat party.
SQL: 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
Database: legislator
Question: Which historical female legislator that have their term ended on the 3rd of March 1791?
Evidence: female legislator refers to gender_bio = 'F'; term ended on the 3rd of March 1791 refers to end = '1791-03-03';
SQL: 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'
Database: legislator
Question: List all the Jewish current legislators that had served in Florida.
Evidence: Jewish refers to religion_bio = 'Jewish'; in Florida refers to state = 'FL';
SQL: 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
Database: legislator
Question: What is the ratio between famous current legislators and famous historical legislators?
Evidence: 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;
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
Question: Based on the number of current legislators, calculate the percentage of legislators that served in 21st-Century.
Evidence: 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';
SQL: 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
Database: legislator
Question: How many Catholic legislators do not have an account on ballotpedia.org?
Evidence: Catholic refers to religion_bio = 'Catholic'; do not have an account on ballotpedia.org refers to ballotpedia_id is null;
SQL: SELECT COUNT(bioguide_id) FROM historical WHERE religion_bio = 'Catholic' AND ballotpedia_id IS NULL
Database: legislator
Question: How many class 1 senators belong to the Republican party?
Evidence: senators refers to type = 'sen';
SQL: SELECT COUNT(bioguide) FROM `current-terms` WHERE class = 1 AND party = 'Republican'
Database: legislator
Question: What are the full names of the non-google female entity legislators that have not been registered in Federal Election Commission data?
Evidence: 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;
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
Question: In California, how many representatives ended their term in 1995?
Evidence: California refers to state = 'CA'; representatives refers to type = 'rep'; ended the term in 1995 refers to end like '1995%';
SQL: SELECT COUNT(*) FROM `current-terms` WHERE state = 'CA' AND type = 'rep' AND end LIKE '1995%'
Database: legislator
Question: What is the full name of the oldest legislator?
Evidence: full name = first_name, last_name; oldest legislator refers to MIN(birthday_bio);
SQL: SELECT first_name, last_name FROM historical ORDER BY birthday_bio LIMIT 1
Database: legislator
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?
Evidence: ids refers to bioguide; representatives refers to type = 'rep'; ended the term on 1/3/2019 refers to end = '2019-01-03';
SQL: SELECT bioguide FROM `current-terms` WHERE type = 'rep' AND party = 'Democrat' AND end = '2019-01-03' AND district = 13
Database: legislator
Question: What is the official Twitter handle of Jason Lewis?
Evidence: official Twitter handle refers to twitter;
SQL: 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'
Database: legislator
Question: 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?
Evidence: 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';
SQL: 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'
Database: legislator
Question: How many Jewish legislators do not have facebook?
Evidence: Jewish legislators refers to religion_bio = 'Jewish'; do not have facebook refers to facebook is null;
SQL: 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
Database: legislator
Question: Which party has the highest number of legislators who are Baptist?
Evidence: party that has the highest number of legislators refers to MAX(COUNT(party)); Baptist refers to religion_bio = 'Baptist';
SQL: 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
Database: legislator
Question: List the official full names of all the legislators who have facebook, instagram, twitter and youtube accounts.
Evidence: 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;
SQL: 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
Database: legislator
Question: How many districts did John Conyers, Jr. serve in total?
SQL: 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
Database: legislator
Question: What are the Wikipedia page names of all the anti-administration senators?
Evidence: Wikipedia page names refers to wikipedia_id; anti-administration refers to party = 'Anti-Administration'; senators refers to type = 'sen';
SQL: 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'
Database: legislator
Question: List the official full names of all the legislators that served 13 district for 26 consecutive years.
Evidence: served only one district for 26 consecutive years refers to SUBTRACT(SUM(cast(strftime('%Y', end)), CAST(strftime('%Y', start)))) = 26
SQL: 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
Database: legislator
Question: How many Federalist representatives are there whose first names are Benjamin?
Evidence: Federalist refers to party = 'Federalist'; representatives refers to type = 'rep';
SQL: 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
Database: legislator
Question: How many female representatives served in the state of California for at least 10 years?
Evidence: 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;
SQL: 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
Database: legislator
Question: What is the party of the oldest legislator?
Evidence: oldest legislator refers to MIN(birthday_bio);
SQL: 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
Database: legislator
Question: Who is the Lutheran representative that served in the state of Ohio for 14 years before becoming a senator?
Evidence: 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;
SQL: 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'
Database: legislator
Question: Among all the current legislators born after the year 1960, how many of them are not google entities?
Evidence: born after the year 1960 refers to strftime('%Y', birthday_bio) > '1960'; not google entities refers to google_entity_id_id is null;
SQL: SELECT COUNT(*) FROM current WHERE strftime('%Y', birthday_bio) > '1960' AND google_entity_id_id IS NULL
Database: legislator
Question: Please list the official full names of all the current legislators who have served in the U.S. House.
Evidence: have served in the U.S. House refers to house_history_id is not null;
SQL: SELECT official_full_name FROM current WHERE house_history_id IS NOT NULL
Database: legislator
Question: How many current legislators have both accounts on both VoteView.com and maplight.org?
Evidence: have both accounts on both VoteView.com and maplight.org refers to icpsr_id is not null AND maplight_id is not null;
SQL: SELECT COUNT(*) FROM current WHERE icpsr_id IS NOT NULL AND maplight_id IS NOT NULL
Database: legislator
Question: Among all the current female legislators, how many of them have attended in Senate roll call votes?
Evidence: female refers to gender_bio = 'F'; have attended in Senate roll call votes refers to lis_id is not null;
SQL: SELECT COUNT(lis_id) FROM current WHERE gender_bio = 'F' AND lis_id IS NOT NULL
Database: legislator
Question: What is the religion of current legislator Sherrod Brown?
Evidence: religion refers to religion_bio;
SQL: SELECT religion_bio FROM current WHERE official_full_name = 'Sherrod Brown'
Database: legislator
Question: What is the religion with the most occurrrence of the current legislators?
Evidence: religion with the most occurrrence of the current legislators refers to MAX(count(religion_bio));
SQL: SELECT religion_bio FROM current GROUP BY religion_bio ORDER BY COUNT(religion_bio) DESC LIMIT 1
Database: legislator
Question: What is the current official Instagram handle of current legislator Bob Corker?
Evidence: official Instagram handle refers to instagram;
SQL: 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'
Database: legislator
Question: Among the current legislators who have accounts on both http://thomas.gov, how many of them have accounts on instagram?
Evidence: have accounts on both http://thomas.gov refers to thomas_id is NOT null; have accounts on instagram refers to instagram is not null;
SQL: 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
Database: legislator
Question: Please list the username of the current official Facebook presence of all the current legislators that are famous or impact.
Evidence: 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;
SQL: 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
Database: legislator
Question: For how many terms have the oldest current legislator served?
Evidence: oldest legislator refers to MIN(birthday_bio);
SQL: 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 )
Database: legislator
Question: What was current legislator Sherrod Brown's Washington, D.C. office phone number during his term starting on 2013/1/3?
Evidence: Washington, DC office phone number refers to phone; terms starting on 2013/1/3 refers to start = '2013-01-03';
SQL: 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'
Database: legislator
Question: Current legislator Sherrod Brown has been in the Democrat party during how many terms that he has served?
SQL: 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'
Database: legislator
Question: Please list the full official names of all the current legislators who served the term that started on 2013/1/3.
Evidence: term that started on 2013/1/3 refers to start = '2013-01-03';
SQL: 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'
Database: legislator
Question: Among the current legislators who served the term starting on 2013/1/3, how many of them are female?
Evidence: term starting on 2013/1/3 refers to start = '2013-01-03; female refers to gender_bio = 'F';
SQL: 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'
Database: legislator
Question: What is the full official name of the current legislator that has served for the most number of terms?
Evidence: served for the most number of terms refers to MAX(COUNT(bioguide));
SQL: 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
Database: legislator
Question: For how many terms has current legislator Sherrod Brown served as a representative for district no.13?
Evidence: district no. 13 refers to district = 13;
SQL: 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
Database: legislator
Question: What is the official full name of the current legislator whose current official Facebook presence is "senjoniernst"?
Evidence: current official Facebook presence is "senjoniernst" refers to facebook = 'senjoniernst';
SQL: 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'
Database: legislator
Question: Which current legislator has served for more terms, Sherrod Brown or Maria Cantwell?
Evidence: if sum(official_full_name = 'Maria Cantwell') > sum(official_full_name = 'Sherrod Brown') then Maria Cantwell has served for more term than Sherrod Brown; if sum(official_full_name = 'Sherrod Brown') > sum(official_full_name = 'Maria Cantwell'), then Sherrod Brown has served for more terms than Maria Cantwell;
SQL: SELECT CASE WHEN SUM(CASE WHEN T1.official_full_name = 'Maria Cantwell' THEN 1 ELSE 0 END) > SUM(CASE WHEN T1.official_full_name = 'Sherrod Brown' THEN 1 ELSE 0 END) THEN 'Maria Cantwell' ELSE 'Sherrod Brown' END FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide
Database: legislator
Question: Among all the current legislators who have served for more than 4 terms, what is the percentage of them being female?
Evidence: have served for more than 4 years refers to count(bioguide) > 4; percentage = MULTIPLY(DIVIDE(SUM(gender_bio = 'F'), count(bioguide)), 100.0); female refers to gender_bio = 'F'
SQL: SELECT CAST(SUM(CASE WHEN gender_bio = 'F' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.bioguide) FROM ( SELECT T2.bioguide, T1.gender_bio FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide GROUP BY T2.bioguide HAVING COUNT(T2.bioguide) > 4 ) T3
Database: legislator
Question: What is the average number of terms served for a current legislator that's famous or impact?
Evidence: average = DIVIDE(COUNT(bioguide), COUNT(bioguide_id)); legislator that's famous or impact refers to wikipedia_id is not null;
SQL: SELECT CAST(COUNT(T2.bioguide) AS REAL) / COUNT(DISTINCT T1.bioguide_id) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.wikipedia_id IS NOT NULL
Database: legislator
Question: How many of the legislators are female?
Evidence: female refers to gender_bio = 'F';
SQL: SELECT COUNT(gender_bio) FROM current WHERE gender_bio = 'F'
Database: legislator
Question: What is the total number of senators New Jersey have?
Evidence: senators refers to type = 'rep'; New Jersey refers to state = 'NJ';
SQL: SELECT COUNT(type) FROM `historical-terms` WHERE state = 'NJ' AND type = 'rep'
Database: legislator
Question: Provide the Instagram username of the legislator named Benjamin Hawkins.
Evidence: Instagram username refers to instagram;
SQL: SELECT T1.instagram FROM `social-media` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.first_name = 'Benjamin' AND T2.last_name = 'Hawkins'
Database: legislator
Question: Give the alphanumeric ID of the Catholic legislators in Nebraska.
Evidence: alphanumeric ID refers to bioguide; Catholic legislators refers to religion_bio = 'Catholic'; Nebraska refers to state = 'NE';
SQL: SELECT T1.bioguide FROM `current-terms` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.religion_bio = 'Catholic' AND T1.state = 'NE'
Database: legislator
Question: List down the MapLight ID of the representatives in Maine.
Evidence: representatives refers to type = 'rep'; Maine refers to state = 'ME';
SQL: SELECT T1.maplight_id FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.type = 'rep' AND T2.state = 'ME' GROUP BY T1.maplight_id
Database: legislator
Question: Give the type and start date of the term of the legislator born on November 26, 1727.
Evidence: start date of the term refers to start; born on November 26, 1727 refers to birthday_bio = '1727-11-26';
SQL: SELECT T2.type, T2.start FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.birthday_bio = '1727-11-26'
Database: legislator
Question: What is the contact form of the legislator named Rick Crawford?
SQL: SELECT T2.contact_form FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'Rick Crawford'
Database: legislator
Question: How many female representatives are there in Michigan?
Evidence: female refers to gender_bio = 'F'; representatives refers to type = 'rep'; Michigan refers to state = 'MI';
SQL: SELECT COUNT(T.bioguide_id) FROM ( SELECT T1.bioguide_id FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.type = 'rep' AND T2.state = 'MI' AND T1.gender_bio = 'F' GROUP BY T1.bioguide_id ) T