db_id
stringclasses
66 values
question
stringlengths
24
325
evidence
stringlengths
1
673
gold_query
stringlengths
23
804
db_schema
stringclasses
66 values
authors
What are the different ways the name of the author, Randall Davis, is written on their papers?
Randall Davis refer to Author.Name
SELECT DISTINCT T1.Name FROM PaperAuthor AS T1 INNER JOIN Author AS T2 ON T1.AuthorId = T2.Id WHERE T2.Name = 'Randall Davis' AND T1.Name != 'Randall Davis'
CREATE TABLE Journal ( FullName TEXT, -- ShortName TEXT, -- HomePage TEXT, -- Id INTEGER constraint Journal_pk primary key, ); CREATE TABLE Conference ( ShortName TEXT, -- Id INTEGER constraint Conference_pk primary key, HomePage TEXT, -- FullName TEXT, -- ); CREATE TABLE Paper ( Title TEXT, -- ...
retail_complains
What is the most common issue for the highest priority complaints?
most common refers to max(count(issue)); highest priority refers to priority = 2
SELECT T1.Issue FROM events AS T1 INNER JOIN callcenterlogs AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.priority = 2 GROUP BY T1.Issue ORDER BY COUNT(T1.Issue) DESC LIMIT 1
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
How many actors played a role in the 2006 film whose rental duration is 7 days, rental rate is 4.99 and is 98 minutes duration?
in 2006 refers to release_year = 2006; 98 min duration refers to length = 98; number of actors refers to count(actor_id)
SELECT COUNT(T1.actor_id) FROM film_actor AS T1 INNER JOIN film AS T2 ON T1.film_id = T2.film_id WHERE T2.release_year = 2006 AND T2.rental_duration = 7 AND T2.rental_duration = 4.99 AND T2.length = 98
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 ...
shipping
What is the weight of the shipment delivered by Andrea Simons on March 7, 2016?
on March 7, 2016 refers to ship_date = '2016-03-07'
SELECT T1.weight FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T2.first_name = 'Andrea' AND T2.last_name = 'Simons' AND T1.ship_date = '2016-03-07'
CREATE TABLE city ( population INTEGER, -- state TEXT, -- city_name TEXT, -- city_id INTEGER primary key, area REAL, -- ); CREATE TABLE driver ( driver_id INTEGER primary key, address TEXT, -- Example Values: `268 Richmond Ave`, `3574 Oak Limb Cv`, `1839 S Orleans St`, `3649 Park Lake Dr`, `749 E Mckell...
simpson_episodes
Please list all the keywords of the episode Lost Verizon.
"Lost Verizon" is the title of episode
SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Lost Verizon';
CREATE TABLE Keyword ( foreign key (episode_id) references Episode(episode_id), keyword TEXT, -- primary key (episode_id, keyword), episode_id TEXT, -- ); CREATE TABLE Vote ( foreign key (episode_id) references Episode(episode_id), votes INTEGER, -- episode_id TEXT, -- percent REAL, -- stars INTEGER...
authors
Who are the authors of the paper "Determination of Planetary Meteorology from Aerobot Flight Sensors"?
'Determination of Planetary Meteorology from Aerobot Flight Sensors' refer to title of the paper
SELECT T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = 'Determination of Planetary Meteorology FROM Aerobot Flight Sensors'
CREATE TABLE Journal ( FullName TEXT, -- ShortName TEXT, -- HomePage TEXT, -- Id INTEGER constraint Journal_pk primary key, ); CREATE TABLE Conference ( ShortName TEXT, -- Id INTEGER constraint Conference_pk primary key, HomePage TEXT, -- FullName TEXT, -- ); CREATE TABLE Paper ( Title TEXT, -- ...
retail_complains
What is the birth date of the youngest client?
birth date refers to year, month, day; youngest client refers to max(year, month, day)
SELECT day, month, year FROM client ORDER BY year DESC, month DESC, day DESC LIMIT 1
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
Which continent is the mother country of Clarksville city in?
"Clarksville" is the city;
SELECT T1.country FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id WHERE T2.city = 'Clarksville'
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 ...
shipping
List the weight of the customer's shipment with annual revenue of 39448581.
null
SELECT T1.weight FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.annual_revenue = 39448581
CREATE TABLE city ( population INTEGER, -- state TEXT, -- city_name TEXT, -- city_id INTEGER primary key, area REAL, -- ); CREATE TABLE driver ( driver_id INTEGER primary key, address TEXT, -- Example Values: `268 Richmond Ave`, `3574 Oak Limb Cv`, `1839 S Orleans St`, `3649 Park Lake Dr`, `749 E Mckell...
authors
Which year did the "Internet, Multimedia Systems and Applications" conference publish the most papers?
'Internet, Multimedia Systems and Applications' is the FullName of paper; published the most papers refers to MAX(COUNT(year))
SELECT T2.Year FROM Conference AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.ConferenceId WHERE T1.FullName = 'Internet, Multimedia Systems and Applications' GROUP BY T2.Year ORDER BY COUNT(T2.Id) DESC LIMIT 1
CREATE TABLE Journal ( FullName TEXT, -- ShortName TEXT, -- HomePage TEXT, -- Id INTEGER constraint Journal_pk primary key, ); CREATE TABLE Conference ( ShortName TEXT, -- Id INTEGER constraint Conference_pk primary key, HomePage TEXT, -- FullName TEXT, -- ); CREATE TABLE Paper ( Title TEXT, -- ...
retail_complains
What is the social number of the person who made the most complaints?
social number refers to social; most complaints refers to max(count(event.Client_ID))
SELECT T1.social FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID GROUP BY T1.client_id ORDER BY COUNT(T1.client_id) DESC LIMIT 1
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
Give the detailed address for store No.2.
store no. 22 refers to store_id = 2; detailed address refers to address, address2, district
SELECT T1.address, T1.address2, T1.district FROM address AS T1 INNER JOIN store AS T2 ON T1.address_id = T2.address_id WHERE T2.store_id = 2
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 ...
simpson_episodes
How many 7-star votes in star score did the episode Lost Verizon have?
7-stars vote refers to stars = 7; 'Lost Verizon' is the title of episode
SELECT COUNT(*) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Lost Verizon' AND T2.stars = 7;
CREATE TABLE Keyword ( foreign key (episode_id) references Episode(episode_id), keyword TEXT, -- primary key (episode_id, keyword), episode_id TEXT, -- ); CREATE TABLE Vote ( foreign key (episode_id) references Episode(episode_id), votes INTEGER, -- episode_id TEXT, -- percent REAL, -- stars INTEGER...
retail_complains
How many of the complaints are longer than 15 minutes?
longer than 15 minutes refers to ser_time > '00:15:00'
SELECT COUNT(ser_time) FROM callcenterlogs WHERE strftime('%M', ser_time) > '15'
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
What is the description of the film Artist Coldblooded?
"ARTIST COLDBLOODED" is the title of film
SELECT description FROM film WHERE title = 'ARTIST COLDBLOODED'
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 ...
shipping
What is the name of the customer of ship ID 1147?
name of customer refers to cust_name
SELECT T2.cust_name FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T1.ship_id = '1147'
CREATE TABLE city ( population INTEGER, -- state TEXT, -- city_name TEXT, -- city_id INTEGER primary key, area REAL, -- ); CREATE TABLE driver ( driver_id INTEGER primary key, address TEXT, -- Example Values: `268 Richmond Ave`, `3574 Oak Limb Cv`, `1839 S Orleans St`, `3649 Park Lake Dr`, `749 E Mckell...
public_review_platform
In which categories does the only business located in the city of Arcadia appear?
categories refers to category_name
SELECT T1.category_name FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T3.city = 'Arcadia'
CREATE TABLE Attributes ( attribute_name TEXT, -- attribute_id INTEGER constraint Attributes_pk primary key, ); CREATE TABLE Elite ( year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ...
retail_complains
What is the address of the client who made a complaint via postal mail on March 14, 2012?
address refers to address_1, address_2; via postal mail refers to Submitted via = 'Postal mail'; March 14 2012 refers to Date received = '2012-03-14'
SELECT T1.address_1, T1.address_2 FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Date received` = '2012-03-14' AND T2.`Submitted via` = 'Postal mail'
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
Tell the special features of the film Uprising Uptown.
"UPRISING UPTOWN" is the title of film
SELECT special_features FROM film WHERE title = 'UPRISING UPTOWN'
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 ...
shipping
List the driver's name of the shipment shipped on February 22, 2016.
on February 22, 2016 refers to ship_date = '2016-02-22'; driver's name refers to first_name, last_name
SELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_date = '2016-02-22'
CREATE TABLE city ( population INTEGER, -- state TEXT, -- city_name TEXT, -- city_id INTEGER primary key, area REAL, -- ); CREATE TABLE driver ( driver_id INTEGER primary key, address TEXT, -- Example Values: `268 Richmond Ave`, `3574 Oak Limb Cv`, `1839 S Orleans St`, `3649 Park Lake Dr`, `749 E Mckell...
simpson_episodes
How many episodes aired in the year 2009 have over 15% of voters giving 10 stars in star score?
aired in the year 2009 refers to air_date like '2009%'; 10 stars in star score refers to stars = 10; over 15% of voters refers to Votes.percent > 15
SELECT COUNT(*) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE SUBSTR(T1.air_date, 1, 4) = '2009' AND T2.stars = 10 AND T2.percent > 15;
CREATE TABLE Keyword ( foreign key (episode_id) references Episode(episode_id), keyword TEXT, -- primary key (episode_id, keyword), episode_id TEXT, -- ); CREATE TABLE Vote ( foreign key (episode_id) references Episode(episode_id), votes INTEGER, -- episode_id TEXT, -- percent REAL, -- stars INTEGER...
authors
What is the homepage URL for the journal that published the most papers?
published the most papers refer to MAX(JournalId); homepage URL refers to HomePage
SELECT T2.HomePage FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id GROUP BY T1.JournalId ORDER BY COUNT(T1.JournalId) DESC LIMIT 1
CREATE TABLE Journal ( FullName TEXT, -- ShortName TEXT, -- HomePage TEXT, -- Id INTEGER constraint Journal_pk primary key, ); CREATE TABLE Conference ( ShortName TEXT, -- Id INTEGER constraint Conference_pk primary key, HomePage TEXT, -- FullName TEXT, -- ); CREATE TABLE Paper ( Title TEXT, -- ...
retail_complains
List the full names of all clients who live in the Pacific division.
full name refers to first, last
SELECT T2.first, T2.middle, T2.last FROM district AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id WHERE T1.division = 'Pacific'
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
State the number of films that are 178 minutes long.
178 min long refers to length = '178'
SELECT COUNT(film_id) FROM film WHERE length = '178'
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 ...
retail_complains
Which is the city where most of the 1 star reviews come from?
most refers to max(count(state_abbrev)); 1 star review refers to Stars = 1
SELECT T2.city FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Stars = 1 GROUP BY T2.city ORDER BY COUNT(T2.city) DESC LIMIT 1
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
What is the phone number of address No.72?
address no. 72 refers to address_id = 72; phone number refers to phone
SELECT phone FROM address WHERE address_id = '72'
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 ...
simpson_episodes
What's the rating of the episode in which Dan Castellaneta won the Outstanding Voice-Over Performance award in 2009?
"Dan Castellaneta" is the person;  2009 is year;  won refers result = 'Winner'
SELECT T2.rating FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.award = 'Outstanding Voice-Over Performance' AND SUBSTR(T1.year, 1, 4) = '2009' AND T1.person = 'Dan Castellaneta';
CREATE TABLE Keyword ( foreign key (episode_id) references Episode(episode_id), keyword TEXT, -- primary key (episode_id, keyword), episode_id TEXT, -- ); CREATE TABLE Vote ( foreign key (episode_id) references Episode(episode_id), votes INTEGER, -- episode_id TEXT, -- percent REAL, -- stars INTEGER...
book_publishing_company
Among all the employees, how many percent more for the publishers than designers?
publisher and designer are job descriptions which refers to job_desc; percentage more = 100*(SUBTRACT(SUM(CASE WHERE job_desc = 'publisher), SUM(CASE WHERE job_desc = 'designer'))
SELECT CAST(SUM(CASE WHEN T2.job_desc = 'publisher' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.job_desc = 'designer' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.job_id) FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id
CREATE TABLE jobs ( max_lvl INTEGER not null, -- Example Values: `10`, `250`, `225`, `200`, `175` | Value Statics: Total count 14 - Distinct count 8 - Null count 0 job_desc TEXT not null, -- Example Values: `New Hire - Job not specified`, `Chief Executive Officer`, `Business Operations Manager`, `Chief Financial O...
movie_3
State the number of addresses in the Nordrhein-Westfalen district.
number of address refers to address_id
SELECT COUNT(address_id) FROM address WHERE district = 'Nordrhein-Westfalen'
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 ...
shipping
Determine the number of shipments delivered by Andrea Simons to Huntsville in 2016.
"Huntsville" is the city_name; in 2016 refers to Cast(ship_date AS DATE) = 2016; number of shipment refers to Count(ship_id)
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id WHERE T3.first_name = 'Andrea' AND T3.last_name = 'Simons' AND T2.city_name = 'Huntsville' AND STRFTIME('%Y', T1.ship_date) = '2016'
CREATE TABLE city ( population INTEGER, -- state TEXT, -- city_name TEXT, -- city_id INTEGER primary key, area REAL, -- ); CREATE TABLE driver ( driver_id INTEGER primary key, address TEXT, -- Example Values: `268 Richmond Ave`, `3574 Oak Limb Cv`, `1839 S Orleans St`, `3649 Park Lake Dr`, `749 E Mckell...
simpson_episodes
How many stars on average does the episode Lost Verizon have?
"Lost Verizon" is the title of episode; stars on average = Divide( Sum (Multiply (votes, stars)), Sum(votes))
SELECT CAST(SUM(T2.votes * T2.stars) AS REAL) / SUM(T2.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Lost Verizon';
CREATE TABLE Keyword ( foreign key (episode_id) references Episode(episode_id), keyword TEXT, -- primary key (episode_id, keyword), episode_id TEXT, -- ); CREATE TABLE Vote ( foreign key (episode_id) references Episode(episode_id), votes INTEGER, -- episode_id TEXT, -- percent REAL, -- stars INTEGER...
authors
Please list the titles of any two papers that Jundu has written.
papers that Jundu has written refers to Name LIKE '%Jun du%'
SELECT T1.Title FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T2.Name LIKE 'Jun du%' LIMIT 2
CREATE TABLE Journal ( FullName TEXT, -- ShortName TEXT, -- HomePage TEXT, -- Id INTEGER constraint Journal_pk primary key, ); CREATE TABLE Conference ( ShortName TEXT, -- Id INTEGER constraint Conference_pk primary key, HomePage TEXT, -- FullName TEXT, -- ); CREATE TABLE Paper ( Title TEXT, -- ...
retail_complains
Calculate the average age of clients from the Midwest region.
average age = AVG(age);
SELECT CAST(SUM(T1.age) AS REAL) / COUNT(T3.Region) AS average FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T2.state_abbrev = T3.StateCode WHERE T3.Region = 'Midwest'
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
Give the postal code for the address No.65.
address no. 65 refers to address_id = 65
SELECT postal_code FROM address WHERE address_id = 65
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 ...
shipping
Among the shipments to a customer from Texas, what percentage of the shipments shipped in 2017?
"Texas" refers to state = 'TX'; shipped in 2017 refers to CAST(ship_date AS DATE) = 2017; percentage = Divide (Count (ship_id where CAST(ship_date AS DATE) = 2017), Count (ship_id)) * 100
SELECT CAST(SUM(CASE WHEN STRFTIME('%Y', T1.ship_date) = '2017' THEN 1 ELSE 0 END) AS REAL ) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.state = 'TX'
CREATE TABLE city ( population INTEGER, -- state TEXT, -- city_name TEXT, -- city_id INTEGER primary key, area REAL, -- ); CREATE TABLE driver ( driver_id INTEGER primary key, address TEXT, -- Example Values: `268 Richmond Ave`, `3574 Oak Limb Cv`, `1839 S Orleans St`, `3649 Park Lake Dr`, `749 E Mckell...
simpson_episodes
Please list the titles of the episodes that have over 200 voters voting a 10 in star score.
over 200 votes refers to votes > 200; 10 in star score refers to stars = 10
SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.votes > 200 AND T2.stars = 10;
CREATE TABLE Keyword ( foreign key (episode_id) references Episode(episode_id), keyword TEXT, -- primary key (episode_id, keyword), episode_id TEXT, -- ); CREATE TABLE Vote ( foreign key (episode_id) references Episode(episode_id), votes INTEGER, -- episode_id TEXT, -- percent REAL, -- stars INTEGER...
authors
What is the name of author with the ID of 1722?
null
SELECT Name FROM Author WHERE Id = 1722
CREATE TABLE Journal ( FullName TEXT, -- ShortName TEXT, -- HomePage TEXT, -- Id INTEGER constraint Journal_pk primary key, ); CREATE TABLE Conference ( ShortName TEXT, -- Id INTEGER constraint Conference_pk primary key, HomePage TEXT, -- FullName TEXT, -- ); CREATE TABLE Paper ( Title TEXT, -- ...
retail_complains
Which division is Diesel Galloway in?
null
SELECT T2.division FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.first = 'Diesel' AND T1.last = 'Galloway'
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
Who is the owner of email address "JEREMY.HURTADO@sakilacustomer.org"? Give the full name.
"JEREMY.HURTADO@sakilacustomer.org" is the email; owner refers to customer; full name refers to first_name, last_name
SELECT first_name, last_name FROM customer WHERE email = 'JEREMY.HURTADO@sakilacustomer.org'
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 ...
shipping
How many shipments were shipped to the most densely populated city?
most densely populated city refers to Max(Divide(area, population))
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T2.area / T2.population DESC LIMIT 1
CREATE TABLE city ( population INTEGER, -- state TEXT, -- city_name TEXT, -- city_id INTEGER primary key, area REAL, -- ); CREATE TABLE driver ( driver_id INTEGER primary key, address TEXT, -- Example Values: `268 Richmond Ave`, `3574 Oak Limb Cv`, `1839 S Orleans St`, `3649 Park Lake Dr`, `749 E Mckell...
simpson_episodes
List down all the roles of Matt Groening on the episode titled 'In the Name of the Grandfather' along with the episode number and series number.
"Matt Groening" is the person; 'In the Name of the Grandfather' is the title of episode; episode number refers to episode; series number refers to number_in_series
SELECT T2.role, T1.episode, T1.number_in_series FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.person = 'Matt Groening' AND T1.title = 'In the Name of the Grandfather';
CREATE TABLE Keyword ( foreign key (episode_id) references Episode(episode_id), keyword TEXT, -- primary key (episode_id, keyword), episode_id TEXT, -- ); CREATE TABLE Vote ( foreign key (episode_id) references Episode(episode_id), votes INTEGER, -- episode_id TEXT, -- percent REAL, -- stars INTEGER...
authors
List all of the conferences where a paper was published in 2008.
Published in 2008 refer to Year = 2008
SELECT DISTINCT T2.FullName FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Year = 2008
CREATE TABLE Journal ( FullName TEXT, -- ShortName TEXT, -- HomePage TEXT, -- Id INTEGER constraint Journal_pk primary key, ); CREATE TABLE Conference ( ShortName TEXT, -- Id INTEGER constraint Conference_pk primary key, HomePage TEXT, -- FullName TEXT, -- ); CREATE TABLE Paper ( Title TEXT, -- ...
retail_complains
Please list the full names of all the clients whose complaints are still in progress.
full name = first, middle, last; complaints are still in progress refers to "Company response to consumer" = 'In progress';
SELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Company response to consumer` = 'In progress'
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
Give the number of inactive customers.
inactive refers to active = 0
SELECT COUNT(customer_id) FROM customer WHERE active = 0
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 ...
simpson_episodes
What's the title of the episode that got the most 7-star votes in star score?
7-stars vote refers to stars = 7;  most refers to Max(votes)
SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 7 ORDER BY T2.votes DESC LIMIT 1;
CREATE TABLE Keyword ( foreign key (episode_id) references Episode(episode_id), keyword TEXT, -- primary key (episode_id, keyword), episode_id TEXT, -- ); CREATE TABLE Vote ( foreign key (episode_id) references Episode(episode_id), votes INTEGER, -- episode_id TEXT, -- percent REAL, -- stars INTEGER...
authors
What is the proportion of the papers that have the keyword "cancer"? Please provide a list of authors and their affiliations.
Proportion refer to DIVIDE(COUNT(Keyword = ’cancer’), COUNT(PaperID))
SELECT CAST(SUM(CASE WHEN T1.Keyword = 'cancer' THEN 1 ELSE 0 END) AS REAL) / COUNT(T1.Id), T2.Name, T2.Affiliation FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId
CREATE TABLE Journal ( FullName TEXT, -- ShortName TEXT, -- HomePage TEXT, -- Id INTEGER constraint Journal_pk primary key, ); CREATE TABLE Conference ( ShortName TEXT, -- Id INTEGER constraint Conference_pk primary key, HomePage TEXT, -- FullName TEXT, -- ); CREATE TABLE Paper ( Title TEXT, -- ...
retail_complains
For how long did the complaint filed on 2017/3/27 by Rachel Hicks last?
how long did the complaint filed last refers to ser_time; on 2017/3/27 refers to "Date received" = '2017-03-27';
SELECT T2.ser_time FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.first = 'Rachel' AND T1.last = 'Hicks' AND T2.`Date received` = '2017-03-27'
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
What is Diane Collins' email address?
null
SELECT email FROM customer WHERE first_name = 'DIANE' AND last_name = 'COLLINS'
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 ...
shipping
List the driver's name of the shipment with a weight greater than 95% of the average weight of all shipments.
weight greater than 95% of average weight refers to weight > Multiply (AVG(weight), 0.95); driver name refers to first_name, last_name
SELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.weight * 100 > ( SELECT 95 * AVG(weight) FROM shipment )
CREATE TABLE city ( population INTEGER, -- state TEXT, -- city_name TEXT, -- city_id INTEGER primary key, area REAL, -- ); CREATE TABLE driver ( driver_id INTEGER primary key, address TEXT, -- Example Values: `268 Richmond Ave`, `3574 Oak Limb Cv`, `1839 S Orleans St`, `3649 Park Lake Dr`, `749 E Mckell...
simpson_episodes
Name the title of the episode where Pamela Hayden voiced the character 'Ruthie.'
"Pamela Hayden" is the person; voice the character 'Ruthie' refers to role = 'Ruthie'
SELECT T1.title FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.person = 'Pamela Hayden' AND T2.role = 'Ruthie';
CREATE TABLE Keyword ( foreign key (episode_id) references Episode(episode_id), keyword TEXT, -- primary key (episode_id, keyword), episode_id TEXT, -- ); CREATE TABLE Vote ( foreign key (episode_id) references Episode(episode_id), votes INTEGER, -- episode_id TEXT, -- percent REAL, -- stars INTEGER...
authors
List the name of the author that affiliated with University of Illinois Chicago?
'University of Illinois Chicago' is an affiliation
SELECT Name FROM Author WHERE Affiliation = 'University of Illinois Chicago'
CREATE TABLE Journal ( FullName TEXT, -- ShortName TEXT, -- HomePage TEXT, -- Id INTEGER constraint Journal_pk primary key, ); CREATE TABLE Conference ( ShortName TEXT, -- Id INTEGER constraint Conference_pk primary key, HomePage TEXT, -- FullName TEXT, -- ); CREATE TABLE Paper ( Title TEXT, -- ...
retail_complains
How many complaints on credit cards in the year 2016 were filed by male clients?
credit cards refers to Product = 'Credit card'; 2016 refers to year(Date received) = 2016; male refers to sex = 'Male';
SELECT COUNT(T1.sex) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE strftime('%Y', T2.`Date received`) = '2016' AND T1.sex = 'Male' AND T2.Product = 'Credit card'
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
What is the average duration time of the films starring PENELOPE GUINESS?
average duration time = AVG(length)
SELECT AVG(T3.length) 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 = 'PENELOPE' AND T1.last_name = 'GUINESS'
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 ...
shipping
What is the customer's address for the shipment with ship ID 1117?
null
SELECT T2.address FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T1.ship_id = '1117'
CREATE TABLE city ( population INTEGER, -- state TEXT, -- city_name TEXT, -- city_id INTEGER primary key, area REAL, -- ); CREATE TABLE driver ( driver_id INTEGER primary key, address TEXT, -- Example Values: `268 Richmond Ave`, `3574 Oak Limb Cv`, `1839 S Orleans St`, `3649 Park Lake Dr`, `749 E Mckell...
public_review_platform
How many of the users who use a high number of compliments do not have any fans?
do not have fans refers to user_fans = 'None'; high number of compliment refers to number_of_compliments = 'High'
SELECT COUNT(T2.user_id) FROM Users_Compliments AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id WHERE T1.number_of_compliments = 'High' AND T2.user_fans = 'None'
CREATE TABLE Attributes ( attribute_name TEXT, -- attribute_id INTEGER constraint Attributes_pk primary key, ); CREATE TABLE Elite ( year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ...
book_publishing_company
What's the publisher of the book "Silicon Valley Gastronomic Treats"? Give the publisher's name.
publisher name refers to pub_name; Silicon Valley Gastronomic Treats is the title of a book
SELECT T2.pub_name FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T1.title = 'Silicon Valley Gastronomic Treats'
CREATE TABLE jobs ( max_lvl INTEGER not null, -- Example Values: `10`, `250`, `225`, `200`, `175` | Value Statics: Total count 14 - Distinct count 8 - Null count 0 job_desc TEXT not null, -- Example Values: `New Hire - Job not specified`, `Chief Executive Officer`, `Business Operations Manager`, `Chief Financial O...
movie_3
Among all films that the customer RUTH MARTINEZ has rented, what is the percentage of it being a Music film?
music film refers to name = 'Music'; percentage = Divide (Count(film_id where name = 'Music'), Count(film_id)) * 100
SELECT CAST(SUM(IIF(T3.name = 'Music', 1, 0)) AS REAL) * 100 / COUNT(T1.film_id) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id INNER JOIN inventory AS T4 ON T1.film_id = T4.film_id INNER JOIN customer AS T5 ON T4.store_id = T5.stor...
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 ...
authors
Please list all of the associations that the authors of the paper "FIBER: A Generalized Framework for Auto-tuning Software" are affiliated with.
paper "FIBER: A Generalized Framework for Auto-tuning Software" refers to Title = 'FIBER: A Generalized Framework for Auto-tuning Software'; are affiliated with refers to Affiliation
SELECT DISTINCT T2.Affiliation FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = 'FIBER: A Generalized Framework for Auto-tuning Software'
CREATE TABLE Journal ( FullName TEXT, -- ShortName TEXT, -- HomePage TEXT, -- Id INTEGER constraint Journal_pk primary key, ); CREATE TABLE Conference ( ShortName TEXT, -- Id INTEGER constraint Conference_pk primary key, HomePage TEXT, -- FullName TEXT, -- ); CREATE TABLE Paper ( Title TEXT, -- ...
retail_complains
What was the serve time for the complaint call from client "C00007127" on 2017/2/22?
serve time refers to ser_time; longer ser_time means more verbose or longer complaint; on 2017/2/22 refers to "Date received" = '2017-02-22';
SELECT T1.ser_time FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.Client_ID = 'C00007127' AND T1.`Date received` = '2017-02-22'
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
What is the average replacement cost of the films under the category of "Horror"?
"Horror" is the name of category; average replacement cost = Divide (Sum(replacement_cost), Count(film_id where name = Horror))
SELECT AVG(T3.replacement_cost) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.name = 'Horror'
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 ...
language_corpus
List all the Catalan language wikipedia page title with less than 10 number of different words in these pages.
less than 10 number of different words refers to words < 10
SELECT title FROM pages WHERE words < 10
CREATE TABLE words ( occurrences INTEGER DEFAULT 0, -- word TEXT UNIQUE, -- wid INTEGER PRIMARY KEY AUTOINCREMENT, ); CREATE TABLE langs ( lid INTEGER PRIMARY KEY AUTOINCREMENT, pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0 lang TEXT...
simpson_episodes
What is the average number of stars received by the episode titled 'Wedding for Disaster.'
"Wedding for Disaster" is the title of episode; average number of stars = Divide(Sum(stars), Count(stars))
SELECT AVG(T2.stars) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Wedding for Disaster';
CREATE TABLE Keyword ( foreign key (episode_id) references Episode(episode_id), keyword TEXT, -- primary key (episode_id, keyword), episode_id TEXT, -- ); CREATE TABLE Vote ( foreign key (episode_id) references Episode(episode_id), votes INTEGER, -- episode_id TEXT, -- percent REAL, -- stars INTEGER...
authors
State the title of papers published in the Ibm Journal of Research and Development.
Ibm Journal of Research and Development refer to FullName 'Ibm Journal of Research and Development' is the full name of paper
SELECT T2.Title FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.FullName = 'Ibm Journal of Research and Development'
CREATE TABLE Journal ( FullName TEXT, -- ShortName TEXT, -- HomePage TEXT, -- Id INTEGER constraint Journal_pk primary key, ); CREATE TABLE Conference ( ShortName TEXT, -- Id INTEGER constraint Conference_pk primary key, HomePage TEXT, -- FullName TEXT, -- ); CREATE TABLE Paper ( Title TEXT, -- ...
retail_complains
What is the percentage of the increase of complaints filed by the clients from New York from the year 2016 to the year 2017?
percentage of increase = MULTIPLY(DIVIDE(SUBTRACT(SUM(year("Date received") = 2017), SUM(year("Date received") = 2016)), SUM(year("Date received") = 2016)), 1.0); New York refers to city = 'New York'; year("Date received") BETWEEN 2016 AND 2017;
SELECT 100.0 * (SUM(CASE WHEN strftime('%Y', T2.`Date received`) = '2017' THEN 1 ELSE 0 END) - SUM(CASE WHEN strftime('%Y', T2.`Date received`) = '2016' THEN 1 ELSE 0 END)) / SUM(CASE WHEN strftime('%Y', T2.`Date received`) = '2016' THEN 1 ELSE 0 END) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Clien...
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
Among all the films starring PENELOPE GUINESS, what is the title of the one with the highest rental price per day?
highest rental price per day refers to Max(Divide(rental_rate, rental_duration))
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 = 'PENELOPE' AND T1.last_name = 'GUINESS' ORDER BY T3.rental_rate / T3.rental_duration 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 ...
authors
How many papers are preprint or not published?
preprint or not published refer to Year = 0;
SELECT COUNT(Id) FROM Paper WHERE Year = 0 OR (ConferenceId = 0 AND JournalId = 0)
CREATE TABLE Journal ( FullName TEXT, -- ShortName TEXT, -- HomePage TEXT, -- Id INTEGER constraint Journal_pk primary key, ); CREATE TABLE Conference ( ShortName TEXT, -- Id INTEGER constraint Conference_pk primary key, HomePage TEXT, -- FullName TEXT, -- ); CREATE TABLE Paper ( Title TEXT, -- ...
book_publishing_company
Find and list the full name of employees who were hired between 1990 and 1995. Also, arrange them in the descending order of job level.
job level refers to job_lvl; YEAR(hire_date) between 1990 and 1995
SELECT fname, minit, lname FROM employee WHERE STRFTIME('%Y', hire_date) BETWEEN '1990' AND '1995' ORDER BY job_lvl DESC
CREATE TABLE jobs ( max_lvl INTEGER not null, -- Example Values: `10`, `250`, `225`, `200`, `175` | Value Statics: Total count 14 - Distinct count 8 - Null count 0 job_desc TEXT not null, -- Example Values: `New Hire - Job not specified`, `Chief Executive Officer`, `Business Operations Manager`, `Chief Financial O...
movie_3
Which customer has rented more movies, RUTH MARTINEZ or LINDA WILLIAMS?
rented more movie Max(Count(customer_id)); "RUTH MARTINEZ" and "LINDA WILLIAMS" are both full name of customer
SELECT T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, COUNT(T1.customer_id) AS num FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE (T1.first_name = 'RUTH' AND T1.last_name = 'MARTINEZ') OR (T1.first_name = 'LINDA' AND T1.last_name = 'WILLIAMS') GROUP BY T1.firs...
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 ...
shipping
Calculate the difference between the number of shipments shipped by the truck with the model year 2005 and model year 2006.
"2005" and "2006" are both model_year of truck; difference = Subtract (Count (ship_id where model_year = 2005), Count(ship_id where model_year = 2006))
SELECT SUM(CASE WHEN T1.model_year = '2005' THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.model_year = '2006' THEN 1 ELSE 0 END) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id
CREATE TABLE city ( population INTEGER, -- state TEXT, -- city_name TEXT, -- city_id INTEGER primary key, area REAL, -- ); CREATE TABLE driver ( driver_id INTEGER primary key, address TEXT, -- Example Values: `268 Richmond Ave`, `3574 Oak Limb Cv`, `1839 S Orleans St`, `3649 Park Lake Dr`, `749 E Mckell...
simpson_episodes
What is the percentage of Primetime Emmy nominated episodes with a rating over 7 to all the episodes that have a rating over 7?
"Primetime Emmy' is the award_category;  rating over 7 refers to rating > 7; nominated refers to result = 'Nominee'; percentage = Divide(Count(episode_id(award_category = 'Primetime Emmy')), Count (episode_id)) * 100
SELECT CAST(SUM(CASE WHEN T1.award_category = 'Primetime Emmy' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.rating > 7 AND T1.result = 'Nominee';
CREATE TABLE Keyword ( foreign key (episode_id) references Episode(episode_id), keyword TEXT, -- primary key (episode_id, keyword), episode_id TEXT, -- ); CREATE TABLE Vote ( foreign key (episode_id) references Episode(episode_id), votes INTEGER, -- episode_id TEXT, -- percent REAL, -- stars INTEGER...
authors
How many papers were published in 2005. Calculate the difference between the number of paper published in 2005 and the number of paper published in the previous year.
published in 2005 refer to Year = 2005; Difference refer to SUBTRACT(SUM(Year = 2005). SUM(Year = 2004))
SELECT SUM(CASE WHEN Year = 2005 THEN 1 ELSE 0 END) , SUM(CASE WHEN year = 2005 THEN 1 ELSE 0 END) - SUM(CASE WHEN year = 2004 THEN 1 ELSE 0 END) AS diff FROM Paper
CREATE TABLE Journal ( FullName TEXT, -- ShortName TEXT, -- HomePage TEXT, -- Id INTEGER constraint Journal_pk primary key, ); CREATE TABLE Conference ( ShortName TEXT, -- Id INTEGER constraint Conference_pk primary key, HomePage TEXT, -- FullName TEXT, -- ); CREATE TABLE Paper ( Title TEXT, -- ...
retail_complains
Which detailed product did Mr Lennox Oliver Drake complain about?
detailed product refers to "Sub-product"; Mr refers to sex = 'Male';
SELECT DISTINCT T2.`Sub-product` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Lennox' AND T1.middle = 'Oliver' AND T1.last = 'Drake' AND T1.sex = 'Male'
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
Which film is rented for the most times by the customers? Please give its title.
film refers to title; film rented the most times refers to title where Max(Count(rental_id))
SELECT T.title FROM ( SELECT T1.title, COUNT(T3.rental_id) AS num FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id INNER JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id GROUP BY T1.title ) AS T ORDER BY T.num 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 ...
language_corpus
List the titles for all Catalan language wikipedia page from revision page id 106600 to 106700.
from revision page id 106600 to 106700 refers to revision BETWEEN 106600 AND 106700
SELECT title FROM pages WHERE revision BETWEEN 106600 AND 106700
CREATE TABLE words ( occurrences INTEGER DEFAULT 0, -- word TEXT UNIQUE, -- wid INTEGER PRIMARY KEY AUTOINCREMENT, ); CREATE TABLE langs ( lid INTEGER PRIMARY KEY AUTOINCREMENT, pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0 lang TEXT...
simpson_episodes
What is the percentage ratio between uncredited and credited roles on the episode that won the 2017 Jupiter Award for Best International TV Series? Please include the title of the episode and the names of the persons who were uncredited alongside their role in that episode.
uncredited refers to credited = ''; credited refers to credited = 'true'; won refers to result = 'Winner'; 2017 is the year; 'Jupiter Award' is the award_category; 'Best International TV Series' is the award; percentage ratio = Divide (SUM(credited = ''), SUM(credited = 'true')) * 100
SELECT CAST(SUM(CASE WHEN T2.credited = 'false' THEN 1 END) AS REAL) * 100 / SUM(CASE WHEN T2.credited = 'true' THEN 1 END), T3.title, T2.person FROM Award AS T1 INNER JOIN Credit AS T2 ON T2.episode_id = T1.episode_id INNER JOIN Episode AS T3 ON T1.episode_id = T3.episode_id WHERE SUBSTR(T1.year, 1, 4) = '2017' AND T1...
CREATE TABLE Keyword ( foreign key (episode_id) references Episode(episode_id), keyword TEXT, -- primary key (episode_id, keyword), episode_id TEXT, -- ); CREATE TABLE Vote ( foreign key (episode_id) references Episode(episode_id), votes INTEGER, -- episode_id TEXT, -- percent REAL, -- stars INTEGER...
retail_complains
What is the average number of complaints on credit cards filed by clients from New York in the 3 consecutive years starting from 2015?
average = AVG(Complaint ID); credit cards refers to Product = 'Credit card'; New York refers to city = 'New York'; 3 consecutive years starting from 2015 refers to "Date received" BETWEEN 2015 AND 2017;
SELECT CAST(COUNT(T2.`Complaint ID`) AS REAL) / 3 AS average FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE strftime('%Y', T2.`Date received`) BETWEEN '2015' AND '2017' AND T1.city = 'New York City' AND T2.Product = 'Credit card'
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
Among the customers who have rented the film ACADEMY DINOSAUR, how many of them are active?
"ACADEMY DINOSAUR" is the title of film; customer refers to customer_id; active refers to active = 1
SELECT COUNT(T1.customer_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T1.active = 1 AND T4.title = 'ACADEMY DINOSAUR'
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 ...
language_corpus
Name the longest Catalan language Wikipedia page title and state the number of different words in this page.
longest title refers to max(length(title))
SELECT title, words FROM pages WHERE title = ( SELECT MAX(LENGTH(title)) FROM pages )
CREATE TABLE words ( occurrences INTEGER DEFAULT 0, -- word TEXT UNIQUE, -- wid INTEGER PRIMARY KEY AUTOINCREMENT, ); CREATE TABLE langs ( lid INTEGER PRIMARY KEY AUTOINCREMENT, pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0 lang TEXT...
simpson_episodes
Write down the title and summary of the episode with the keyword 'eviction.'
null
SELECT T1.title, T1.summary FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword = 'eviction';
CREATE TABLE Keyword ( foreign key (episode_id) references Episode(episode_id), keyword TEXT, -- primary key (episode_id, keyword), episode_id TEXT, -- ); CREATE TABLE Vote ( foreign key (episode_id) references Episode(episode_id), votes INTEGER, -- episode_id TEXT, -- percent REAL, -- stars INTEGER...
authors
How many author published papers in the 'IEEE Computer' journal?
IEEE Computer refer to FullName; How many author published papers refer to COUNT(PaperAuthor.Name) where FullName = ’IEEE Computer’
SELECT COUNT(T2.Name) FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId INNER JOIN Journal AS T3 ON T1.JournalId = T3.Id WHERE T3.FullName = 'IEEE Computer'
CREATE TABLE Journal ( FullName TEXT, -- ShortName TEXT, -- HomePage TEXT, -- Id INTEGER constraint Journal_pk primary key, ); CREATE TABLE Conference ( ShortName TEXT, -- Id INTEGER constraint Conference_pk primary key, HomePage TEXT, -- FullName TEXT, -- ); CREATE TABLE Paper ( Title TEXT, -- ...
retail_complains
Which district did the review on 2018/9/11 come from? Give the name of the city.
on 2018/9/11 refers to Date = '2017-07-22';
SELECT T2.district_id, T2.city FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Date = '2018-09-11'
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
Please give the full name of the customer that have rented the most films.
full name refers to first_name, last_name; customer who rented the most film refers to Max(count(rental_id))
SELECT T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, COUNT(T2.rental_id) AS num FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.first_name, T1.last_name ) AS T ORDER BY T.num 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 ...
language_corpus
What is the title of Catalan language wikipedia page with revision page id '16203226'?
revision page id '16203226' refers to revision = 16203226
SELECT title FROM pages WHERE revision = 16203226
CREATE TABLE words ( occurrences INTEGER DEFAULT 0, -- word TEXT UNIQUE, -- wid INTEGER PRIMARY KEY AUTOINCREMENT, ); CREATE TABLE langs ( lid INTEGER PRIMARY KEY AUTOINCREMENT, pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0 lang TEXT...
simpson_episodes
What is the birth name of the person who voiced 'Helen Lovejoy?'
voiced refers to role; role = 'Helen Lovejoy"
SELECT DISTINCT T1.birth_name FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T2.role = 'Helen Lovejoy';
CREATE TABLE Keyword ( foreign key (episode_id) references Episode(episode_id), keyword TEXT, -- primary key (episode_id, keyword), episode_id TEXT, -- ); CREATE TABLE Vote ( foreign key (episode_id) references Episode(episode_id), votes INTEGER, -- episode_id TEXT, -- percent REAL, -- stars INTEGER...
retail_complains
Which product received a review from Indianapolis on 2016/10/7?
Indianapolis refers to state = 'Indianapolis'; on 2016/10/7 refers to Date = '2013-04-04';
SELECT T1.Product FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.city = 'Indianapolis' AND T1.Date = '2016-10-07'
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
How many films rented to the customer RUTH MARTINEZ were returned in August, 2005?
returned in August, 2005 refers to year(return_date) = 2005 and month (return_date) = 8
SELECT COUNT(T1.customer_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'RUTH' AND T1.last_name = 'MARTINEZ' AND STRFTIME('%m',T2.return_date) = '8' AND STRFTIME('%Y', T2.return_date) = '2005'
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 ...
simpson_episodes
List the name of all awards along with the award category, nominated by Marc Wilmore.
"Marc Wilmore" is the name of person
SELECT award_id, award_category FROM Award WHERE person = 'Marc Wilmore';
CREATE TABLE Keyword ( foreign key (episode_id) references Episode(episode_id), keyword TEXT, -- primary key (episode_id, keyword), episode_id TEXT, -- ); CREATE TABLE Vote ( foreign key (episode_id) references Episode(episode_id), votes INTEGER, -- episode_id TEXT, -- percent REAL, -- stars INTEGER...
authors
How many papers were in the journal "Iet Software/iee Proceedings - Software"?
journal "Iet Software/iee Proceedings - Software" refers to FullName = 'Iet Software/iee Proceedings - Software'; papers refers to COUNT(JournalId)
SELECT COUNT(T1.JournalId) FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T2.FullName = 'Iet Software/iee Proceedings - Software'
CREATE TABLE Journal ( FullName TEXT, -- ShortName TEXT, -- HomePage TEXT, -- Id INTEGER constraint Journal_pk primary key, ); CREATE TABLE Conference ( ShortName TEXT, -- Id INTEGER constraint Conference_pk primary key, HomePage TEXT, -- FullName TEXT, -- ); CREATE TABLE Paper ( Title TEXT, -- ...
retail_complains
How many days delay for the complaint call from Mr. Brantley Julian Stanley on 2012/5/18?
days delay for the complaint = SUBTRACT("date sent to company", "Date received"); Mr refers to sex = 'Male'; on 2012/5/18 refers to "Date received" = '2012-05-18';
SELECT 365 * (strftime('%Y', T2.`Date sent to company`) - strftime('%Y', T2.`Date received`)) + 30 * (strftime('%M', T2.`Date sent to company`) - strftime('%M', T2.`Date received`)) + (strftime('%d', T2.`Date sent to company`) - strftime('%d', T2.`Date received`)) AS days FROM client AS T1 INNER JOIN events AS T2 ON T1...
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
Please list the full names of all the customers who have rented the film with the highest replacement cost.
full name refers to first_name, last_name; highest replacement cost refers to Max(replacement_cost)
SELECT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id ORDER BY T4.replacement_cost 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 ...
shipping
Among the shipments for Downey, how many shipments were shipped to California in 2016?
"Downey" is the city_name; 'California' is the state, whose abbreviation is CA; in 2016 refers to year(ship_date) = 2016,
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T3.cust_id = T1.cust_id WHERE T2.city_name = 'Downey' AND STRFTIME('%Y', T1.ship_date) = '2016' AND T3.state = 'CA'
CREATE TABLE city ( population INTEGER, -- state TEXT, -- city_name TEXT, -- city_id INTEGER primary key, area REAL, -- ); CREATE TABLE driver ( driver_id INTEGER primary key, address TEXT, -- Example Values: `268 Richmond Ave`, `3574 Oak Limb Cv`, `1839 S Orleans St`, `3649 Park Lake Dr`, `749 E Mckell...
simpson_episodes
Write the title and all the keywords of the episode that was aired on 3/22/2009.
aired on 3/22/2009 refers to air_date = '2009-03-22'
SELECT T1.title, T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.air_date = '2009-03-22';
CREATE TABLE Keyword ( foreign key (episode_id) references Episode(episode_id), keyword TEXT, -- primary key (episode_id, keyword), episode_id TEXT, -- ); CREATE TABLE Vote ( foreign key (episode_id) references Episode(episode_id), votes INTEGER, -- episode_id TEXT, -- percent REAL, -- stars INTEGER...
retail_complains
What was the detailed issue did Mr Gunner Omer Fuller complain about?
detailed issue refers to Sub-issue; Mr refers to sex = 'Male';
SELECT T2.`Sub-issue` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Gunner' AND T1.middle = 'Omer' AND T1.last = 'Fuller' AND T1.sex = 'Male'
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
Among the films that the customer RUTH MARTINEZ has rented, what is the title of the one with the highest replacement cost?
highest replacement cost refers to Max(replacement_cost)
SELECT T4.title FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T1.first_name = 'RUTH' AND T1.last_name = 'MARTINEZ' ORDER BY T4.replacement_cost 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 ...
language_corpus
List the page id of wikipedia about Catalan language which have the appearance of the word 'decimal'?
have the appearance of 'decimal' refers to word = 'decimal'
SELECT T2.pid FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'decimal'
CREATE TABLE words ( occurrences INTEGER DEFAULT 0, -- word TEXT UNIQUE, -- wid INTEGER PRIMARY KEY AUTOINCREMENT, ); CREATE TABLE langs ( lid INTEGER PRIMARY KEY AUTOINCREMENT, pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0 lang TEXT...
simpson_episodes
How many persons were born in New York, USA?
"New York" is the birth_place; 'USA' is the birth_region
SELECT COUNT(name) FROM Person WHERE birth_place = 'New York City' AND birth_country = 'USA';
CREATE TABLE Keyword ( foreign key (episode_id) references Episode(episode_id), keyword TEXT, -- primary key (episode_id, keyword), episode_id TEXT, -- ); CREATE TABLE Vote ( foreign key (episode_id) references Episode(episode_id), votes INTEGER, -- episode_id TEXT, -- percent REAL, -- stars INTEGER...
authors
Calculate the average of authors for each paper from the year of 1990 to 2000.
Average refer to DIVIDE(COUNT(AuthorID where Year = 1990 BETWEEN 2000), COUNT(Title where Year = 1990 BETWEEN 2000))
SELECT CAST(COUNT(DISTINCT T2.AuthorId) AS REAL) / COUNT(DISTINCT T1.Title) FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Year BETWEEN 1990 AND 2000
CREATE TABLE Journal ( FullName TEXT, -- ShortName TEXT, -- HomePage TEXT, -- Id INTEGER constraint Journal_pk primary key, ); CREATE TABLE Conference ( ShortName TEXT, -- Id INTEGER constraint Conference_pk primary key, HomePage TEXT, -- FullName TEXT, -- ); CREATE TABLE Paper ( Title TEXT, -- ...
retail_complains
List all the server of the phone complaints with a late response from the company.
phone complaint refers to Submitted via = 'Phone'; late response refers to Timely response? = 'No'
SELECT DISTINCT T2.server FROM events AS T1 INNER JOIN callcenterlogs AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T1.`Submitted via` = 'Phone' AND T1.`Timely response?` = 'No'
CREATE TABLE state ( Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 State TEXT, -- StateCode TEXT constraint state_pk primary key, ); CREATE TABLE callcenterlogs ( ser_time TEXT, -- "Complaint ID" TEXT, -- ser_exi...
movie_3
Among the films that the customer RUTH MARTINEZ has rented, how many of them are released in 2006?
release in 2006 refers to release_year = 2006
SELECT COUNT(T1.customer_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T4.release_year = 2006 AND T1.first_name = 'RUTH' AND T1.last_name = 'MARTINEZ'
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 ...
language_corpus
List the page number for Catalan language wikipedia pages containing the word 'Art' in the page title.
containing the word 'Art' refers to title LIKE '% Art %'
SELECT page FROM pages WHERE title LIKE 'Art%' OR title LIKE '%Art%' OR title LIKE '%Art'
CREATE TABLE words ( occurrences INTEGER DEFAULT 0, -- word TEXT UNIQUE, -- wid INTEGER PRIMARY KEY AUTOINCREMENT, ); CREATE TABLE langs ( lid INTEGER PRIMARY KEY AUTOINCREMENT, pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0 lang TEXT...