db_id
stringclasses
66 values
question
stringlengths
24
325
evidence
stringlengths
1
673
gold_query
stringlengths
23
804
db_schema
stringclasses
66 values
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
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
legislator
Give the district numbers with an Anti-Administration party.
null
SELECT district FROM `historical-terms` WHERE party = 'Anti-Administration' GROUP BY district
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
Which chapter has the most paragraphs? Give the description of the chapter.
most paragraphs refers to max(count(chapter_id))
SELECT T1.Description FROM chapters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.chapter_id ORDER BY T2.ParagraphNum DESC LIMIT 1
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
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 = '')
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
movie_3
What is the average amount of money spent by a customer in Italy on a single film rental?
Italy refers to country = 'Italy'; average amount = divide(sum(amount), count(customer_id)) where country = 'Italy'
SELECT AVG(T5.amount) FROM address AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN country AS T3 ON T2.country_id = T3.country_id INNER JOIN customer AS T4 ON T1.address_id = T4.address_id INNER JOIN payment AS T5 ON T4.customer_id = T5.customer_id WHERE T3.country = 'Italy'
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
legislator
Among the female legislators, what is the percentage of the senators in Maine?
female refers to gender_bio = 'F'; percentage = MULTIPLY(DIVIDE(SUM(type = 'sen'), COUNT(type)), 100.0); senators refers to type = 'sen'; Maine refers to state = 'ME';
SELECT CAST(SUM(CASE WHEN T2.type = 'sen' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.type) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.state = 'ME' AND T1.gender_bio = 'F'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
professional_basketball
For the player who had the most rebounds throughout his allstar appearances, what was his weight and height?
the most rebounds refers to max(rebounds)
SELECT T1.weight, T1.height FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID ORDER BY T2.rebounds DESC LIMIT 1
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
movie_3
Among the payments made by Mary Smith, how many of them are over 4.99?
over 4.99 refers to amount > 4.99
SELECT COUNT(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH' AND T1.amount > 4.99
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
legislator
How many of the legislators are male?
male refers to gender_bio = 'M';
SELECT COUNT(*) FROM current WHERE gender_bio = 'M'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
Give the abbreviation name for the character "Earl of Westmoreland".
abbreviation name refers to Abbrev; character "Earl of Westmoreland" refers to CharName = 'Earl of Westmoreland'
SELECT DISTINCT Abbrev FROM characters WHERE CharName = 'Earl of Westmoreland'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
movie_3
How much in total had the customers in Italy spent on film rentals?
total = sum(amount); Italy refers to country = 'Italy'
SELECT SUM(T5.amount) FROM address AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN country AS T3 ON T2.country_id = T3.country_id INNER JOIN customer AS T4 ON T1.address_id = T4.address_id INNER JOIN payment AS T5 ON T4.customer_id = T5.customer_id WHERE T3.country = 'Italy'
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
legislator
Give the alphanumeric ID of the Catholic legislators in Nebraska.
alphanumeric ID refers to bioguide; Catholic legislators refers to religion_bio = 'Catholic'; Nebraska refers to state = 'NE';
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'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
movie_3
Please give the full name of the customer who had made the biggest amount of payment in one single film rental.
full name refers to first_name, last_name; the biggest amount refers to max(amount)
SELECT T2.first_name, T2.last_name FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id ORDER BY T1.amount DESC LIMIT 1
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
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'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
How many characters are there in Titus Andronicus?
Titus Andronicus refers to Title = 'Titus Andronicus'
SELECT COUNT(DISTINCT T3.character_id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id WHERE T1.Title = 'Titus Andronicus'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
movie_3
Among the times Mary Smith had rented a movie, how many of them happened in June, 2005?
in June 2005 refers to year(payment_date) = 2005 and month(payment_date) = 6
SELECT COUNT(T1.customer_id) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH' AND STRFTIME('%Y',T1.payment_date) = '2005' AND STRFTIME('%Y', T1.payment_date) = '6'
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
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 = '')
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
movie_3
What is the total amount of money Mary Smith has spent on film rentals?
the total amount = sum(amount)
SELECT SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH'
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
legislator
What is the first name of the legislator whose address at 1005 Longworth HOB; Washington DC 20515-1408?
null
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
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
movie_3
How many times has Mary Smith rented a film?
null
SELECT COUNT(T1.customer_id) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH'
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
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'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
movie_3
What is the biggest amount of payment for a rental made by Mary Smith?
the biggest amount refers to max(amount)
SELECT T1.amount FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH' ORDER BY T1.amount DESC LIMIT 1
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
professional_basketball
Which non-playoffs team had the most points in the regular season in the year 1998?
non-playoff refers to PostGP = 0; in the year 1998 refers to year = 1998; the most points refers to max(o_pts)
SELECT T2.tmID FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 1998 AND T1.PostGP = 0 ORDER BY T1.points DESC LIMIT 1
CREATE TABLE players_teams ( PostGS INTEGER, -- PostdRebounds INTEGER, -- PostPF INTEGER, -- tmID TEXT, -- threeAttempted INTEGER, -- PostRebounds INTEGER, -- assists INTEGER, -- threeMade INTEGER, -- PostBlocks INTEGER, -- PostTurnovers INTEGER, -- GP INTEGER, -- lgID TEXT, -- Example...
movie_3
Which country does Mary Smith live in?
null
SELECT T3.country FROM address AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN country AS T3 ON T2.country_id = T3.country_id INNER JOIN customer AS T4 ON T1.address_id = T4.address_id WHERE T4.first_name = 'MARY' AND T4.last_name = 'SMITH'
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
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'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
movie_3
Please list the full names of all the customers who live in Italy.
full name refers to first_name, last_name; Italy refers to country = 'Italy'
SELECT T4.first_name, T4.last_name FROM address AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN country AS T3 ON T2.country_id = T3.country_id INNER JOIN customer AS T4 ON T1.address_id = T4.address_id WHERE T3.country = 'Italy'
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
shakespeare
What is the description for the character mentioned in paragraph No.640171?
paragraph No.640171 refers to paragraphs.id = '640171'
SELECT T1.Description FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.id = '640171'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
movie_3
Among all the active customers, how many of them live in Arlington?
active refers to active = 1; Arlington refers to city = 'Arlington'
SELECT COUNT(T2.customer_id) FROM address AS T1 INNER JOIN customer AS T2 ON T1.address_id = T2.address_id INNER JOIN city AS T3 ON T1.city_id = T3.city_id WHERE T2.active = 1 AND T3.city = 'Arlington'
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
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'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
Which character was mentioned in the paragraph "Would he do so, I'ld beg your precious mistress, Which he counts but a trifle."? Give the character name.
paragraph "Would he do so, I'ld beg your precious mistress, Which he counts but a trifle."  refers to PlainText = 'Would he do so, I'ld beg your precious mistress, Which he counts but a trifle.'
SELECT T1.CharName FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.PlainText = 'Would he do so, I''ld beg your precious mistress,Which he counts but a trifle.'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
movie_3
What is the address of Mary Smith?
null
SELECT T1.address FROM address AS T1 INNER JOIN customer AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH'
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
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'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
movie_3
Among all the customers of store no.1, how many of them are active?
active refers to active = 1
SELECT COUNT(customer_id) FROM customer WHERE active = 1 AND store_id = 1
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
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%'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
How many scenes are there in King John?
King John refers to Title = 'King John'
SELECT COUNT(T2.Scene) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'King John'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
movie_3
How many customers are active?
active refers to active = 1
SELECT COUNT(customer_id) FROM customer WHERE active = 1
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
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
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
movie_3
What is the postal code of the address 692 Joliet Street?
null
SELECT postal_code FROM address WHERE address = '692 Joliet Street'
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
legislator
What is the contact form of the legislator named Rick Crawford?
null
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'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
List the number of acts in Two Gentlemen of Verona.
Two Gentlemen of Verona refers to LongTitle = 'Two Gentlemen of Verona'
SELECT DISTINCT T1.Act FROM chapters AS T1 INNER JOIN works AS T2 ON T1.id = T1.work_id WHERE T2.LongTitle = 'Two Gentlemen of Verona'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
movie_3
Among the films starred by Reese West, what is the difference between the films that have store ID of 1 and store ID of 2?
result = subtract(count(film_id where store_id = 1), count(film_id where store_id = 2))
SELECT SUM(IIF(T4.film_id = 1, 1, 0)) - SUM(IIF(T4.film_id = 2, 1, 0)) AS diff FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id INNER JOIN inventory AS T4 ON T3.film_id = T4.film_id WHERE T2.first_name = 'Reese' AND T2.last_name = 'West'
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
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
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
shakespeare
Give the title of the work that contains the character "Shylock".
character "Shylock" refers to CharName = 'Shylock'
SELECT DISTINCT T1.Title FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T4.CharName = 'Shylock'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
movie_3
In films with a rental rate of 2.99, how many of the films are starred by Nina Soto?
a rental rate of 2.99 refers to rental_rate = 2.99
SELECT COUNT(T1.film_id) FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T3.rental_rate = 2.99 AND T2.first_name = 'Nina' AND T2.last_name = 'Soto'
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
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
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
movie_3
List the store ID of the film titled "Amadeus Holy".
null
SELECT T2.store_id FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id WHERE T1.title = 'Amadeus Holy'
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
shakespeare
How many chapters does the character Demetrius show in the story?
character Demetrius refers to CharName = 'Demetrius'
SELECT COUNT(DISTINCT T2.chapter_id) FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'Demetrius'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
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'
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
movie_3
What are the titles of the films starred by Russell Close?
null
SELECT T3.title FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.first_name = 'Russell' AND T2.last_name = 'Close'
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
shakespeare
Which Shakespeare story with character ID 324 has description of 'this friend of Caesar'?
null
SELECT T1.Title FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T2.id = '324' AND T2.Description = 'friend to Caesar'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
movie_3
Give the duration of the film starred by Nick Wahlberg with the highest rental rate.
duration refers to length; the highest rental rate refers to max(rental_rate)
SELECT T3.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'Nick' AND T1.last_name = 'Wahlberg' ORDER BY T3.rental_rate DESC LIMIT 1
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
legislator
How many female representatives are there in Michigan?
female refers to gender_bio = 'F'; representatives refers to type = 'rep'; Michigan refers to state = 'MI';
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
CREATE TABLE current ( gender_bio TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 541 - Distinct count 2 - Null count 0 suffix_name TEXT, -- Example Values: `Jr.`, `III`, `II` | Value Statics: Total count 20 - Distinct count 3 - Null count 521 house_history_id REAL, -- birthday_bio DATE, -- ...
chicago_crime
What is the total number of crimes that happened in Bridgeport with beat less than 1000?
Bridgeport refers to community_area_name = 'Bridgeport'; with beat less than 1000 refers to beat < 1000; total number = count(beat) where community_area_name = 'Bridgeport' and beat < 1000
SELECT SUM(CASE WHEN T2.beat < 1000 THEN 1 ELSE 0 END) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.community_area_name = 'Bridgeport'
CREATE TABLE District ( district_no INTEGER primary key, email TEXT, -- phone TEXT, -- address TEXT, -- fax TEXT, -- district_name TEXT, -- tty TEXT, -- commander TEXT, -- zip_code INTEGER, -- twitter TEXT, -- ); CREATE TABLE Community_Area ( population TEXT, -- side TEXT, -- Example Va...