db_id
stringclasses
66 values
question
stringlengths
24
325
evidence
stringlengths
1
673
gold_query
stringlengths
23
804
db_schema
stringclasses
66 values
mondial_geo
On what date did the country have a gross domestic product 400% higher than Saint Kitts and Nevis become independent?
GDP refers to gross domestic product
SELECT Independence FROM politics WHERE country = ( SELECT country FROM economy WHERE GDP = 1100 )
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: `...
retail_complains
Calculate the average number of complaints received from New Bedford each year which are closed with explanation.
average = AVG("Complaint ID"); New Bedford refers to city = 'New Bedford'; closed with explanation refers to Company response to consumer = 'Closed with explanation';
SELECT STRFTIME('%Y', T3.`Date received`) , CAST(SUM(CASE WHEN T3.`Company response to consumer` = 'Closed with explanation' THEN 1 ELSE 0 END) AS REAL) / COUNT(T3.`Complaint ID`) AS average FROM callcenterlogs AS T1 INNER JOIN client AS T2 ON T1.`rand client` = T2.client_id INNER JOIN events AS T3 ON T1.`Complaint 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
What is the full name of the customer who rented the highest number of movies of all time?
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 T2.first_name, T2.last_name, COUNT(T1.rental_id) AS num FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.first_name, T2.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 ...
mondial_geo
Of all the countries of the Hindu religion, which has the lowest ratio of people per square meter of surface?
ratio of people per square meter of surface = Population / Area
SELECT T1.Name FROM country AS T1 INNER JOIN religion AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Hindu' ORDER BY T1.Population / T1.Area ASC 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: `...
shipping
What is the most populated city in California?
in California refers to state = 'CA'; most populated city refers to Max(population)
SELECT city_name FROM city WHERE state = 'California' AND population = ( SELECT MAX(population) FROM city WHERE state = 'California' )
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 stars does each of the 3 top users with the most likes in their reviews have?
more likes mean this tip is more valuable; the most likes refers to MAX(likes); stars refers to users_average_stars
SELECT T2.user_average_stars FROM Tips AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id GROUP BY T2.user_id ORDER BY SUM(T1.likes) DESC LIMIT 3
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
Give the number of papers that were published on "IEEE Transactions on Nuclear Science" in 1999.
'IEEE Transactions on Nuclear Science' is the FullName of journal; 1999 refers to Year = '1999'; papers refers to Paper.Id
SELECT COUNT(T2.Id) FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.FullName = 'IEEE Transactions on Nuclear Science' AND T2.Year = 1999
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 percentage of consumers from Houston disputed complaints?
percentage = MULTIPLY(DIVIDE(SUM("Consumer disputed?" = 'Yes' AND city = 'Houston'), COUNT(client_id)), 1.0); Houston refers to city = 'Houston';
SELECT CAST(SUM(CASE WHEN T2.`Consumer disputed?` = 'Yes' AND T1.city = 'Houston' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.client_id) 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
Among the classic movies, how many movies have a rental rate of less than 1?
classic movie refers to name = 'Classics'; rental rate of less than 1 refers to rental_rate < 1; movie refers to film_id
SELECT COUNT(T1.film_id) 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 T3.rental_rate < 1 AND T2.name = 'Classics'
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 ...
mondial_geo
Of all the countries that share territory with more than one continent, in which of them does the average population not exceed 10 inhabitants per square kilometer?
null
SELECT NAME FROM country WHERE CODE IN ( SELECT country FROM encompasses GROUP BY country HAVING COUNT(continent) > 1 ) AND population / Area <= 10
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: `...
shipping
List all the name of the customers that received a shipment in February 2017.
shipment in February 2017 refers to ship_date LIKE '2017-02-%'; name of customer refers to cust_name
SELECT T1.cust_name FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T2.ship_date LIKE '2017-02%'
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...
citeseer
Calculate the percentage of words used in Agents class label.
percentage = (divide(count(word_cited_id where class_label = 'Agents')), (count(word_cited_id)))*100;
SELECT CAST(COUNT(DISTINCT CASE WHEN T1.class_label = 'Agents' THEN T2.word_cited_id ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT T2.word_cited_id) FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id
CREATE TABLE cites ( primary key (cited_paper_id, citing_paper_id), cited_paper_id TEXT not null, -- citing_paper_id TEXT not null, -- ); CREATE TABLE paper ( paper_id TEXT not null primary key, class_label TEXT not null, -- Example Values: `Agents`, `IR`, `ML`, `AI`, `DB` | Value Statics: Total count 3312 - ...
retail_complains
What is the email id of clients whose calls were hung?
email id refers to email; calls were hung refers to outcome = 'Hang';
SELECT T1.email FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.outcome = 'HANG'
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
List the names of the customers from India.
"India" is the country; name refers to first_name, last_name
SELECT T4.first_name, T4.last_name FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id INNER JOIN address AS T3 ON T2.city_id = T3.city_id INNER JOIN customer AS T4 ON T3.address_id = T4.address_id WHERE T1.country = 'India'
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 ...
mondial_geo
List all the seas with which the deepest sea merges.
null
SELECT T2.Sea2 FROM sea AS T1 INNER JOIN mergesWith AS T2 ON T1.Name = T2.Sea1 WHERE T1.Name = ( SELECT Name FROM sea ORDER BY Depth 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: `...
citeseer
What is the total number of word cited under that class labelled 'AI'?
null
SELECT COUNT(DISTINCT T2.word_cited_id) FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'AI'
CREATE TABLE cites ( primary key (cited_paper_id, citing_paper_id), cited_paper_id TEXT not null, -- citing_paper_id TEXT not null, -- ); CREATE TABLE paper ( paper_id TEXT not null primary key, class_label TEXT not null, -- Example Values: `Agents`, `IR`, `ML`, `AI`, `DB` | Value Statics: Total count 3312 - ...
retail_complains
How many Credit Card complaints did Sharon handle?
Credit Card refers to Product = 'Credit Card'; Sharon refers to server = 'SHARON';
SELECT COUNT(T1.`Complaint ID`) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.Product = 'Credit card' AND T1.server = 'SHARON'
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 cities are there in the United States?
"United States" is the country
SELECT COUNT(T2.city) FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id WHERE T1.country = 'United States'
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 ...
mondial_geo
In which group of islands is Rinjani Mountain located?
null
SELECT T1.Islands FROM island AS T1 INNER JOIN mountainOnIsland AS T2 ON T1.Name = T2.Island INNER JOIN mountain AS T3 ON T3.Name = T2.Mountain WHERE T3.Name = 'Rinjani'
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: `...
shipping
Who is the driver that transported the lightest weight of shipment? Provide the full name of the driver.
lightest weight refers to Min(weight); full 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 ORDER BY T1.weight ASC 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...
citeseer
Among all the DB class type citation, which word is the most frequently cited?
class type refers to class_label; class_label = 'DB'; word that is most frequently cited refers to max(count(word_cited_id);
SELECT T2.word_cited_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'DB' GROUP BY T2.word_cited_id ORDER BY COUNT(T2.word_cited_id) DESC LIMIT 1
CREATE TABLE cites ( primary key (cited_paper_id, citing_paper_id), cited_paper_id TEXT not null, -- citing_paper_id TEXT not null, -- ); CREATE TABLE paper ( paper_id TEXT not null primary key, class_label TEXT not null, -- Example Values: `Agents`, `IR`, `ML`, `AI`, `DB` | Value Statics: Total count 3312 - ...
authors
Please provide the titles of any two papers that are either preprinted or unpublished along with the full name of the journal to which those papers belong.
papers that are either preprinted or unpublished along refers to Year = 0
SELECT T1.Title, T2.FullName FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T1.Year < 1 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
Find and list the names of districts which has below-average stars for Eagle Capital.
below average = AVG(stars) < Stars; Eagle Capital refers to Product = 'Eagle Capital';
SELECT T2.division FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Product = 'Eagle Capital' AND T1.Stars > ( SELECT AVG(Stars) FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_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
How many customers are from the city of Lethbridge?
customer refers to customer_id
SELECT COUNT(T3.customer_id) FROM city AS T1 INNER JOIN address AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T2.address_id = T3.address_id WHERE T1.city = 'Lethbridge'
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 ...
mondial_geo
In which lake flows the river that is, in turn, the mouth of the Manicouagan River?
null
SELECT NAME FROM lake WHERE river = ( SELECT river FROM river WHERE NAME = 'Manicouagan' )
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: `...
shipping
How many shipments did Zachery Hicks transport goods to New York in the year 2016?
"New York" is the city_name; in 2016 refers to CAST(ship_date AS DATE) = 2016
SELECT COUNT(*) FROM city AS T1 INNER JOIN shipment AS T2 ON T1.city_id = T2.city_id INNER JOIN driver AS T3 ON T3.driver_id = T2.driver_id WHERE T3.first_name = 'Zachery' AND T3.last_name = 'Hicks' AND T1.city_name = 'New York' AND STRFTIME('%Y', T2.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...
public_review_platform
Calculate the percentage of users with a high number of fans who were elite in 2011.
users with a high number of fans refers to user_fans = 'High'; 2011 refers to actual_year = 2011; Calculation = DIVIDE(Elite.user_id where user_fans = 'High' AND actual_year = 2011, Elite.user_id where actual_year = 2011) * 100
SELECT CAST(SUM(CASE WHEN T3.user_fans = 'High' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.user_fans) FROM Years AS T1 INNER JOIN Elite AS T2 ON T1.year_id = T2.year_id INNER JOIN Users AS T3 ON T2.user_id = T3.user_id WHERE T1.actual_year = 2011
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
For the paper which was presented by "Zvezdan Protić", was it preprinted?
Year = 0 means this paper is preprint, or not published
SELECT CASE WHEN T1.Year = 0 THEN 'TRUE' ELSE 'FALSE' END FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T2.Name = 'Zvezdan Protić' AND T1.ConferenceId = 0 AND T1.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, -- ...
retail_complains
What is the number of complaints related to Credit cards came from female clients?
Credit cards refers to Product = 'Credit card'; female refers to sex = 'female';
SELECT COUNT(T1.sex) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.sex = 'Female' 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 complete address of store id 1?
complete address refers to address, address2, district
SELECT T3.address, T3.address2, T3.district FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id INNER JOIN address AS T3 ON T2.city_id = T3.city_id INNER JOIN store AS T4 ON T3.address_id = T4.address_id WHERE T4.store_id = 1
CREATE TABLE staff ( last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0 ...
mondial_geo
Of all the lakes in Bolivia, which is the deepest?
Bolivia is the country
SELECT T1.Name FROM lake AS T1 INNER JOIN geo_lake AS T2 ON T1.Name = T2.Lake INNER JOIN province AS T3 ON T3.Name = T2.Province INNER JOIN country AS T4 ON T4.Code = T3.Country WHERE T4.Name = 'Bolivia' ORDER BY T1.Depth 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: `...
shipping
What is the brand of the truck that is used to ship by Zachery Hicks?
brand of truck refers to make
SELECT DISTINCT T1.make FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id INNER JOIN driver AS T3 ON T3.driver_id = T2.driver_id WHERE T3.first_name = 'Zachery' AND T3.last_name = 'Hicks'
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 journal was the paper "Education, democracy and growth" published on? Give the full name of the journal.
'Education, democracy and growth' is the title of a paper
SELECT T1.FullName FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T2.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, -- ...
book_publishing_company
Find the difference between the average royalty of titles published by US and non US publishers?
US publisher refers publisher in the US where country = 'USA'; non-US publishers refers publisher not in the US where country! = 'USA'; difference = SUBTRACT(AVG(royalty) where country = 'USA', AVG(royalty) where country! = 'USA'))
SELECT (CAST(SUM(CASE WHEN T2.country = 'USA' THEN T1.royalty ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.country = 'USA' THEN 1 ELSE 0 END)) - (CAST(SUM(CASE WHEN T2.country != 'USA' THEN T1.royalty ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.country != 'USA' THEN 1 ELSE 0 END)) FROM titles AS T1 INNER JOIN publishers AS T2 O...
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
What is the rental price per day of the most expensive children's film?
children's film refers to name = 'Children'; average price per day of most expensive film = Max(Divide(rental_rate, rental_duration))
SELECT T1.rental_rate 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 = 'Children' ORDER BY T1.rental_rate / T1.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 ...
mondial_geo
Which two Asian countries share a border that is 1,782 kilometers long?
null
SELECT T4.Country1, T4.Country2 FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country INNER JOIN borders AS T4 ON T4.Country1 = T3.Code WHERE T1.Name = 'Asia' AND T4.Length = 1782
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: `...
shipping
What is the shipment ID of the heaviest shipment that Zachery Hicks transported?
shipment ID refers to ship_id; heaviest shipment refers to Max(weight)
SELECT T1.ship_id FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T2.first_name = 'Zachery' AND T2.last_name = 'Hicks' 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...
citeseer
List all the paper ID and its class type that cited the word 'word1002'.
class type refers to class_label;
SELECT T1.paper_id, T1.class_label FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T2.word_cited_id = 'word1002'
CREATE TABLE cites ( primary key (cited_paper_id, citing_paper_id), cited_paper_id TEXT not null, -- citing_paper_id TEXT not null, -- ); CREATE TABLE paper ( paper_id TEXT not null primary key, class_label TEXT not null, -- Example Values: `Agents`, `IR`, `ML`, `AI`, `DB` | Value Statics: Total count 3312 - ...
authors
Gives the home page of the conference where the paper "Increasing the Concurrency in Estelle" is presented.
'Increasing the Concurrency in Estelle' is the Title of the paper; home page of the conference refers to HomePage;
SELECT DISTINCT T2.HomePage FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Title = 'Increasing the Concurrency in Estelle'
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 the client who made the complaint call "CR0217298", what was his/her birthday?
complaint call refers to Complaint ID; birthday = year, month, day;
SELECT T1.month, T1.day FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Complaint ID` = 'CR0217298'
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 staff manager of the store with the most non-active customers?
most non-active customer refers to Max(Count(active = 0))
SELECT T.first_name, T.last_name FROM ( SELECT T3.first_name, T3.last_name, COUNT(T1.customer_id) AS num FROM customer AS T1 INNER JOIN store AS T2 ON T1.store_id = T2.store_id INNER JOIN staff AS T3 ON T2.store_id = T3.store_id WHERE T1.active = 0 GROUP BY T3.first_name, T3.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 ...
mondial_geo
On which continent is the country with the most erosion of real income?
highest inflation rate results in the most erosion of real income
SELECT T1.Name FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country INNER JOIN economy AS T4 ON T4.Country = T3.Code ORDER BY T4.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: `...
shipping
Identify the full name of the driver who delivered a shipment to the city of New York in February 2016.
"New York" is the city_name; in February 2016 refers to ship_date LIKE '2016-02%'; full name refers to first_name, last_name
SELECT T3.first_name, T3.last_name 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 T2.city_name = 'New York' AND T1.ship_date LIKE '2016-02%'
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 users who have received a low cool vote have also received at least 1 low cool vote for some of their reviews?
low cool vote for user refers to user_votes_cool = 'Low';  low cool vote for review refers to review_votes_cool = 'Low'
SELECT COUNT(DISTINCT T1.user_id) FROM Users AS T1 INNER JOIN Reviews AS T2 ON T1.user_id = T2.user_id WHERE T1.user_votes_cool = 'Low' AND T2.review_votes_cool = 'Low'
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
In the calls from the mountain division, how many are from teenage clients?
teenage refers to age BETWEEN 12 AND 20;
SELECT COUNT(T1.age) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.age BETWEEN 12 AND 20 AND T2.division = 'Mountain'
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 with a rental duration of 7 days, how many are comedies?
rental duration of 7 refers to rental_duration = 7; comedies refers to name = 'Comedy'
SELECT 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 WHERE T1.rental_duration = 7 AND T3.name = 'Comedy'
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 ...
mondial_geo
In which city is the lake located at coordinates longitude -85.35 and latitude 11.6?
null
SELECT T2.City FROM lake AS T1 INNER JOIN located AS T2 ON T1.Name = T2.Lake INNER JOIN province AS T3 ON T3.Name = T2.Province INNER JOIN city AS T4 ON T4.Province = T3.Name WHERE T1.Longitude = -85.35 AND T1.Latitude = 11.6
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: `...
citeseer
What is the class label of paper ID 'chakrabarti01integrating'. How many words were cited by this paper ID?
null
SELECT DISTINCT T1.class_label, COUNT(T2.word_cited_id) FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.paper_id = 'chakrabarti01integrating' GROUP BY T1.class_label
CREATE TABLE cites ( primary key (cited_paper_id, citing_paper_id), cited_paper_id TEXT not null, -- citing_paper_id TEXT not null, -- ); CREATE TABLE paper ( paper_id TEXT not null primary key, class_label TEXT not null, -- Example Values: `Agents`, `IR`, `ML`, `AI`, `DB` | Value Statics: Total count 3312 - ...
authors
What are the keywords for the paper which was published on "Modeling Identification and Control" in 1994?
'Modeling Identification and Control' is the FullName of the journal; 1994 refers to Year = '1994'; if the year is "0", it means this paper is preprint, or not published
SELECT T2.Keyword FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.FullName = 'Modeling Identification and Control' AND T2.Year = 1994
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
Identify by their ID all clients who did not give their consent permission.
did not give their consent permission refers to Consumer consent provided is null, 'N/A', or empty;
SELECT Client_ID FROM events WHERE `Consumer consent provided?` = 'N/A' OR 'Consumer consent provided?' IS NULL OR 'Consumer consent provided?' = ''
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 full name of the actor who starred in most movies?
full name refers to first_name, last_name; actor who starred in the most movies refers to actor_id where Max(Count(film_id))
SELECT T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, COUNT(T1.film_id) AS num FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.first_name, T2.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 ...
mondial_geo
In which city is the sea whose depth is 4232 meters less than that of the Bay of Bengal?
null
SELECT T2.City FROM sea AS T1 INNER JOIN located AS T2 ON T1.Name = T2.Sea INNER JOIN city AS T3 ON T3.Name = T2.City WHERE ( SELECT Depth FROM sea WHERE Name LIKE '%Bengal%' ) - T1.Depth = 4235
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: `...
shipping
How many shipments were shipped to the least populated city in California?
"California" is the state; least populated city refers to Min(population)
SELECT COUNT(T3.city_name) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id WHERE T3.state = 'California' ORDER BY T3.population ASC 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...
citeseer
Which paper ID cited the most word? In which class label does it belongs to?
most cited word refers to max(word_cited_id);
SELECT T1.paper_id, T1.class_label FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id GROUP BY T1.paper_id, T1.class_label ORDER BY COUNT(T2.word_cited_id) DESC LIMIT 1
CREATE TABLE cites ( primary key (cited_paper_id, citing_paper_id), cited_paper_id TEXT not null, -- citing_paper_id TEXT not null, -- ); CREATE TABLE paper ( paper_id TEXT not null primary key, class_label TEXT not null, -- Example Values: `Agents`, `IR`, `ML`, `AI`, `DB` | Value Statics: Total count 3312 - ...
authors
Tell the number of papers that were presented at "International Symposium on Software Testing and Analysis" conference.
'International Symposium on Software Testing and Analysis' is the FullName of the conference; papers refers to Paper.Id
SELECT COUNT(T1.Id) FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T2.FullName = 'International Symposium on Software Testing and Analysis'
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 are not in process with an agent?
not in process with an agent refers to outcome ! = 'AGENT';
SELECT COUNT(outcome) FROM callcenterlogs WHERE outcome != 'AGENT'
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 most common special features of science-fiction movies?
"science fiction" is the name of category; most common special features refers to Max(frequency(special_features))
SELECT T1.special_features 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 = 'sci-fi' ORDER BY T1.special_features 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 ...
mondial_geo
Which river with its mouth in the Donau River and a length greater than 500 km is located in Slovenia?
null
SELECT T2.River FROM country AS T1 INNER JOIN geo_river AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Slovenia' AND T2.River IN ( SELECT NAME FROM river WHERE Length > 500 AND River = 'Donau' )
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: `...
shipping
Provide the brand of the truck and the name of the driver that transported goods in Klett & Sons Repair.
"Klett & Sons Repair" is the cust_name; brand of truck refers to make; name of driver refers to first_name, last_name
SELECT T3.make, T4.first_name, T4.last_name FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN truck AS T3 ON T3.truck_id = T2.truck_id INNER JOIN driver AS T4 ON T4.driver_id = T2.driver_id WHERE T1.cust_name = 'Klett & Sons Repair'
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...
citeseer
List the words that are cited in both AI and IR class label.
null
SELECT DISTINCT T2.word_cited_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'AI' OR T1.class_label = 'IR'
CREATE TABLE cites ( primary key (cited_paper_id, citing_paper_id), cited_paper_id TEXT not null, -- citing_paper_id TEXT not null, -- ); CREATE TABLE paper ( paper_id TEXT not null primary key, class_label TEXT not null, -- Example Values: `Agents`, `IR`, `ML`, `AI`, `DB` | Value Statics: Total count 3312 - ...
authors
How many papers were presented at 'ECSQARU' in 2003?
Papers refers to Paper.Id; ECSQARU is the ShortName of the conference; 2003 refers to Year = '2003'
SELECT COUNT(T1.Id) FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T2.ShortName = 'ECSQARU' AND T1.Year = '2003'
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 review context from Jacksonville on 2017/7/22?
Jacksonville refers to city = 'Jacksonville'; on 2017/7/22 refers to Date = '2017-07-22';
SELECT T1.Reviews FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.city = 'Jacksonville' AND T1.Date = '2017-07-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 name of the most rented movie?
most rented movie 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 ...
mondial_geo
Which country with a city with a population between 50,000 and 300,000 inhabitants and which is a member of an organization established between 03/01/1991 and 04/30/1991 is also a member of the EBRD?
null
SELECT T2.Country FROM country AS T1 INNER JOIN isMember AS T2 ON T1.Code = T2.Country INNER JOIN organization AS T3 ON T3.Country = T2.Country INNER JOIN city AS T4 ON T4.Country = T3.Country WHERE T3.Abbreviation = 'EBRD' AND T4.Population BETWEEN 50000 AND 300000 AND T3.Established BETWEEN '1991-01-31' AND '1991-04-...
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: `...
shipping
Calculate the average number of shipments that Zachery Hicks shipped in year 2017.
in year 2017 refers to CAST(ship_date AS DATE) = 2017; percentage = Divide (Count(ship_id where first_name = 'Zachery' AND last_name = 'Hicks'), Count(ship_id)) * 100
SELECT CAST(SUM(CASE WHEN T2.first_name = 'Zachery' AND T2.last_name = 'Hicks' THEN T1.ship_id ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE STRFTIME('%Y', T1.ship_date) = '2017'
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...
citeseer
List all words cited in the AI class label.
null
SELECT DISTINCT T2.word_cited_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'AI'
CREATE TABLE cites ( primary key (cited_paper_id, citing_paper_id), cited_paper_id TEXT not null, -- citing_paper_id TEXT not null, -- ); CREATE TABLE paper ( paper_id TEXT not null primary key, class_label TEXT not null, -- Example Values: `Agents`, `IR`, `ML`, `AI`, `DB` | Value Statics: Total count 3312 - ...
authors
At which conference was the paper "Skew-Circulant Preconditioners for Systems of LMF-Based ODE Codes" presented?
'Skew-Circulant Preconditioners for Systems of LMF-Based ODE Codes' is the Title of the paper; conference refers to Conference.FullName
SELECT T2.FullName FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Title = 'Skew-Circulant Preconditioners for Systems of LMF-Based ODE Codes'
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 male clients in the Pacific division.
full names = first, middle, last; male refers to sex = 'Male';
SELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'Pacific' 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
How many films are categorized as 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 ...
mondial_geo
Based on the data shown at Target, what percentage of countries are non-Christian?
percentage of countries are non-Christian = [count(non-Christian) / count(non-Christian + Christian)] * 100%
SELECT 100 - (CAST(SUM(CASE WHEN Target = 'Christian' THEN 1 ELSE 0 END) AS REAL)) * 100 / COUNT(Country) FROM target
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: `...
citeseer
List all paper ID and its class type with more than 20 cited words.
class type refers to class_label; count(word_cited_id)>20
SELECT DISTINCT T1.paper_id, T1.class_label FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id GROUP BY T2.paper_id, T1.class_label HAVING COUNT(T2.word_cited_id) > 20
CREATE TABLE cites ( primary key (cited_paper_id, citing_paper_id), cited_paper_id TEXT not null, -- citing_paper_id TEXT not null, -- ); CREATE TABLE paper ( paper_id TEXT not null primary key, class_label TEXT not null, -- Example Values: `Agents`, `IR`, `ML`, `AI`, `DB` | Value Statics: Total count 3312 - ...
retail_complains
Which product got the most five stars, and how many?
most five stars refers to MAX(COUNT(stars = 5));
SELECT T.Product, MAX(T.num) FROM ( SELECT Product, COUNT(Stars) AS num FROM reviews WHERE Stars = 5 GROUP BY Product ) T
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 full name of the customer who rented movies for 7 consecutive days?
rented for 7 consecutive days refers to Subtract(return_date, rental_date) = 7; full name refers to first_name, last_name
SELECT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN ( SELECT customer_id, COUNT(*) AS num_days FROM ( SELECT *, date(days, '-' || rn || ' day') AS results FROM ( SELECT customer_id, days, row_number() OVER (PARTITION BY customer_id ORDER BY days) AS rn FROM ( SELECT DISTINCT customer_id, date(rental_date)...
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 ...
mondial_geo
Average length of the rivers flowing into the Donau River.
null
SELECT * FROM river WHERE Name = 'Donau'
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: `...
citeseer
On average, how many papers are under the ML class?
class refers to class_label; average = divide(count(paper_id where class_label = 'M')), (count(paper_id)));
SELECT CAST(COUNT(CASE WHEN class_label = 'ML' THEN paper_id ELSE NULL END) AS REAL) / COUNT(paper_id) FROM paper
CREATE TABLE cites ( primary key (cited_paper_id, citing_paper_id), cited_paper_id TEXT not null, -- citing_paper_id TEXT not null, -- ); CREATE TABLE paper ( paper_id TEXT not null primary key, class_label TEXT not null, -- Example Values: `Agents`, `IR`, `ML`, `AI`, `DB` | Value Statics: Total count 3312 - ...
authors
In the year 2012, which conference had the most papers presented? Give the short name of the conference.
Papers refers to Paper.Id; short name of the conference refers to Conference.ShortName
SELECT T2.ShortName FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Year = '2012' GROUP BY T1.ConferenceId ORDER BY COUNT(T1.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
For all the complaint callers on 2017/3/27, what percentage of the clients are females?
on 2017/3/27 refers to "Date received" = '2017-03-27'; percentage = MULTIPLY(DIVIDE(SUM(sex = 'Female' ), COUNT(client_id)), 1.0); females refers to sex = 'Female';
SELECT CAST(SUM(CASE WHEN T1.sex = 'Female' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.sex) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE 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
List the name of the films that can only be found in store id 2.
name of film refers to title
SELECT T1.title FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_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 ...
mondial_geo
Name of the capitals of the countries that have less than 99.95% less population than the country that has the most population.
null
SELECT Capital FROM country WHERE Population <= ( SELECT MAX(Population) - MAX(Population) * 0.9995 FROM country )
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: `...
shipping
Which headquarter's truck has the highest shipments in year 2016?
in 2016 refers to CAST(ship_date AS DATE) = 2016; make = 'Peterbilt' means headquarter is 'Texas (TX)', make = 'Mack' means headquarter is 'North Carolina (NC)', make = 'Kenworth' means headquarter is 'Washington (WA)'; highest shipment refers to MAX(COUNT(ship_id))
SELECT CASE WHEN T2.make = 'Peterbilt' THEN 'Texas (TX)' WHEN T2.make = 'Mack' THEN 'North Carolina (NC)' WHEN T2.make = 'Kenworth' THEN 'Washington (WA)' END AS "result" FROM shipment AS T1 INNER JOIN truck AS T2 ON T1.truck_id = T2.truck_id WHERE CAST(T1.ship_date AS DATE) = 2016 GROUP BY T2.make ORDER BY COUNT(T1.sh...
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 businesses with music_karaoke attribute are closed?
music_karaoke attribute refers to attribute_name = 'music_karaoke' AND attribute_value = 'true'; businesses are closed refers to active = 'false'
SELECT COUNT(T2.business_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T1.attribute_name = 'music_karaoke' AND T3.active = 'false' AND T2.attribute_value IN ('none', 'no', 'false')
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
What are the three journals that the papers written by Andrew Cain were published in? Please provide your answer with the full name of each journal.
written by Andrew Cain refers to Name = 'Andrew Cain'
SELECT T3.FullName 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 T2.Name = 'Andrew Cain'
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 all the clients from the New York city, how many of them have filed a complaint on the issue of Deposits and withdrawals?
null
SELECT COUNT(T2.Issue) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Issue = 'Deposits and withdrawals' AND T1.city = 'New York City'
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 are the names of the movies which Laura Brody starred in?
name of movie refers to title
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 = 'Laura' AND T1.last_name = 'Brody'
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 ...
mondial_geo
Of all the countries in which English is spoken, what percentage has English as their only language?
Percentage = [count(countries 100% English) / count(countries English)] * 100%
SELECT CAST(SUM(CASE WHEN T2.Percentage = 100 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Name) FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'English'
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: `...
shipping
List all the cities where Zachery Hicks transported goods.
city refers to city_name
SELECT DISTINCT T3.city_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id INNER JOIN city AS T3 ON T1.city_id = T3.city_id WHERE T2.first_name = 'Zachery' AND T2.last_name = 'Hicks'
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...
movie_3
How many rentals were returned on 5/27/2005?
return on 5/27/2005 refers to return_date = '2005-05-27'; rental refers to rental_id
SELECT COUNT(rental_id) FROM rental WHERE rental_date = '2005-05-27'
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 ...
mondial_geo
What percent of the non volcanic islands in the Lesser Antilles group of islands have an area of no more than 300 square kilometers?
Percent = [count(non volcanic islands Lesser Antilles area 300 or less) / count(non volcanic islands Lesser Antilles)] * 100%
SELECT SUM(CASE WHEN Area <= 300 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM island WHERE Islands = 'Lesser Antilles' AND (Type != 'volcanic' OR Type IS NULL)
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: `...
shipping
What is the average shipment weight carried by the oldest Mack?
"Mack" is the make; oldest refers to Min(model_year); average shipment weight refers to AVG(weight)
SELECT AVG(T2.weight) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T1.make = 'Mack'
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...
citeseer
Under what classification do the papers that cited word1163 belong?
null
SELECT DISTINCT T1.class_label FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T2.word_cited_id = 'word1163'
CREATE TABLE cites ( primary key (cited_paper_id, citing_paper_id), cited_paper_id TEXT not null, -- citing_paper_id TEXT not null, -- ); CREATE TABLE paper ( paper_id TEXT not null primary key, class_label TEXT not null, -- Example Values: `Agents`, `IR`, `ML`, `AI`, `DB` | Value Statics: Total count 3312 - ...
authors
How many times more for the papers that were presented at the "International Conference on Thermoelectrics" conference than "International Conference on Wireless Networks, Communications and Mobile Computing“ conference?
'International Conference on Thermoelectrics' AND 'International Conference on Wireless Networks, Communications and Mobile Computing' are the FullName of the conference; Papers refers to Paper.Id; Calculation = SUBTRACT(SUM(Paper.Id where FullName = 'International Conference on Thermoelectrics'), SUM(Paper.Id where Fu...
SELECT CAST(SUM(CASE WHEN T2.FullName = 'International Conference on Thermoelectrics' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.FullName = 'International Conference on Wireless Networks, Communications and Mobile Computing' THEN 1 ELSE 0 END) FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = 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
What is the full name of the client whose complaint on 2017/3/27 was received by MICHAL?
full names = first, middle, last; on 2017/3/27 refers to "Date received" = '2017-03-27'; MICHAL refers to server = 'MICHAL';
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.`Date received` = '2017-03-27' AND T2.server = 'MICHAL'
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 staff manager in store id 2?
staff manager refers to manager_staff_id
SELECT manager_staff_id FROM store WHERE 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 ...
mondial_geo
What percentage of the border does Angola share with each of the countries with which it borders?
null
SELECT SUM(CASE WHEN T2.Name = 'Angola' THEN T1.Length ELSE 0 END) * 100 / SUM(T1.Length) FROM borders AS T1 LEFT JOIN country AS T2 ON T1.Country1 = T2.Code
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: `...
citeseer
Name the paper which is cited most times and the paper which is cited least times? Also, find the number of times each one is cited.
null
SELECT cited_paper_id, COUNT(cited_paper_id), ( SELECT cited_paper_id FROM cites GROUP BY cited_paper_id ORDER BY COUNT(cited_paper_id) ASC LIMIT 1 ), ( SELECT COUNT(cited_paper_id) FROM cites GROUP BY cited_paper_id ORDER BY COUNT(cited_paper_id) ASC LIMIT 1 ) FROM cites GROUP BY cited_paper_id ORDER BY COUNT(cited_pa...
CREATE TABLE cites ( primary key (cited_paper_id, citing_paper_id), cited_paper_id TEXT not null, -- citing_paper_id TEXT not null, -- ); CREATE TABLE paper ( paper_id TEXT not null primary key, class_label TEXT not null, -- Example Values: `Agents`, `IR`, `ML`, `AI`, `DB` | Value Statics: Total count 3312 - ...
retail_complains
Among the clients born between 1980 and 2000, list the name of male clients who complained through referral.
born between 1980 and 2000 refers to year BETWEEN 1980 AND 2000; name = first, middle, last; male refers to sex = 'Male'; complained through refers to "Submitted via";
SELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.year BETWEEN 1980 AND 2000 AND T1.sex = 'Male' AND T2.`Submitted via` = 'Referral'
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 are the full names of all the active employees?
active employee refers to active = 1; full name refers to first_name, last_name
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 ...
mondial_geo
How many rivers belong to more than one country? Name the provinces where we can find them.
null
SELECT River, GROUP_CONCAT(Province) FROM geo_river GROUP BY River HAVING COUNT(DISTINCT Country) > 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: `...
shipping
How many shipments were shipped by the driver named Zachary Hicks?
null
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.driver_id = 23
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...
citeseer
How many papers were cited by schmidt99advanced cited word3555?
paper cited by refers to citing_paper_id; citing_paper_id = 'schmidt99advanced';
SELECT COUNT(T2.paper_id) FROM cites AS T1 INNER JOIN content AS T2 ON T1.cited_paper_id = T2.paper_id WHERE T1.citing_paper_id = 'schmidt99advanced' AND T2.word_cited_id = 'word3555'
CREATE TABLE cites ( primary key (cited_paper_id, citing_paper_id), cited_paper_id TEXT not null, -- citing_paper_id TEXT not null, -- ); CREATE TABLE paper ( paper_id TEXT not null primary key, class_label TEXT not null, -- Example Values: `Agents`, `IR`, `ML`, `AI`, `DB` | Value Statics: Total count 3312 - ...