db_id
stringclasses 69
values | question
stringlengths 24
325
| evidence
stringlengths 0
673
| SQL
stringlengths 23
804
| question_id
int64 0
9.43k
| difficulty
stringclasses 1
value |
---|---|---|---|---|---|
legislator
|
List the IDs and full names of legislators from the Liberal Republican party.
|
full_name refers to first_name, last_name; from the Liberal Republican party refers to party = 'Liberal Republican'
|
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'
| 4,800 | |
legislator
|
Among the legislators who started a term on 2nd December 1793, how many of them were males?
|
started a term on 2nd December 1793 refers to start = '1793-12-02'; male refers to gender_bio = 'M'
|
SELECT COUNT(T1.bioguide_id) FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'M' AND T2.start = '1793-12-02'
| 4,801 | |
legislator
|
Compare the number of legislators who started the term in 1875 and 2005.
|
started the term in 1875 refers to start LIKE '1875%'; started the term in 2005 refers to start LIKE '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`
| 4,802 | |
legislator
|
List the full names, Twitter IDs, and YouTube IDs of legislators who have Richard as their first name.
|
full names refers to official_full_name; Richard as their first name refers to first_name = 'Richard'
|
SELECT T2.official_full_name, T1.twitter_id, T1.youtube_id FROM `social-media` AS T1 INNER JOIN current AS T2 ON T1.bioguide = T2.bioguide_id WHERE T2.first_name = 'Richard'
| 4,803 | |
legislator
|
Provide the start date, end date, and party of Pearl Peden 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
|
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'
| 4,804 | |
legislator
|
What is the birthday of Amy Klobuchar?
|
birthday refers to birthday_bio; Amy Klobuchar refers to full name; full name refers to first_name, last_name
|
SELECT birthday_bio FROM current WHERE first_name = 'Amy' AND last_name = 'Klobuchar'
| 4,805 | |
legislator
|
How many legislators have not been registered in Federal Election Commission data?
|
have not been registered in Federal Election Commission data refers to fec_id is null OR fec_id = ''
|
SELECT COUNT(*) FROM current WHERE fec_id IS NULL OR fec_id = ''
| 4,806 | |
legislator
|
State the number of female legislators in the list.
|
female refers to gender_bio = 'F'
|
SELECT COUNT(*) FROM current WHERE gender_bio = 'F'
| 4,807 | |
legislator
|
Give the full name of legislators who have accounts on OpenSecrets.org.
|
full name refers to first_name, last_name; have accounts on OpenSecrets.org refers to opensecrets_id IS NOT NULL AND opensecrets_id <> ''
|
SELECT COUNT(*) FROM current WHERE opensecrets_id IS NOT NULL AND opensecrets_id <> ''
| 4,808 | |
legislator
|
What is the middle name of the legislator whose birthday was on 8/24/1956?
|
birthday was on 8/24/1956 refers to birthday_bio = '1956-08-24'
|
SELECT middle_name FROM current WHERE birthday_bio = '1956-08-24'
| 4,809 | |
legislator
|
How many legislators hold the title "Majority Leader"?
|
SELECT COUNT(bioguide) FROM `current-terms` WHERE title = 'Majority Leader'
| 4,810 | ||
legislator
|
What is the title of legislator whose birthday on 2/20/1942?
|
birthday on 2/20/1942 refers to birthday_bio = '1942-02-20'
|
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
| 4,811 | |
legislator
|
What is the gender of the legislator whose address at 317 Russell Senate Office Building Washington DC 20510?
|
gender refers to gender_bio
|
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'
| 4,812 | |
legislator
|
List out the first name of legislators who are senior Senator.
|
senior refers to state_rank = 'senior'; only senator has this value 'senior'
|
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
| 4,813 | |
legislator
|
Among male legislators, state number of the legislators who are not the senator.
|
male refers to gender_bio = M; not the senator refers to class IS NULL OR class = ''
|
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
| 4,814 | |
legislator
|
Calculate the percentage of legislators who are Senator and were born in 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)
|
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%'
| 4,815 | |
legislator
|
Calculate the percentage of legislators who are not Senator and were born before 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)
|
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
| 4,816 | |
legislator
|
What is the twitter name of the legislator whose birthday was on 5/27/1946?
|
birthday on 5/27/1946 refers to birthday_bio = '1946-05-27'
|
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'
| 4,817 | |
legislator
|
State the opensecrets_id of the legislator whose YouTube name is Bluetkemeyer.
|
Bluetkemeyer refers to youtube
|
SELECT T1.opensecrets_id FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T2.youtube = 'BLuetkemeyer'
| 4,818 | |
legislator
|
Mention the username of Facebook of Ralph Abraham.
|
username of Facebook refers to facebook; Ralph Abraham is an official_full_name; official_full_name refers to first_name, last_name
|
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'
| 4,819 | |
legislator
|
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
| 4,820 | ||
legislator
|
What is the Instagram name of the legislator whose birthday was on 8/24/1952?
|
Instagram name refers to instagram; birthday on 8/24/1952 refers to birthday_bio = '1952-08-24'
|
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'
| 4,821 | |
legislator
|
State number of legislators who are not the senator among female legislators.
|
not the senator refers to class IS NULL OR class = ''; female refers to gender_bio = 'F';
|
SELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'F' AND (T2.class IS NULL OR T2.class = '')
| 4,822 | |
legislator
|
Give the religion of the legislator whose YouTube name is MaxineWaters.
|
MaxineWaters relates to youtube
|
SELECT T2.religion_bio FROM `social-media` AS T1 INNER JOIN current AS T2 ON T1.bioguide = T2.bioguide_id WHERE T1.youtube = 'MaxineWaters'
| 4,823 | |
legislator
|
How many minority leaders have not been registered in Federal Election Commission data?
|
minority leaders is a title; have not been registered in Federal Election Commission data refers to fec_id IS NULL OR fec_id = ''
|
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 = '')
| 4,824 | |
legislator
|
How many of the legislators are male?
|
male refers to gender_bio = 'M';
|
SELECT COUNT(*) FROM current WHERE gender_bio = 'M'
| 4,825 | |
legislator
|
Provide the facebook ID of the facebook account named "RepWilson".
|
SELECT facebook_id FROM `social-media` WHERE facebook = 'RepWilson'
| 4,826 | ||
legislator
|
What is the total number of legislators with "John" as their first name?
|
SELECT COUNT(*) FROM current WHERE first_name = 'John'
| 4,827 | ||
legislator
|
Give the district numbers with an Anti-Administration party.
|
SELECT district FROM `historical-terms` WHERE party = 'Anti-Administration' GROUP BY district
| 4,828 | ||
legislator
|
List the full name of legislators whose born in 1960.
|
full name refers to official_full_name; born in 1960 refers to birthday_bio like '1960%';
|
SELECT official_full_name FROM current WHERE birthday_bio LIKE '1960%'
| 4,829 | |
legislator
|
What is the google entity ID of Benjamin Hawkins?
|
SELECT google_entity_id_id FROM historical WHERE first_name = 'Benjamin' AND last_name = 'Hawkins'
| 4,830 | ||
legislator
|
Who is the Pro-Administration senator that runs from March 4, 1789 to December 31, 1791?
|
Pro-Administration refers to party = 'Pro-Administration'; senator refers to type = 'sen'; runs from March 4, 1789 refers to start = '1789-03-04'; runs to refers to end = '1791-12-31';
|
SELECT T1.first_name, T1.last_name FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.party = 'Pro-Administration' AND T2.start = '1789-03-04' AND T2.end = '1791-12-31'
| 4,831 | |
legislator
|
What are the first and last name of the representatives of the house in district 9?
|
representatives refers to type = 'rep';
|
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
| 4,832 | |
legislator
|
Give the full name of the legislators with an independent party.
|
full name refers to official_full_name;
|
SELECT T1.official_full_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.party = 'Independent' GROUP BY T1.official_full_name
| 4,833 | |
legislator
|
List down the open secrets and thomas ID of the democrat senators of New Jersey.
|
open secrets refers to opensecrets_id; democrat refers to party = democrat; senators refers to type = 'sen'; New Jersey refers to state = 'NJ';
|
SELECT T1.opensecrets_id, T1.thomas_id FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.type = 'sen' AND T2.state = 'NJ' GROUP BY T1.opensecrets_id, T1.thomas_id
| 4,834 | |
legislator
|
Provide the google entity ID of the senators in New York.
|
google entity ID refers to google_entity_id_id; senators refers to type = 'sen'; New York refers to state = 'NY';
|
SELECT T1.google_entity_id_id FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.type = 'sen' AND T2.state = 'NY'
| 4,835 | |
legislator
|
Give the religion of the legislator with RSS url of http://www.corker.senate.gov/public/index.cfm/rss/feed.
|
religion refers to religion_bio;
|
SELECT T1.religion_bio FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.rss_url = 'http://www.corker.senate.gov/public/index.cfm/rss/feed' GROUP BY T1.religion_bio
| 4,836 | |
legislator
|
What is the party of the legislator named Susan M. Collins?
|
legislator's name refers to offical_full_name;
|
SELECT T2.party FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'Susan M. Collins' GROUP BY T2.party
| 4,837 | |
legislator
|
List down the district number of the representative of the house named Jonathan Grout.
|
district number refers to district; representative of the house refers to type = 'rep';
|
SELECT T2.district FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.last_name = 'Grout' AND T1.first_name = 'Jonathan' AND T2.type = 'rep'
| 4,838 | |
legislator
|
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
| 4,839 | ||
legislator
|
Provide the full name and birth date of the legislator with a contact form of http://www.brown.senate.gov/contact/.
|
full name refers to official_full_name; birth date refers to birthday_bio;
|
SELECT T1.official_full_name, T1.birthday_bio FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.contact_form = 'http://www.brown.senate.gov/contact/'
| 4,840 | |
legislator
|
Give the state and type of term of the legislator with the google entity ID of kg:/m/02pyzk.
|
type of term refers to type; google entity ID refers to google_entity_id_id; google_entity_id_id = 'kg:/m/02pyzk';
|
SELECT T2.state, T2.type FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.google_entity_id_id = 'kg:/m/02pyzk'
| 4,841 | |
legislator
|
Provide the type and end date of the term of the legislator named John Vining.
|
end date of the term refers to end;
|
SELECT T2.type, T2.end FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name = 'John' AND T1.last_name = 'Vining'
| 4,842 | |
legislator
|
Find the difference between the number of female senators and representatives born between 1930 to 1970.
|
difference = SUBTRACT(SUM(type = 'sen' WHERE gender_bio = 'F' AND strftime('%Y', birthday_bio) between '1930' and '1970'), SUM(type = 'rep' WHERE gender_bio = 'F' AND strftime('%Y', birthday_bio) between '1930' and '1970')); female refers to gender_bio = 'F'; senators refers to type = 'sen'; representatives refers to type = 'rep'; born between 1930 to 1970 strftime('%Y', birthday_bio) between '1930' and '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'
| 4,843 | |
legislator
|
Among the male legislators born between 1955 to 1965, what is the percentage of the legislators with an independent party?
|
male refers to gender_bio = 'M'; born between 1955 to 1965 refers to strftime('%Y', birthday_bio) between '1955' and '1965'; percentage = MULTIPLY(DIVIDE(SUM(party = 'Independent' WHERE gender_bio = 'M' AND strftime('%Y', birthday_bio) between '1955' and '1965'), COUNT(party WHERE gender_bio = 'M' AND strftime('%Y', birthday_bio) between '1955' and '1965')), 100.0);
|
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'
| 4,844 | |
legislator
|
What is the name of the legislator with the ID of W000059?
|
name of the legislator = first_name, last_name; ID of W000059 refers to bioguide_id = 'W000059';
|
SELECT first_name, last_name FROM historical WHERE bioguide_id = 'W000059'
| 4,845 | |
legislator
|
Does Thomas Carnes have an account on ballotpedia.org?
|
if first_name = 'Thomas' and last_name = 'Carnes' AND ballotpedia_id is null then Thomas Carnes doesn't have an account on ballotpedia.org; if first_name = 'Thomas' and last_name = 'Carnes' AND ballotpedia_id is NOT null then Thomas Carnes have an account on ballotpedia.org;
|
SELECT CASE WHEN ballotpedia_id IS NULL THEN 'doesn''t have' ELSE 'have' END AS HaveorNot FROM historical WHERE first_name = 'Thomas' AND last_name = 'Carnes'
| 4,846 | |
legislator
|
How many legislators were born in 1736?
|
born in 1736 refers to birthday_bio like '1736%';
|
SELECT COUNT(bioguide_id) FROM historical WHERE birthday_bio LIKE '1736%'
| 4,847 | |
legislator
|
Which legislators are woman?
|
woman refers to gender_bio = 'F';
|
SELECT first_name, last_name FROM historical WHERE gender_bio = 'F'
| 4,848 | |
legislator
|
How many districts are in Idaho?
|
Idaho refers to state = 'ID';
|
SELECT COUNT(district) FROM `current-terms` WHERE state = 'ID'
| 4,849 | |
legislator
|
How many legislators are not senator?
|
not senator refers to class is null;
|
SELECT COUNT(bioguide) FROM `current-terms` WHERE class IS NULL
| 4,850 | |
legislator
|
What is the ratio between male and female legislators?
|
ratio = DIVIDE(SUM(gender_bio = 'M'), SUM(gender_bio = 'F')); male refers to gender_bio = 'M'; female refers to gender_bio = 'F'
|
SELECT CAST(SUM(CASE WHEN gender_bio = 'M' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN gender_bio = 'F' THEN 1 ELSE 0 END) FROM historical
| 4,851 | |
legislator
|
Calculate the percentage of famous_legislatorss.
|
percentage = MULTIPLY(DIVIDE(SUM(wikipedia_id is not null), (bioguide_id)), 100.0); famous legislators refers to wikipedia_id is not null;
|
SELECT CAST(SUM(CASE WHEN wikipedia_id IS NOT NULL THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(bioguide_id) FROM historical
| 4,852 | |
legislator
|
Which legislators do not have instagram account?
|
do not have instagram account refers to instagram is null;
|
SELECT T1.first_name, T1.last_name FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.instagram IS NULL
| 4,853 | |
legislator
|
List all the representatives in 1789 along with the districts and state.
|
representatives refers to type = 'rep'; in 1789 refers to start like '1789%';
|
SELECT T2.district, T2.state FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.start LIKE '1789%'
| 4,854 | |
legislator
|
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'
| 4,855 | ||
legislator
|
State the address of Amy Klobuchar at the term of 4th of January 2001.
|
at the term of 4th of January 2001 refers to start = '2001-04-01';
|
SELECT T2.address FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name = 'Amy' AND T1.last_name = 'Klobuchar' AND T2.start = '2001-04-01'
| 4,856 | |
legislator
|
List all the junior senators in 1997.
|
junior senators refers to state_rank = 'junior'; in 1997 refers to start like '1997%';
|
SELECT T1.first_name, T1.last_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.start LIKE '1997%' AND T2.state_rank = 'junior'
| 4,857 | |
legislator
|
How many female legislators become representatives for California in 2015?
|
female legislators refers to gender_bio = 'F'; representatives refers to type = 'rep'; for California refers to state = 'CA'; in 2015 refers to the year of start date is '2015';
|
SELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE STRFTIME('%Y', T2.start) = '2015' AND T2.state = 'CA' AND T1.gender_bio = 'F'
| 4,858 | |
legislator
|
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'
| 4,859 | ||
legislator
|
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
| 4,860 | ||
legislator
|
Which historical female legislator that have their term ended on the 3rd of March 1791?
|
female legislator refers to gender_bio = 'F'; term ended on the 3rd of March 1791 refers to end = '1791-03-03';
|
SELECT T1.first_name, T1.last_name FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.end = '1791-03-03' AND T1.gender_bio = 'F'
| 4,861 | |
legislator
|
List all the Jewish current legislators that had served in Florida.
|
Jewish refers to religion_bio = 'Jewish'; in Florida refers to state = 'FL';
|
SELECT T1.first_name, T1.last_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.religion_bio = 'Jewish' AND T2.state = 'FL' GROUP BY T1.first_name, T1.last_name
| 4,862 | |
legislator
|
What is the ratio between famous current legislators and famous historical legislators?
|
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;
|
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
| 4,863 | |
legislator
|
Based on the number of current legislators, calculate the percentage of legislators that served in 21st-Century.
|
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';
|
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
| 4,864 | |
legislator
|
How many Catholic legislators do not have an account on ballotpedia.org?
|
Catholic refers to religion_bio = 'Catholic'; do not have an account on ballotpedia.org refers to ballotpedia_id is null;
|
SELECT COUNT(bioguide_id) FROM historical WHERE religion_bio = 'Catholic' AND ballotpedia_id IS NULL
| 4,865 | |
legislator
|
How many class 1 senators belong to the Republican party?
|
senators refers to type = 'sen';
|
SELECT COUNT(bioguide) FROM `current-terms` WHERE class = 1 AND party = 'Republican'
| 4,866 | |
legislator
|
What are the full names of the non-google female entity legislators that have not been registered in Federal Election Commission data?
|
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;
|
SELECT first_name, last_name FROM historical WHERE gender_bio = 'F' AND google_entity_id_id IS NULL AND fec_id IS NULL
| 4,867 | |
legislator
|
In California, how many representatives ended their term in 1995?
|
California refers to state = 'CA'; representatives refers to type = 'rep'; ended the term in 1995 refers to end like '1995%';
|
SELECT COUNT(*) FROM `current-terms` WHERE state = 'CA' AND type = 'rep' AND end LIKE '1995%'
| 4,868 | |
legislator
|
What is the full name of the oldest legislator?
|
full name = first_name, last_name; oldest legislator refers to MIN(birthday_bio);
|
SELECT first_name, last_name FROM historical ORDER BY birthday_bio LIMIT 1
| 4,869 | |
legislator
|
List all of the ids of the representatives belonging to the Democrat party in district 13 that ended their term on 1/3/2019?
|
ids refers to bioguide; representatives refers to type = 'rep'; ended the term on 1/3/2019 refers to end = '2019-01-03';
|
SELECT bioguide FROM `current-terms` WHERE type = 'rep' AND party = 'Democrat' AND end = '2019-01-03' AND district = 13
| 4,870 | |
legislator
|
What is the official Twitter handle of Jason Lewis?
|
official Twitter handle refers to twitter;
|
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'
| 4,871 | |
legislator
|
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?
|
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';
|
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'
| 4,872 | |
legislator
|
How many Jewish legislators do not have facebook?
|
Jewish legislators refers to religion_bio = 'Jewish'; do not have facebook refers to facebook is null;
|
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
| 4,873 | |
legislator
|
Which party has the highest number of legislators who are Baptist?
|
party that has the highest number of legislators refers to MAX(COUNT(party)); Baptist refers to religion_bio = '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
| 4,874 | |
legislator
|
List the official full names of all the legislators who have facebook, instagram, twitter and youtube accounts.
|
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;
|
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
| 4,875 | |
legislator
|
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
| 4,876 | ||
legislator
|
What are the Wikipedia page names of all the anti-administration senators?
|
Wikipedia page names refers to wikipedia_id; anti-administration refers to party = 'Anti-Administration'; senators refers to type = 'sen';
|
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'
| 4,877 | |
legislator
|
List the official full names of all the legislators that served 13 district for 26 consecutive years.
|
served only one district for 26 consecutive years refers to SUBTRACT(SUM(cast(strftime('%Y', end)), CAST(strftime('%Y', start)))) = 26
|
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
| 4,878 | |
legislator
|
How many Federalist representatives are there whose first names are Benjamin?
|
Federalist refers to party = 'Federalist'; representatives refers to type = 'rep';
|
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
| 4,879 | |
legislator
|
How many female representatives served in the state of California for at least 10 years?
|
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;
|
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
| 4,880 | |
legislator
|
What is the party of the oldest legislator?
|
oldest legislator refers to MIN(birthday_bio);
|
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
| 4,881 | |
legislator
|
Who is the Lutheran representative that served in the state of Ohio for 14 years before becoming a senator?
|
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;
|
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'
| 4,882 | |
legislator
|
Among all the current legislators born after the year 1960, how many of them are not google entities?
|
born after the year 1960 refers to strftime('%Y', birthday_bio) > '1960'; not google entities refers to google_entity_id_id is null;
|
SELECT COUNT(*) FROM current WHERE strftime('%Y', birthday_bio) > '1960' AND google_entity_id_id IS NULL
| 4,883 | |
legislator
|
Please list the official full names of all the current legislators who have served in the U.S. House.
|
have served in the U.S. House refers to house_history_id is not null;
|
SELECT official_full_name FROM current WHERE house_history_id IS NOT NULL
| 4,884 | |
legislator
|
How many current legislators have both accounts on both VoteView.com and maplight.org?
|
have both accounts on both VoteView.com and maplight.org refers to icpsr_id is not null AND maplight_id is not null;
|
SELECT COUNT(*) FROM current WHERE icpsr_id IS NOT NULL AND maplight_id IS NOT NULL
| 4,885 | |
legislator
|
Among all the current female legislators, how many of them have attended in Senate roll call votes?
|
female refers to gender_bio = 'F'; have attended in Senate roll call votes refers to lis_id is not null;
|
SELECT COUNT(lis_id) FROM current WHERE gender_bio = 'F' AND lis_id IS NOT NULL
| 4,886 | |
legislator
|
What is the religion of current legislator Sherrod Brown?
|
religion refers to religion_bio;
|
SELECT religion_bio FROM current WHERE official_full_name = 'Sherrod Brown'
| 4,887 | |
legislator
|
What is the religion with the most occurrrence of the current legislators?
|
religion with the most occurrrence of the current legislators refers to MAX(count(religion_bio));
|
SELECT religion_bio FROM current GROUP BY religion_bio ORDER BY COUNT(religion_bio) DESC LIMIT 1
| 4,888 | |
legislator
|
What is the current official Instagram handle of current legislator Bob Corker?
|
official Instagram handle refers to instagram;
|
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'
| 4,889 | |
legislator
|
Among the current legislators who have accounts on both http://thomas.gov, how many of them have accounts on instagram?
|
have accounts on both http://thomas.gov refers to thomas_id is NOT null; have accounts on instagram refers to instagram is not null;
|
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
| 4,890 | |
legislator
|
Please list the username of the current official Facebook presence of all the current legislators that are famous or impact.
|
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;
|
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
| 4,891 | |
legislator
|
For how many terms have the oldest current legislator served?
|
oldest legislator refers to MIN(birthday_bio);
|
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 )
| 4,892 | |
legislator
|
What was current legislator Sherrod Brown's Washington, D.C. office phone number during his term starting on 2013/1/3?
|
Washington, DC office phone number refers to phone; terms starting on 2013/1/3 refers to start = '2013-01-03';
|
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'
| 4,893 | |
legislator
|
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'
| 4,894 | ||
legislator
|
Please list the full official names of all the current legislators who served the term that started on 2013/1/3.
|
term that started on 2013/1/3 refers to start = '2013-01-03';
|
SELECT T1.official_full_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.start = '2013-01-03'
| 4,895 | |
legislator
|
Among the current legislators who served the term starting on 2013/1/3, how many of them are female?
|
term starting on 2013/1/3 refers to start = '2013-01-03; female refers to gender_bio = 'F';
|
SELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.start = '2013-01-03' AND T1.gender_bio = 'F'
| 4,896 | |
legislator
|
What is the full official name of the current legislator that has served for the most number of terms?
|
served for the most number of terms refers to MAX(COUNT(bioguide));
|
SELECT T1.official_full_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide GROUP BY T1.official_full_name, T2.bioguide ORDER BY COUNT(T2.bioguide) DESC LIMIT 1
| 4,897 | |
legislator
|
For how many terms has current legislator Sherrod Brown served as a representative for district no.13?
|
district no. 13 refers to district = 13;
|
SELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'Sherrod Brown' AND T2.district = 13
| 4,898 | |
legislator
|
What is the official full name of the current legislator whose current official Facebook presence is "senjoniernst"?
|
current official Facebook presence is "senjoniernst" refers to facebook = 'senjoniernst';
|
SELECT T1.official_full_name FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.facebook = 'senjoniernst'
| 4,899 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.