1sf/bird-sql-train-with-schema huggingface dataset:
Database: legislator
Tables: current, current-terms, historical, historical-terms, social-media
Columns (table index, column name): -1, *, 0, ballotpedia_id, 0, bioguide_id, 0, birthday_bio, 0, cspan_id, 0, fec_id, 0, first_name, 0, gender_bio, 0, google_entity_id_id, 0, govtrack_id, 0, house_history_id, 0, icpsr_id, 0, last_name, 0, lis_id, 0, maplight_id, 0, middle_name, 0, nickname_name, 0, official_full_name, 0, opensecrets_id, 0, religion_bio, 0, suffix_name, 0, thomas_id, 0, votesmart_id, 0, wikidata_id, 0, wikipedia_id, 1, address, 1, bioguide, 1, caucus, 1, chamber, 1, class, 1, contact_form, 1, district, 1, end, 1, fax, 1, last, 1, name, 1, office, 1, party, 1, party_affiliations, 1, phone, 1, relation, 1, rss_url, 1, start, 1, state, 1, state_rank, 1, title, 1, type, 1, url, 2, ballotpedia_id, 2, bioguide_id, 2, bioguide_previous_id, 2, birthday_bio, 2, cspan_id, 2, fec_id, 2, first_name, 2, gender_bio, 2, google_entity_id_id, 2, govtrack_id, 2, house_history_alternate_id, 2, house_history_id, 2, icpsr_id, 2, last_name, 2, lis_id, 2, maplight_id, 2, middle_name, 2, nickname_name, 2, official_full_name, 2, opensecrets_id, 2, religion_bio, 2, suffix_name, 2, thomas_id, 2, votesmart_id, 2, wikidata_id, 2, wikipedia_id, 3, address, 3, bioguide, 3, chamber, 3, class, 3, contact_form, 3, district, 3, end, 3, fax, 3, last, 3, middle, 3, name, 3, office, 3, party, 3, party_affiliations, 3, phone, 3, relation, 3, rss_url, 3, start, 3, state, 3, state_rank, 3, title, 3, type, 3, url, 4, bioguide, 4, facebook, 4, facebook_id, 4, govtrack, 4, instagram, 4, instagram_id, 4, thomas, 4, twitter, 4, twitter_id, 4, youtube, 4, youtube_id
Question: Which legislator has the YouTube channel 'RoskamIL06?' Write the official full name.
Evidence: YouTube channel 'RoskamIL06' refers to youtube = 'RoskamIL06';
SQL: SELECT T1.official_full_name FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T2.youtube = 'RoskamIL06'
Database: legislator
Tables: current, current-terms, historical, historical-terms, social-media
Columns (table index, column name): -1, *, 0, ballotpedia_id, 0, bioguide_id, 0, birthday_bio, 0, cspan_id, 0, fec_id, 0, first_name, 0, gender_bio, 0, google_entity_id_id, 0, govtrack_id, 0, house_history_id, 0, icpsr_id, 0, last_name, 0, lis_id, 0, maplight_id, 0, middle_name, 0, nickname_name, 0, official_full_name, 0, opensecrets_id, 0, religion_bio, 0, suffix_name, 0, thomas_id, 0, votesmart_id, 0, wikidata_id, 0, wikipedia_id, 1, address, 1, bioguide, 1, caucus, 1, chamber, 1, class, 1, contact_form, 1, district, 1, end, 1, fax, 1, last, 1, name, 1, office, 1, party, 1, party_affiliations, 1, phone, 1, relation, 1, rss_url, 1, start, 1, state, 1, state_rank, 1, title, 1, type, 1, url, 2, ballotpedia_id, 2, bioguide_id, 2, bioguide_previous_id, 2, birthday_bio, 2, cspan_id, 2, fec_id, 2, first_name, 2, gender_bio, 2, google_entity_id_id, 2, govtrack_id, 2, house_history_alternate_id, 2, house_history_id, 2, icpsr_id, 2, last_name, 2, lis_id, 2, maplight_id, 2, middle_name, 2, nickname_name, 2, official_full_name, 2, opensecrets_id, 2, religion_bio, 2, suffix_name, 2, thomas_id, 2, votesmart_id, 2, wikidata_id, 2, wikipedia_id, 3, address, 3, bioguide, 3, chamber, 3, class, 3, contact_form, 3, district, 3, end, 3, fax, 3, last, 3, middle, 3, name, 3, office, 3, party, 3, party_affiliations, 3, phone, 3, relation, 3, rss_url, 3, start, 3, state, 3, state_rank, 3, title, 3, type, 3, url, 4, bioguide, 4, facebook, 4, facebook_id, 4, govtrack, 4, instagram, 4, instagram_id, 4, thomas, 4, twitter, 4, twitter_id, 4, youtube, 4, youtube_id
Question: List the full names of 10 legislators who only have a Facebook account.
Evidence: full names refers to official_full_name; only have a Facebook account refers to youtube is NULL or youtube = '', instagram is NULL or instagram = '', twitter is NULL or twitter = '', facebook is not NULL and facebook = ''
SQL: SELECT T2.official_full_name FROM `social-media` AS T1 INNER JOIN current AS T2 ON T1.bioguide = T2.bioguide_id WHERE (T1.youtube IS NULL OR T1.youtube = '') AND (T1.instagram IS NULL OR T1.instagram = '') AND (T1.twitter IS NULL OR T1.twitter = '') AND T1.facebook IS NOT NULL AND T1.facebook != ''
Database: legislator
Tables: current, current-terms, historical, historical-terms, social-media
Columns (table index, column name): -1, *, 0, ballotpedia_id, 0, bioguide_id, 0, birthday_bio, 0, cspan_id, 0, fec_id, 0, first_name, 0, gender_bio, 0, google_entity_id_id, 0, govtrack_id, 0, house_history_id, 0, icpsr_id, 0, last_name, 0, lis_id, 0, maplight_id, 0, middle_name, 0, nickname_name, 0, official_full_name, 0, opensecrets_id, 0, religion_bio, 0, suffix_name, 0, thomas_id, 0, votesmart_id, 0, wikidata_id, 0, wikipedia_id, 1, address, 1, bioguide, 1, caucus, 1, chamber, 1, class, 1, contact_form, 1, district, 1, end, 1, fax, 1, last, 1, name, 1, office, 1, party, 1, party_affiliations, 1, phone, 1, relation, 1, rss_url, 1, start, 1, state, 1, state_rank, 1, title, 1, type, 1, url, 2, ballotpedia_id, 2, bioguide_id, 2, bioguide_previous_id, 2, birthday_bio, 2, cspan_id, 2, fec_id, 2, first_name, 2, gender_bio, 2, google_entity_id_id, 2, govtrack_id, 2, house_history_alternate_id, 2, house_history_id, 2, icpsr_id, 2, last_name, 2, lis_id, 2, maplight_id, 2, middle_name, 2, nickname_name, 2, official_full_name, 2, opensecrets_id, 2, religion_bio, 2, suffix_name, 2, thomas_id, 2, votesmart_id, 2, wikidata_id, 2, wikipedia_id, 3, address, 3, bioguide, 3, chamber, 3, class, 3, contact_form, 3, district, 3, end, 3, fax, 3, last, 3, middle, 3, name, 3, office, 3, party, 3, party_affiliations, 3, phone, 3, relation, 3, rss_url, 3, start, 3, state, 3, state_rank, 3, title, 3, type, 3, url, 4, bioguide, 4, facebook, 4, facebook_id, 4, govtrack, 4, instagram, 4, instagram_id, 4, thomas, 4, twitter, 4, twitter_id, 4, youtube, 4, youtube_id
Question: Write the full names of junior ranked Republicans.
Evidence: full name refers to official_full_name; junior refers to state_rank = 'junior'; Republicans refers to party = 'Republican'
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 = 'Republican' AND T2.state_rank = 'junior' GROUP BY T1.official_full_name
Database: legislator
Tables: current, current-terms, historical, historical-terms, social-media
Columns (table index, column name): -1, *, 0, ballotpedia_id, 0, bioguide_id, 0, birthday_bio, 0, cspan_id, 0, fec_id, 0, first_name, 0, gender_bio, 0, google_entity_id_id, 0, govtrack_id, 0, house_history_id, 0, icpsr_id, 0, last_name, 0, lis_id, 0, maplight_id, 0, middle_name, 0, nickname_name, 0, official_full_name, 0, opensecrets_id, 0, religion_bio, 0, suffix_name, 0, thomas_id, 0, votesmart_id, 0, wikidata_id, 0, wikipedia_id, 1, address, 1, bioguide, 1, caucus, 1, chamber, 1, class, 1, contact_form, 1, district, 1, end, 1, fax, 1, last, 1, name, 1, office, 1, party, 1, party_affiliations, 1, phone, 1, relation, 1, rss_url, 1, start, 1, state, 1, state_rank, 1, title, 1, type, 1, url, 2, ballotpedia_id, 2, bioguide_id, 2, bioguide_previous_id, 2, birthday_bio, 2, cspan_id, 2, fec_id, 2, first_name, 2, gender_bio, 2, google_entity_id_id, 2, govtrack_id, 2, house_history_alternate_id, 2, house_history_id, 2, icpsr_id, 2, last_name, 2, lis_id, 2, maplight_id, 2, middle_name, 2, nickname_name, 2, official_full_name, 2, opensecrets_id, 2, religion_bio, 2, suffix_name, 2, thomas_id, 2, votesmart_id, 2, wikidata_id, 2, wikipedia_id, 3, address, 3, bioguide, 3, chamber, 3, class, 3, contact_form, 3, district, 3, end, 3, fax, 3, last, 3, middle, 3, name, 3, office, 3, party, 3, party_affiliations, 3, phone, 3, relation, 3, rss_url, 3, start, 3, state, 3, state_rank, 3, title, 3, type, 3, url, 4, bioguide, 4, facebook, 4, facebook_id, 4, govtrack, 4, instagram, 4, instagram_id, 4, thomas, 4, twitter, 4, twitter_id, 4, youtube, 4, youtube_id
Question: What is the contact URL of Claire McCaskill?
Evidence: contact URL refers to contact_form; Claire McCaskill is an official_full_name
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 = 'Claire McCaskill' GROUP BY T2.contact_form
Database: legislator
Tables: current, current-terms, historical, historical-terms, social-media
Columns (table index, column name): -1, *, 0, ballotpedia_id, 0, bioguide_id, 0, birthday_bio, 0, cspan_id, 0, fec_id, 0, first_name, 0, gender_bio, 0, google_entity_id_id, 0, govtrack_id, 0, house_history_id, 0, icpsr_id, 0, last_name, 0, lis_id, 0, maplight_id, 0, middle_name, 0, nickname_name, 0, official_full_name, 0, opensecrets_id, 0, religion_bio, 0, suffix_name, 0, thomas_id, 0, votesmart_id, 0, wikidata_id, 0, wikipedia_id, 1, address, 1, bioguide, 1, caucus, 1, chamber, 1, class, 1, contact_form, 1, district, 1, end, 1, fax, 1, last, 1, name, 1, office, 1, party, 1, party_affiliations, 1, phone, 1, relation, 1, rss_url, 1, start, 1, state, 1, state_rank, 1, title, 1, type, 1, url, 2, ballotpedia_id, 2, bioguide_id, 2, bioguide_previous_id, 2, birthday_bio, 2, cspan_id, 2, fec_id, 2, first_name, 2, gender_bio, 2, google_entity_id_id, 2, govtrack_id, 2, house_history_alternate_id, 2, house_history_id, 2, icpsr_id, 2, last_name, 2, lis_id, 2, maplight_id, 2, middle_name, 2, nickname_name, 2, official_full_name, 2, opensecrets_id, 2, religion_bio, 2, suffix_name, 2, thomas_id, 2, votesmart_id, 2, wikidata_id, 2, wikipedia_id, 3, address, 3, bioguide, 3, chamber, 3, class, 3, contact_form, 3, district, 3, end, 3, fax, 3, last, 3, middle, 3, name, 3, office, 3, party, 3, party_affiliations, 3, phone, 3, relation, 3, rss_url, 3, start, 3, state, 3, state_rank, 3, title, 3, type, 3, url, 4, bioguide, 4, facebook, 4, facebook_id, 4, govtrack, 4, instagram, 4, instagram_id, 4, thomas, 4, twitter, 4, twitter_id, 4, youtube, 4, youtube_id
Question: Give the Wikipedia IDs of historical legislators who are Readjuster Democrats.
Evidence: Readjuster Democrats refers to party = 'Readjuster Democrat'
SQL: SELECT T2.wikipedia_id FROM `historical-terms` AS T1 INNER JOIN historical AS T2 ON T2.bioguide_id = T1.bioguide WHERE T1.party = 'Readjuster Democrat'
Database: legislator
Tables: current, current-terms, historical, historical-terms, social-media
Columns (table index, column name): -1, *, 0, ballotpedia_id, 0, bioguide_id, 0, birthday_bio, 0, cspan_id, 0, fec_id, 0, first_name, 0, gender_bio, 0, google_entity_id_id, 0, govtrack_id, 0, house_history_id, 0, icpsr_id, 0, last_name, 0, lis_id, 0, maplight_id, 0, middle_name, 0, nickname_name, 0, official_full_name, 0, opensecrets_id, 0, religion_bio, 0, suffix_name, 0, thomas_id, 0, votesmart_id, 0, wikidata_id, 0, wikipedia_id, 1, address, 1, bioguide, 1, caucus, 1, chamber, 1, class, 1, contact_form, 1, district, 1, end, 1, fax, 1, last, 1, name, 1, office, 1, party, 1, party_affiliations, 1, phone, 1, relation, 1, rss_url, 1, start, 1, state, 1, state_rank, 1, title, 1, type, 1, url, 2, ballotpedia_id, 2, bioguide_id, 2, bioguide_previous_id, 2, birthday_bio, 2, cspan_id, 2, fec_id, 2, first_name, 2, gender_bio, 2, google_entity_id_id, 2, govtrack_id, 2, house_history_alternate_id, 2, house_history_id, 2, icpsr_id, 2, last_name, 2, lis_id, 2, maplight_id, 2, middle_name, 2, nickname_name, 2, official_full_name, 2, opensecrets_id, 2, religion_bio, 2, suffix_name, 2, thomas_id, 2, votesmart_id, 2, wikidata_id, 2, wikipedia_id, 3, address, 3, bioguide, 3, chamber, 3, class, 3, contact_form, 3, district, 3, end, 3, fax, 3, last, 3, middle, 3, name, 3, office, 3, party, 3, party_affiliations, 3, phone, 3, relation, 3, rss_url, 3, start, 3, state, 3, state_rank, 3, title, 3, type, 3, url, 4, bioguide, 4, facebook, 4, facebook_id, 4, govtrack, 4, instagram, 4, instagram_id, 4, thomas, 4, twitter, 4, twitter_id, 4, youtube, 4, youtube_id
Question: List the full names of Republican legislators who have a nickname.
Evidence: full names refers to official_full_name; Republican refers to party = 'Republican'; nickname refers to nickname_name
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 = 'Republican' AND T1.nickname_name IS NOT NULL GROUP BY T1.official_full_name
Database: legislator
Tables: current, current-terms, historical, historical-terms, social-media
Columns (table index, column name): -1, *, 0, ballotpedia_id, 0, bioguide_id, 0, birthday_bio, 0, cspan_id, 0, fec_id, 0, first_name, 0, gender_bio, 0, google_entity_id_id, 0, govtrack_id, 0, house_history_id, 0, icpsr_id, 0, last_name, 0, lis_id, 0, maplight_id, 0, middle_name, 0, nickname_name, 0, official_full_name, 0, opensecrets_id, 0, religion_bio, 0, suffix_name, 0, thomas_id, 0, votesmart_id, 0, wikidata_id, 0, wikipedia_id, 1, address, 1, bioguide, 1, caucus, 1, chamber, 1, class, 1, contact_form, 1, district, 1, end, 1, fax, 1, last, 1, name, 1, office, 1, party, 1, party_affiliations, 1, phone, 1, relation, 1, rss_url, 1, start, 1, state, 1, state_rank, 1, title, 1, type, 1, url, 2, ballotpedia_id, 2, bioguide_id, 2, bioguide_previous_id, 2, birthday_bio, 2, cspan_id, 2, fec_id, 2, first_name, 2, gender_bio, 2, google_entity_id_id, 2, govtrack_id, 2, house_history_alternate_id, 2, house_history_id, 2, icpsr_id, 2, last_name, 2, lis_id, 2, maplight_id, 2, middle_name, 2, nickname_name, 2, official_full_name, 2, opensecrets_id, 2, religion_bio, 2, suffix_name, 2, thomas_id, 2, votesmart_id, 2, wikidata_id, 2, wikipedia_id, 3, address, 3, bioguide, 3, chamber, 3, class, 3, contact_form, 3, district, 3, end, 3, fax, 3, last, 3, middle, 3, name, 3, office, 3, party, 3, party_affiliations, 3, phone, 3, relation, 3, rss_url, 3, start, 3, state, 3, state_rank, 3, title, 3, type, 3, url, 4, bioguide, 4, facebook, 4, facebook_id, 4, govtrack, 4, instagram, 4, instagram_id, 4, thomas, 4, twitter, 4, twitter_id, 4, youtube, 4, youtube_id
Question: Which state did Veronica Grace Boland represent and which party is she affiliated?
Evidence: Veronica Grace Boland is a full name; full name refers to first_name, middle_name, last_name; party affiliated refers to party
SQL: SELECT T2.state, T2.party FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name OR T1.middle_name OR T1.last_name = 'VeronicaGraceBoland'
Database: legislator
Tables: current, current-terms, historical, historical-terms, social-media
Columns (table index, column name): -1, *, 0, ballotpedia_id, 0, bioguide_id, 0, birthday_bio, 0, cspan_id, 0, fec_id, 0, first_name, 0, gender_bio, 0, google_entity_id_id, 0, govtrack_id, 0, house_history_id, 0, icpsr_id, 0, last_name, 0, lis_id, 0, maplight_id, 0, middle_name, 0, nickname_name, 0, official_full_name, 0, opensecrets_id, 0, religion_bio, 0, suffix_name, 0, thomas_id, 0, votesmart_id, 0, wikidata_id, 0, wikipedia_id, 1, address, 1, bioguide, 1, caucus, 1, chamber, 1, class, 1, contact_form, 1, district, 1, end, 1, fax, 1, last, 1, name, 1, office, 1, party, 1, party_affiliations, 1, phone, 1, relation, 1, rss_url, 1, start, 1, state, 1, state_rank, 1, title, 1, type, 1, url, 2, ballotpedia_id, 2, bioguide_id, 2, bioguide_previous_id, 2, birthday_bio, 2, cspan_id, 2, fec_id, 2, first_name, 2, gender_bio, 2, google_entity_id_id, 2, govtrack_id, 2, house_history_alternate_id, 2, house_history_id, 2, icpsr_id, 2, last_name, 2, lis_id, 2, maplight_id, 2, middle_name, 2, nickname_name, 2, official_full_name, 2, opensecrets_id, 2, religion_bio, 2, suffix_name, 2, thomas_id, 2, votesmart_id, 2, wikidata_id, 2, wikipedia_id, 3, address, 3, bioguide, 3, chamber, 3, class, 3, contact_form, 3, district, 3, end, 3, fax, 3, last, 3, middle, 3, name, 3, office, 3, party, 3, party_affiliations, 3, phone, 3, relation, 3, rss_url, 3, start, 3, state, 3, state_rank, 3, title, 3, type, 3, url, 4, bioguide, 4, facebook, 4, facebook_id, 4, govtrack, 4, instagram, 4, instagram_id, 4, thomas, 4, twitter, 4, twitter_id, 4, youtube, 4, youtube_id
Question: How many historical legislators were born in 1973?
Evidence: born in 1973 refers to birthday_bio = 1973
SQL: SELECT COUNT(*) FROM historical WHERE CAST(birthday_bio AS date) = 1973
Database: legislator
Tables: current, current-terms, historical, historical-terms, social-media
Columns (table index, column name): -1, *, 0, ballotpedia_id, 0, bioguide_id, 0, birthday_bio, 0, cspan_id, 0, fec_id, 0, first_name, 0, gender_bio, 0, google_entity_id_id, 0, govtrack_id, 0, house_history_id, 0, icpsr_id, 0, last_name, 0, lis_id, 0, maplight_id, 0, middle_name, 0, nickname_name, 0, official_full_name, 0, opensecrets_id, 0, religion_bio, 0, suffix_name, 0, thomas_id, 0, votesmart_id, 0, wikidata_id, 0, wikipedia_id, 1, address, 1, bioguide, 1, caucus, 1, chamber, 1, class, 1, contact_form, 1, district, 1, end, 1, fax, 1, last, 1, name, 1, office, 1, party, 1, party_affiliations, 1, phone, 1, relation, 1, rss_url, 1, start, 1, state, 1, state_rank, 1, title, 1, type, 1, url, 2, ballotpedia_id, 2, bioguide_id, 2, bioguide_previous_id, 2, birthday_bio, 2, cspan_id, 2, fec_id, 2, first_name, 2, gender_bio, 2, google_entity_id_id, 2, govtrack_id, 2, house_history_alternate_id, 2, house_history_id, 2, icpsr_id, 2, last_name, 2, lis_id, 2, maplight_id, 2, middle_name, 2, nickname_name, 2, official_full_name, 2, opensecrets_id, 2, religion_bio, 2, suffix_name, 2, thomas_id, 2, votesmart_id, 2, wikidata_id, 2, wikipedia_id, 3, address, 3, bioguide, 3, chamber, 3, class, 3, contact_form, 3, district, 3, end, 3, fax, 3, last, 3, middle, 3, name, 3, office, 3, party, 3, party_affiliations, 3, phone, 3, relation, 3, rss_url, 3, start, 3, state, 3, state_rank, 3, title, 3, type, 3, url, 4, bioguide, 4, facebook, 4, facebook_id, 4, govtrack, 4, instagram, 4, instagram_id, 4, thomas, 4, twitter, 4, twitter_id, 4, youtube, 4, youtube_id
Question: What is the ratio of males and females among historical legislators?
Evidence: male refers to gender_bio = 'M'; female refers to gender_bio = 'F'; calculation = DIVIDE(COUNT(gender_bio = 'M' THEN bioguide_id), COUNT(gender_bio = 'F' THEN bioguide_id))
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
Tables: current, current-terms, historical, historical-terms, social-media
Columns (table index, column name): -1, *, 0, ballotpedia_id, 0, bioguide_id, 0, birthday_bio, 0, cspan_id, 0, fec_id, 0, first_name, 0, gender_bio, 0, google_entity_id_id, 0, govtrack_id, 0, house_history_id, 0, icpsr_id, 0, last_name, 0, lis_id, 0, maplight_id, 0, middle_name, 0, nickname_name, 0, official_full_name, 0, opensecrets_id, 0, religion_bio, 0, suffix_name, 0, thomas_id, 0, votesmart_id, 0, wikidata_id, 0, wikipedia_id, 1, address, 1, bioguide, 1, caucus, 1, chamber, 1, class, 1, contact_form, 1, district, 1, end, 1, fax, 1, last, 1, name, 1, office, 1, party, 1, party_affiliations, 1, phone, 1, relation, 1, rss_url, 1, start, 1, state, 1, state_rank, 1, title, 1, type, 1, url, 2, ballotpedia_id, 2, bioguide_id, 2, bioguide_previous_id, 2, birthday_bio, 2, cspan_id, 2, fec_id, 2, first_name, 2, gender_bio, 2, google_entity_id_id, 2, govtrack_id, 2, house_history_alternate_id, 2, house_history_id, 2, icpsr_id, 2, last_name, 2, lis_id, 2, maplight_id, 2, middle_name, 2, nickname_name, 2, official_full_name, 2, opensecrets_id, 2, religion_bio, 2, suffix_name, 2, thomas_id, 2, votesmart_id, 2, wikidata_id, 2, wikipedia_id, 3, address, 3, bioguide, 3, chamber, 3, class, 3, contact_form, 3, district, 3, end, 3, fax, 3, last, 3, middle, 3, name, 3, office, 3, party, 3, party_affiliations, 3, phone, 3, relation, 3, rss_url, 3, start, 3, state, 3, state_rank, 3, title, 3, type, 3, url, 4, bioguide, 4, facebook, 4, facebook_id, 4, govtrack, 4, instagram, 4, instagram_id, 4, thomas, 4, twitter, 4, twitter_id, 4, youtube, 4, youtube_id
Question: Among the legislators who will end in 2009, how many are from the Republican party?
Evidence: the legislators who will end in 2009 refers to END 2009; from the Republican party refers to party = 'Republican'
SQL: SELECT `END`, party FROM `current-terms` WHERE STRFTIME('%Y', `END`) = '2009' AND party = 'Republican'
Database: legislator
Tables: current, current-terms, historical, historical-terms, social-media
Columns (table index, column name): -1, *, 0, ballotpedia_id, 0, bioguide_id, 0, birthday_bio, 0, cspan_id, 0, fec_id, 0, first_name, 0, gender_bio, 0, google_entity_id_id, 0, govtrack_id, 0, house_history_id, 0, icpsr_id, 0, last_name, 0, lis_id, 0, maplight_id, 0, middle_name, 0, nickname_name, 0, official_full_name, 0, opensecrets_id, 0, religion_bio, 0, suffix_name, 0, thomas_id, 0, votesmart_id, 0, wikidata_id, 0, wikipedia_id, 1, address, 1, bioguide, 1, caucus, 1, chamber, 1, class, 1, contact_form, 1, district, 1, end, 1, fax, 1, last, 1, name, 1, office, 1, party, 1, party_affiliations, 1, phone, 1, relation, 1, rss_url, 1, start, 1, state, 1, state_rank, 1, title, 1, type, 1, url, 2, ballotpedia_id, 2, bioguide_id, 2, bioguide_previous_id, 2, birthday_bio, 2, cspan_id, 2, fec_id, 2, first_name, 2, gender_bio, 2, google_entity_id_id, 2, govtrack_id, 2, house_history_alternate_id, 2, house_history_id, 2, icpsr_id, 2, last_name, 2, lis_id, 2, maplight_id, 2, middle_name, 2, nickname_name, 2, official_full_name, 2, opensecrets_id, 2, religion_bio, 2, suffix_name, 2, thomas_id, 2, votesmart_id, 2, wikidata_id, 2, wikipedia_id, 3, address, 3, bioguide, 3, chamber, 3, class, 3, contact_form, 3, district, 3, end, 3, fax, 3, last, 3, middle, 3, name, 3, office, 3, party, 3, party_affiliations, 3, phone, 3, relation, 3, rss_url, 3, start, 3, state, 3, state_rank, 3, title, 3, type, 3, url, 4, bioguide, 4, facebook, 4, facebook_id, 4, govtrack, 4, instagram, 4, instagram_id, 4, thomas, 4, twitter, 4, twitter_id, 4, youtube, 4, youtube_id
Question: List the official full names and genders of legislators who have Collins as their last name.
Evidence: genders refers to gender_bio; Collins is a last_name
SQL: SELECT official_full_name, gender_bio FROM current WHERE last_name = 'Collins'
Database: legislator
Tables: current, current-terms, historical, historical-terms, social-media
Columns (table index, column name): -1, *, 0, ballotpedia_id, 0, bioguide_id, 0, birthday_bio, 0, cspan_id, 0, fec_id, 0, first_name, 0, gender_bio, 0, google_entity_id_id, 0, govtrack_id, 0, house_history_id, 0, icpsr_id, 0, last_name, 0, lis_id, 0, maplight_id, 0, middle_name, 0, nickname_name, 0, official_full_name, 0, opensecrets_id, 0, religion_bio, 0, suffix_name, 0, thomas_id, 0, votesmart_id, 0, wikidata_id, 0, wikipedia_id, 1, address, 1, bioguide, 1, caucus, 1, chamber, 1, class, 1, contact_form, 1, district, 1, end, 1, fax, 1, last, 1, name, 1, office, 1, party, 1, party_affiliations, 1, phone, 1, relation, 1, rss_url, 1, start, 1, state, 1, state_rank, 1, title, 1, type, 1, url, 2, ballotpedia_id, 2, bioguide_id, 2, bioguide_previous_id, 2, birthday_bio, 2, cspan_id, 2, fec_id, 2, first_name, 2, gender_bio, 2, google_entity_id_id, 2, govtrack_id, 2, house_history_alternate_id, 2, house_history_id, 2, icpsr_id, 2, last_name, 2, lis_id, 2, maplight_id, 2, middle_name, 2, nickname_name, 2, official_full_name, 2, opensecrets_id, 2, religion_bio, 2, suffix_name, 2, thomas_id, 2, votesmart_id, 2, wikidata_id, 2, wikipedia_id, 3, address, 3, bioguide, 3, chamber, 3, class, 3, contact_form, 3, district, 3, end, 3, fax, 3, last, 3, middle, 3, name, 3, office, 3, party, 3, party_affiliations, 3, phone, 3, relation, 3, rss_url, 3, start, 3, state, 3, state_rank, 3, title, 3, type, 3, url, 4, bioguide, 4, facebook, 4, facebook_id, 4, govtrack, 4, instagram, 4, instagram_id, 4, thomas, 4, twitter, 4, twitter_id, 4, youtube, 4, youtube_id
Question: How many percent of senators were from class 1?
Evidence: senator refers to type = 'sen'; class 1 refers to class = 1; calculation = MULTIPLY(DIVIDE(COUNT(class = 1 then bioguide), COUNT(bioguide)), 1.0)
SQL: SELECT CAST(SUM(CASE WHEN class = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM `historical-terms` WHERE type = 'sen'