db_id
stringclasses
66 values
question
stringlengths
24
325
evidence
stringlengths
1
673
gold_query
stringlengths
23
804
db_schema
stringclasses
66 values
public_review_platform
How many open businesses in the City of Phoenix have users left a long review?
open businesses refers to active = 'true'; long review refers to review_length = 'Long'
SELECT COUNT(DISTINCT T2.business_id) FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T1.review_length = 'Long' AND T2.active = 'true' AND T2.city = 'Phoenix'
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 ...
authors
State the name and affiliation of author for the 'Education, democracy and growth' paper?
Education, democracy and growth' refer to title of paper
SELECT T2.Name, T2.Affiliation FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = 'Education, democracy and growth'
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 state does the owner of "wyatt.collins@gmail.com" live in? Give the full name of the state.
full name of the state refers to state_name;
SELECT T1.state FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.email = 'wyatt.collins@gmail.com'
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 titles of all the films that the customer RUTH MARTINEZ has rented.
null
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'
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 first words of the biwords pair where the second word is 'antic'.
first words refer to w1st.word; second word is 'antic' refers to w2nd.word = 'antic'
SELECT T1.word FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st WHERE T2.w2nd = ( SELECT wid FROM words WHERE word = 'antic' )
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
Find the average height for each person.
average high = Divide(Sum(height_meters), Count(name))
SELECT AVG(height_meters) FROM Person;
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 International Workshop on Inductive Logic Programming from 2001 to 2009?
From 2001 to 2009 refer to Year 2001 BETWEEN 2009; 'International Workshop on Inductive Logic Programming' refer to Conference.FullName
SELECT COUNT(T1.Id) FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T2.FullName = 'International Workshop on Inductive Logic Programming' AND T1.Year BETWEEN 2001 AND 2009
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
Among the female clients, how many of them have a complaint with a priority of 1?
female refers to sex = 'Female'
SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.sex = 'Female' AND T2.priority = 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
For how many times has the customer RUTH MARTINEZ rented a film?
times of rented refers to Count(rental_id)
SELECT COUNT(T2.rental_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'
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
How many Catalan language wikipedia pages have between 1000 to 2000 number of different words?
between 1000 to 2000 number of different words refers to words BETWEEN 1000 AND 2000
SELECT COUNT(pid) FROM pages WHERE words BETWEEN 1000 AND 2000
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 episodes have more than 1000 votes?
more than 1000 votes refers to votes > 1000
SELECT COUNT(episode_id) FROM Episode WHERE votes > 1000;
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 title of the paper that was written by Cheng Huang and affiliated with Microsoft?
paper that was written by Cheng Huang refers to Name = 'Cheng Huang'; affiliated with Microsoft refers to Affiliation LIKE 'Microsoft %'
SELECT T1.Title FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T2.Name = 'Cheng Huang' AND T2.Affiliation = 'Microsoft'
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 name and phone number of clients who submitted the complaint via fax.
full name = first, middle, last; submitted the complaint via fax refers to "Submitted via" = 'fax';
SELECT T1.first, T1.middle, T1.last, T1.phone FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Submitted via` = 'Fax'
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 titles of all the films under the category of "Horror" and has a rental rate of $2.99.
"Horror" is the name of category; rental rate of $2.99 refers to rental_rate = 2.99
SELECT T1.title 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 WHERE T3.name = 'Horror' AND T1.rental_rate = 2.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 ...
language_corpus
Which word has the most occurrences within the same page of wikipedia about Catalan language?
most occurrences refers to max(occurrences)
SELECT T1.word FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T2.occurrences = ( SELECT MAX(occurrences) FROM pages_words )
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...
retail_complains
What is the name of the state that the client with the email "skylar.ramirez@gmail.com" lives in?
null
SELECT T3.state FROM state AS T1 INNER JOIN district AS T2 ON T1.StateCode = T2.state_abbrev INNER JOIN client AS T3 ON T2.district_id = T3.district_id WHERE T3.email = 'skylar.ramirez@gmail.com'
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 are there under the category of "Horror"?
"Horror" is the name of category
SELECT COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_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 ...
retail_complains
What was the phone of number of the client who made the complaint call "CR0100432" ?
complaint call refers to Complaint ID;
SELECT T1.phone FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Complaint ID` = 'CR0100432'
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 titles of all the films in the category of "Horror".
"Horror" is the name of category
SELECT T1.title 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 WHERE T3.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
Calculate the average number of the word occurrences in which ‘system’ appeared as the first word in the pair.
average word occurrences = divide(sum(occurrences), count(occurrences)); ‘system’ appeared as the first word refers to w1st = 'system'
SELECT AVG(T2.occurrences) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st WHERE T2.w1st = ( SELECT wid FROM words WHERE word = 'sistema' )
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
Among the person nominated for the Comedy Series Award in 2009, how many of them were born in California?
nominated refers to result = 'Nominee'; born in California refers to birth_place = 'California'; in 2009 refers to year = 2009
SELECT COUNT(*) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.year = 2009 AND T2.award = 'Comedy Series' AND T1.birth_region = 'California';
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 is the author of the publication named 'Real-Time Automata'?
'Real-Time Automata' is the title of paper; publication refers to title;
SELECT T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = 'Real-Time Automata'
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 issues of the complaints made by Kaitlyn Eliza Elliott.
null
SELECT DISTINCT T2.Issue FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Kaitlyn' AND T1.middle = 'Eliza' AND T1.last = 'Elliott'
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 title of the film with the longest duration time and stars PENELOPE GUINESS?
longest duration of film refers to Max(length)
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.length 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
What was the maximum weight of the shipment carried to Boston? Name the customer of that shipment.
"Boston" is the city_name; maximum weight refers to Max(weight); customer refers to cust_name
SELECT T1.weight, T2.cust_name FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T1.city_id WHERE T3.city_name = 'Boston' ORDER BY T1.weight 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
How many crew have their own nickname? List their full name along with the nickname.
crew refers to Person; full name refers to name; have nickname refers to nickname IS NOT NULL
SELECT COUNT(name) FROM Person WHERE nickname IS NOT NULL;
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
Where was the 'A context-based navigation paradigm for accessing Web data' paper published? State the name of the conference.
A context-based navigation paradigm for accessing Web data' is the title of paper; name of conference refer to FullName
SELECT T2.FullName FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Title = 'A context-based navigation paradigm for accessing Web data'
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 complaint calls from Mr Mason Javen Lopez has got the consent provided by the customer?
percentage = MULTIPLY(DIVIDE(SUM("Consumer consent provided?" = 'Consent provided'), COUNT(client_id)), 1.0); Mr refers to sex = 'Male'; consent provided by the customer refers to "Consumer consent provided?" = 'Consent provided';
SELECT CAST(SUM(CASE WHEN T2.`Consumer consent provided?` = 'Consent provided' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.`Consumer consent provided?`) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.sex = 'Male' AND T1.first = 'Mason' AND T1.middle = 'Javen' AND T1.last = 'Lopez'
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 starring PENELOPE GUINESS, how many of them are in English?
"English" is the name of language
SELECT COUNT(T3.film_id) 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 INNER JOIN language AS T4 ON T3.language_id = T4.language_id WHERE T4.name = 'English' AND 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 ...
language_corpus
What is the word id of the catalan language that was repeated no more than 10 times in the said language?
word id refers to wid; repeated no more than 10 times refers to occurrences < = 10
SELECT wid FROM langs_words WHERE occurrences <= 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...
retail_complains
List all the states in the South region.
null
SELECT state FROM state WHERE Region = 'South'
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 actors that have starred in the film with the highest replacement cost.
highest replacement cost refers to Max (replacement_cost); full name refers to first_name, last_name
SELECT first_name, last_name 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 ORDER BY T3.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
Show all the title of pages and number of occurences for each page where the word 'quipu' appears.
word 'quipu' appears refers to word = 'quipu'
SELECT T1.title, T2.occurrences FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid INNER JOIN words AS T3 ON T2.wid = T3.wid WHERE T3.word = 'quipu'
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
List the name character awarded for the Outstanding Voice-Over Performance award in 2009.
in 2009 refers to year = 2009
SELECT T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.year = 2009 AND T1.award = 'Outstanding Voice-Over Performance';
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
Provide the title of the latest publication published by it's author 'Zuliang Du'.
'Zuliang Du' is the name of paper author; latest publication refers to MAX(Year)
SELECT T2.Title FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T1.Name = 'Zuliang Du' ORDER BY T2.Year 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
Who is the owner of the final phone number for the complaints on server "MORIAH" on 9/11/2013?
owner refers to first, middle, last; on 9/11/2013 refers to Date received = '2013-09-11'
SELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.server = 'MORIAH' AND T2.`Date received` = '2013-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 title of the film starring PENELOPE GUINESS and has the highest replacement cost.
highest replacement cost refers to Max (replacement_cost)
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.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
In the Catalan language, which biwords pair appeared the most in this language/page?
biwords pair refers to w1st.word w2nd.word; appeared the most refers to max(occurrences)
SELECT w1st, w2nd FROM biwords WHERE occurrences = ( SELECT MAX(occurrences) FROM biwords )
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...
authors
Indicate the year and a full name of the journal in which the publication named 'Area Effects in Cepaea' was published.
'Area Effects in Cepaea' is the title of paper
SELECT T1.Year, T2.FullName FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T1.Title = 'Area Effects in Cepaea'
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 priority urgent complaints were received in march of 2017? List the complaint ID of these complaints.
urgent complaints refers to priority = 2; march of 2017 refers to "Date received" BETWEEN '2017-01-01' AND '2017-01-31';
SELECT COUNT(`Complaint ID`) FROM callcenterlogs WHERE `Date received` LIKE '2017-01%' AND priority = ( SELECT MAX(priority) FROM callcenterlogs )
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 starring PENELOPE GUINESS, how many of them are released in 2006?
release in 2006 refers to release_year = 2006;
SELECT COUNT(T2.film_id) 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 T3.release_year = 2006 AND 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
Identify the total weight of shipments transported to San Mateo, California, in 2016.
"San Mateo" is the city_name; in 2016 refers to Cast(ship_date as DATE) = 2016
SELECT SUM(T1.weight) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.city_name = 'San Mateo' 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
What is the title of episode that has a keyword of 'riot' and 'cake'?
"riot" and "cake" are both keyword
SELECT DISTINCT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword IN ('riot', 'cake');
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 region has the second most clients?
region refers to division; second most refers to second max(client_id)
SELECT T2.division FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id GROUP BY T2.division ORDER BY COUNT(T2.division) DESC LIMIT 1, 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
Please list the full names of all the actors that have starred in the film ACADEMY DINOSAUR.
full name refers to first_name, last_name; "ACADEMY DINOSAUR" is the title of film
SELECT T1.first_name, T1.last_name 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 T3.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 ...
authors
Provide the number of publications published in the journal named 'Academic Medicine' between 2005 and 2010.
'Academic Medicine' is the FullName of journal; between 2005 and 2010 refer to Year 2005 BETWEEN 2010
SELECT COUNT(T2.JournalId) FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.FullName = 'Academic Medicine' AND T2.Year BETWEEN 2005 AND 2010
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
Which city did Victoria P Ashworth work in?
null
SELECT T2.city FROM employee AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T1.fname = 'Victoria' AND T1.minit = 'P' AND T1.lname = 'Ashworth'
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
How many actors have starred in the film ACADEMY DINOSAUR?
"ACADEMY DINOSAUR" is the title of film
SELECT COUNT(T1.actor_id) FROM film_actor AS T1 INNER JOIN film AS T2 ON T1.film_id = T2.film_id WHERE T2.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
What is the wikipedia page id of Arqueozoologia?
page id refers to pid; Arqueozoologia refers to title = 'Arqueozoologia'
SELECT page FROM pages WHERE title = 'Arqueozoologia'
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
Calculate the difference between the highest votes for episode and the lowest votes for episode.
highest vote refers to Max(votes); lowest vote refers to Min(votes); difference = Subtract(Max(votes), Min(votes))
SELECT MAX(votes) - MIN(votes) FROM Vote;
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 percentage of complaints are from the elderly?
elder refers to age < = 65; percentage refers to divide(sum(age < = 65) , count(client_id)) * 100%
SELECT CAST(SUM(CASE WHEN T1.age > 65 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.age) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID
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 titles of all the films starring the actor PENELOPE GUINESS.
null
SELECT T2.title FROM film_actor AS T1 INNER JOIN film AS T2 ON T1.film_id = T2.film_id INNER JOIN actor AS T3 ON T1.actor_id = T3.actor_id WHERE T3.first_name = 'PENELOPE' AND T3.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 ...
language_corpus
What is the total pages of Wikipedia in Catalan language?
total pages refers to sum(pages); Catalan language refers to lang = 'ca'
SELECT pages FROM langs WHERE lang = 'ca'
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
List the name of persons who were not included in the credit for the 'How the Test Was Won' episode.
"How the Test Was Won" is the title of episode; not included in the credit refers to credited = ' '; name of person refers to person
SELECT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'How the Test Was Won' AND T2.credited = 'false';
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 full name of the conference where paper number 5 was published?
paper number 5 refers to Id = 5
SELECT T2.FullName FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Id = 5
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 name, date of birth, and email id of the elderly clients in descending order of age.
full name = first, middle, last; date of birth = year, month, day; elderly clients refers to age > 65;
SELECT first, middle, last, year, month , day, email FROM client WHERE age > 65 ORDER BY age DESC
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 are in English?
"English" is the name of language
SELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T2.name = 'English'
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 ...
public_review_platform
What is the average number of stars for businesses in the Obstetricians & Gynecologists category?
Obstetricians & Gynecologists category refers to category_name = 'Obstetricians & Gynecologists'; calculation = AVG(stars)
SELECT CAST(SUM(T1.stars) AS REAL) / COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id WHERE T3.category_name = 'Obstetricians & Gynecologists'
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 ...
authors
Please provide the full name of the conference where one of the papers of Jean-luc Hainaut were published.
papers of Jean-luc Hainaut refers to Name = 'Jean-luc Hainaut'
SELECT DISTINCT T3.FullName FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId INNER JOIN Conference AS T3 ON T1.ConferenceId = T3.Id WHERE T2.Name = 'Jean-luc Hainaut' 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
Compute the average time in minute for each age group
teenager refers to 13 < age < = 19; adult refers to 19 < age < = 65; elder refers to age < = 65; highest average time per complaint = max(divide(sum(ser_time), count(ser_time)))
SELECT CAST(SUM(CASE WHEN T1.age > 13 AND T1.age <= 19 THEN 60 * strftime('%H', ser_time) + strftime('%M', ser_time) + strftime('%S', ser_time) / 60 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.age > 13 AND T1.age <= 19 THEN 1 ELSE 0 END) AS teenagerAverageMins, CAST(SUM(CASE WHEN T1.age > 19 AND T1.age <= 65 THEN 60 * strf...
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 language of the film ACADEMY DINOSAUR?
"ACADEMY DINOSAUR" is the title of film; language refers to language.name
SELECT T2.name FROM film AS T1 INNER JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T1.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
What are the titles of the top 5 Catalan language Wikipedia page with the least number of different words? Indicate each title's word id that has appeared the most in the said pages.
least number of different words refers to min(words); word id refers to wid; appeared the most refers to max(occurrences)
SELECT T1.title FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid ORDER BY T1.words LIMIT 5
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
Name all the person who involved in the making of simpson 20s episode that aired between October to November.
aired between October to November refers to strftime('%m', air_date) between '10' and '11';
SELECT DISTINCT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.air_date, 6, 2) BETWEEN '10' AND '11';
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
Provide the average number of papers that are published in the journal named 'Information Sciences' annually.
'Information Sciences' is the FullName of journal; average = DIVIDE(COUNT(JournalId = 48), COUNT(Years))
SELECT CAST(COUNT(T2.JournalId) AS REAL) / COUNT(DISTINCT T2.Year) FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.FullName = 'Information Sciences'
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
In 1994 which title had less order quanty than the average order quantity? Find the title name, type and price.
orders in 1994 refers to YEAR(ord_date) = 1994; order quantity refers to number of order expressed by ord_num; average order quantity = DIVIDE(SUM(ord_num), COUNT(title_id))
SELECT DISTINCT T1.title, T1.type, T1.price FROM titles AS T1 INNER JOIN sales AS T2 ON T1.title_id = T2.title_id WHERE T2.ord_date LIKE '1994%' AND T2.Qty < ( SELECT CAST(SUM(T4.qty) AS REAL) / COUNT(T3.title_id) FROM titles AS T3 INNER JOIN sales AS T4 ON T3.title_id = T4.title_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
Please list the titles of the top 3 films with the highest replacement cost.
highest replacement_cost refers to Max (replacement_cost); film refers to title
SELECT title FROM film WHERE replacement_cost = ( SELECT MAX(replacement_cost) FROM film ) LIMIT 3
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 the Catalan language Wikipedia page that has the highest number of different words?
highest number of different words refers to max(words)
SELECT title FROM pages WHERE words = ( SELECT MAX(words) 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
What is the title of episode that won the Best International TV Series Award in 2017?
won refers to result = 'Winner'; in 2017 refers to year = 2017
SELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.year, 1, 4) = '2017' AND T1.award = 'Best International TV Series' AND T1.result = 'Winner';
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
Provide the name of the author who is affiliated with the organization named 'ABB Electrical Machines'.
'ABB Electrical Machines' is an affiliation
SELECT Name FROM Author WHERE Affiliation = 'ABB Electrical Machines'
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
Among the teenager clients who use Google account and Microsoft account, which group of client is more than the other?
teenager refers to 13 < age < = 19; Google account refers to email like '%@gmail.com'; Microsoft account refers to email like '%@outlook.com'
SELECT CASE WHEN SUM(CASE WHEN email LIKE '%@gmail.com' THEN 1 ELSE 0 END) > SUM(CASE WHEN email LIKE '%@outlook.com' THEN 1 ELSE 0 END) THEN 'Google account' ELSE 'Microsoft account' END FROM client WHERE age BETWEEN 13 AND 19
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
In which year was the film with the highest replacement cost released?
highest replacement_cost refers to Max (replacement_cost); year refers to release_year
SELECT DISTINCT release_year FROM film WHERE replacement_cost = ( SELECT MAX(replacement_cost) FROM film )
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
Based on the credits, state how many roles were played in the 5th episode of simpson 20.
5th episode refers to episode = 5
SELECT COUNT(DISTINCT T2.role) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.episode = 5;
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
Among all publications containing keywords 'Turbulent Fluids', what percentage of them was published in the journal named 'Physics of Fluids'?
'Physics of Fluids' is the FullName of journal; percentage = DIVIDE(SUM(Keyword = 'Turbulent Fluids'), SUM(FullName = 'Physics of Fluids')) as percentage
SELECT CAST(SUM(CASE WHEN T1.Keyword = 'Turbulent Fluids' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.FullName = 'Physics of Fluids' THEN 1 ELSE 0 END) FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id
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 stars did "Eagle Capital" received from Little Rock on 2013/4/4?
Eagle Capital refers to Product = 'Eagle Capital'; Little Rock is a city; on 2013/4/4 refers to Date = '2013-04-04';
SELECT COUNT(T1.Stars) FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Product = 'Eagle Capital' AND T2.city = 'Little Rock' AND T1.Date = '2013-04-04'
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 names of all the active staff.
full name refers to first_name, last_name; active staff refers to active = 1
SELECT first_name, last_name FROM staff 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 ...
authors
How many publications were published in relation to the conference 'Adaptive Multimedia Retrieval' in 2007?
'Adaptive Multimedia Retrieval is the FullName of paper; in 2007 refer to Year = 2007
SELECT COUNT(T2.ConferenceId) FROM Conference AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.ConferenceId WHERE T1.FullName = 'Adaptive Multimedia Retrieval' AND T2.Year = 2007
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 percentage of male clients from Indianapolis City.
male refers to sex = 'Male'; Indianapolis City refers to city = 'Indianapolis'; percentage = divide(count(client_id where sex = 'Male' and city = 'Indianapolis') , count(client_id where city = 'Indianapolis')) * 100%
SELECT CAST(SUM(CASE WHEN sex = 'Male' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(client_id) FROM client WHERE city = 'Indianapolis'
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 email address of the staff Jon Stephens?
null
SELECT email FROM staff WHERE first_name = 'Jon' AND last_name = 'Stephens'
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
In Abadia, what is the word id of the of the Catalan language that appeared the highest amount of times? Indicate the how many times did they said word id appeared.
Abadia refers to title = 'Abadia'; word id refers to wid; the highest amount of times refers to max(occurrences)
SELECT T2.wid, T2.occurrences FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.title = 'Abadia' ORDER BY T2.occurrences DESC LIMIT 1
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...
retail_complains
What is the first name of clients who have the highest priority?
first name refers to first; highest priority refers to priority = 2
SELECT T1.first FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.priority = ( SELECT MAX(priority) FROM callcenterlogs )
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 titles of all the films that have more than 2 special features.
more than 2 special features refers to Count(special_features) > 2
SELECT title FROM ( SELECT title, COUNT(special_features) AS num FROM film GROUP BY title ) AS T ORDER BY T.num > 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 ...
shipping
Determine the percentage of manufacturers who are from Texas among all of Lorenzo's customers.
"Texas" refers to state = 'TX'; 'manufacturer' is the cust_type; percentage = Divide (Count(cust_id where state = 'TX'), Count(cust_id)) * 100
SELECT CAST(SUM(CASE WHEN cust_type = 'manufacturer' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM customer WHERE 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
Which episode has the most vote for 10 stars rating?
10 stars rating refers to stars = 10; most vote 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 = 10 ORDER BY T1.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
List out the full name and URL link of ICCI?
'ICCI' is the ShortName of conference; URL refer to HomePage
SELECT FullName, HomePage FROM Conference WHERE ShortName = 'ICCI'
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
Tell me about the information of the French publisher.
French publisher means publisher in France where country = 'France'
SELECT T1.pr_info FROM pub_info AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.country = 'France'
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
How many films with the rental rate of $2.99 have the special feature of "Deleted Scenes"?
rental rate of $2.99 refers to rental_rate = 2.99; film refers to title
SELECT COUNT(film_id) FROM film WHERE rental_rate = 2.99 AND special_features = 'Deleted Scenes'
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
How many times did the word pair "i" and "a" appeared in the Cataln language/page?
times appeared refers to occurrences; word pair "i" and "a" refers to w1st.word = 'i' w2st.word = 'a'
SELECT SUM(occurrences) FROM biwords WHERE w1st = 86 AND w2nd = 109
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
State the name of director for the 'Treehouse of Horror XIX' episode.
"Treehouse of Horror XIX" is the title of episode; 'director' is the role of person; name refers to person
SELECT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Treehouse of Horror XIX' AND T2.role = 'director';
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 publications were published by author named 'Howard F. Lipson'?
'Howard F. Lipson' is the name of author
SELECT COUNT(PaperId) FROM PaperAuthor WHERE Name = 'Howard F. Lipson'
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 down the email of client whose complaint is type "PS".
null
SELECT T1.email FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.type = 'PS'
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 are released in 2006, how many of them are rated Adults Only in the Motion Picture Association Film Rating?
released in 2006 refers to release_year = 2006; rated Adults Only refers to rating = 'NC-17'
SELECT COUNT(film_id) FROM film WHERE rating = 'NC-17' AND release_year = 2006
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 all the keyword for 'Take My Life, Please' episode.
"Take My Life,Please" 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 = 'Take My Life, Please';
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
Indicate the number of authors affiliated with the organization named 'Arizona State University'.
'Arizona State University' is an affiliation
SELECT COUNT(Name) FROM Author WHERE Affiliation = 'Arizona State University'
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 full name of client whose email address is emily.garcia43@outlook.com?
full name refers to first middle last
SELECT first, middle, last FROM client WHERE email = 'emily.garcia43@outlook.com'
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...
mondial_geo
What province does the 4th most populous city in the United Kingdom belong to, and how many people live there?
null
SELECT T1.Province, T1.Population FROM city AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T2.Name = 'United Kingdom' ORDER BY T1.Population DESC LIMIT 3, 1
CREATE TABLE politics ( Government TEXT, -- Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade, Independence DATE, -- Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `...
books
Among all addresses provided by customers, identify the percentage that are not in use anymore.
address not in use refers to address_status = 'Inactive'; percentage = Divide (Count(address_status = 'Inactive'), Count(address_status)) * 100
SELECT CAST(SUM(CASE WHEN T2.address_status = 'Inactive' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM customer_address AS T1 INNER JOIN address_status AS T2 ON T2.status_id = T1.status_id
CREATE TABLE order_line ( book_id INTEGER references book, -- price REAL, -- line_id INTEGER primary key autoincrement, order_id INTEGER references cust_order, -- ); CREATE TABLE customer ( customer_id INTEGER primary key, first_name TEXT, -- last_name TEXT, -- email TEXT, -- ); CREATE TABLE book_...
regional_sales
Sate the order number and calculate the net profit for each order under Joshua Bennett.
net profit can be computed as SUBTRACT(Unit Price, Unit Cost); Joshua Bennett is the name of Sales Team;
SELECT T1.OrderNumber , REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T2.`Sales Team` = 'Joshua Bennett'
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
mondial_geo
What is the name of the country whose citizens have the lowest purchasing power?
Inflation can reduce purchasing power over time for recipients and payers.
SELECT T2.Name FROM economy AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code ORDER BY T1.Inflation DESC LIMIT 1
CREATE TABLE politics ( Government TEXT, -- Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade, Independence DATE, -- Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `...
books
What is the average number of book pages written by Zilpha Keatley Snyder?
"Zilpha Keatley Snyder" is the author_name; average number of book pages refers to AVG(num_pages)
SELECT AVG(T3.num_pages) FROM book_author AS T1 INNER JOIN author AS T2 ON T1.author_id = T2.author_id INNER JOIN book AS T3 ON T3.book_id = T1.book_id WHERE T2.author_name = 'Zilpha Keatley Snyder'
CREATE TABLE order_line ( book_id INTEGER references book, -- price REAL, -- line_id INTEGER primary key autoincrement, order_id INTEGER references cust_order, -- ); CREATE TABLE customer ( customer_id INTEGER primary key, first_name TEXT, -- last_name TEXT, -- email TEXT, -- ); CREATE TABLE book_...
regional_sales
Calculate the average net profit for bakeware product.
net profit can be computed as SUBTRACT(Unit Price, Unit Cost); AVG(net profit) where Product Name = 'Bakeware';
SELECT AVG(REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '')) FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T2.`Product Name` = 'Bakeware'
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...