db_id
stringclasses
66 values
question
stringlengths
24
325
evidence
stringlengths
1
673
gold_query
stringlengths
23
804
db_schema
stringclasses
66 values
language_corpus
How frequently did the words 1 and 25 appear together?
How frequently refers to occurrences;  word 1 refers to wid = 1; word 25 refers to wid = 25; appear together means pair, which is a relationship of two words: w1st and w2nd, where w1st is word id of the first word and w2nd is a word id of the second word;  w1st or w2nd = wid = 1; w1st or w2nd = wid = 25;
SELECT occurrences FROM biwords WHERE w1st = 1 AND w2nd = 25
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...
address
Who are the congress representatives of the postal points in Garfield?
Who are the congress representatives refer to first_name, last_name; Garfield is the city;
SELECT T3.first_name, T3.last_name FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T1.city = 'Garfield'
CREATE TABLE state ( name TEXT, -- abbreviation TEXT primary key, ); CREATE TABLE country ( zip_code INTEGER, -- foreign key (state) references state(abbreviation), county TEXT, -- primary key (zip_code, county), state TEXT, -- foreign key (zip_code) references zip_data(zip_code), ); CREATE TABLE area...
language_corpus
What is the language of the pair of words numbered 1 and 616?
Pair is a relationship of two words: w1st and w2nd, where w1st is word id of the first word and w2nd is a word id of the second word; w1st = 1; w2nd = 616;
SELECT T2.lang FROM biwords AS T1 INNER JOIN langs AS T2 ON T1.lid = T2.lid WHERE T1.w1st = 1 AND T1.w2nd = 616
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...
beer_factory
For the customer who leaves the review content of "Tastes like Australia.", when was his/her first purchase date?
review content of "Tastes like Australia." refers to Review = 'Tastes like Australia.';
SELECT T1.FirstPurchaseDate FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.Review = 'Tastes like Australia.'
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
language_corpus
Which Wikipedia page number has the highest number of words in the Catalan language?
Wikipedia page number refers to page;  the highest number of words in the Catalan language refers to MAX(lid = 1);
SELECT page 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...
beer_factory
Provide the name of the location where transaction no.100885 happened.
name of the location refers to LocationName; transaction no. refers to TransactionID; TransactionID = 100885;
SELECT T2.LocationName FROM `transaction` AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.TransactionID = 100885
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
talkingdata
What is the percentage of device users in the F27-28 age group who experienced an event on the 3rd of May 2016?
percentage = MULTIPLY(DIVIDE(SUM(`group` = 'F27-28'), COUNT(device_id)), 1.0); on the 3rd of May 2016 refers to timestamp = '2016-05-03%';
SELECT SUM(IIF(T1.`group` = 'F27-28', 1, 0)) / COUNT(T1.device_id) AS per FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE SUBSTR(T2.timestamp, 1, 10) = '2016-05-03'
CREATE TABLE app_events ( `is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 `is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0 `event_id` INTEGER NOT NULL, --...
language_corpus
Please list any three Wikipedia pages that are written in Catalan, together with their titles and revision page numbers.
in Catalan means in Catalan-language and refers to lid = 1; revision page numbers refer to revision;
SELECT title, revision FROM pages WHERE lid = 1 LIMIT 3
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...
beer_factory
For the root beer brand with the most 5 star ratings, what is the name of the brewery?
most 5 star ratings refers to MAX(COUNT(StarRating = 5)); name of the brewery refers to BreweryName;
SELECT T1.BreweryName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T2.StarRating = 5 GROUP BY T1.BrandID ORDER BY COUNT(T2.StarRating) DESC LIMIT 1
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
talkingdata
List all females aged 24 to 26 devices' locations.
females refers to gender = 'F'; aged 24 to 26 refers to `group` = 'F24-26';
SELECT T2.longitude, T2.latitude FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T1.`group` = 'F24-26' AND T1.gender = 'F'
CREATE TABLE app_events ( `is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 `is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0 `event_id` INTEGER NOT NULL, --...
language_corpus
What is the word id for title "Sometent"?
word id refers to wid
SELECT T2.wid FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.title = 'Sometent'
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...
beer_factory
Which customer has the most reviews? State the full name.
customer that has the most reviews refers to MAX(COUNT(CustomerID)); full name = First, Last;
SELECT T1.First, T1.Last FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID GROUP BY T1.CustomerID ORDER BY COUNT(T2.CustomerID) DESC LIMIT 1
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
language_corpus
What is the second word in the pair of words number 1 and 8968?
Pair is a relationship of two words: w1st and w2nd, where w1st is word id of the first word and w2nd is a word id of the second word; w1st = 1; w2nd = 8968;
SELECT word FROM words WHERE wid = 8968
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...
talkingdata
What is the most common age group among all device users?
most common age group refers to MAX(COUNT(`group`));
SELECT T.num FROM ( SELECT `group`, COUNT(`group`) AS num FROM gender_age GROUP BY `group` ) T
CREATE TABLE app_events ( `is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 `is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0 `event_id` INTEGER NOT NULL, --...
language_corpus
How many Catalan-language Wikipedia pages are there overall?
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...
beer_factory
What is the percentage of 5 star ratings River City brand root beer get?
percentage = MULTIPLY(DIVIDE(SUM(BrandID WHERE StarRating = 5), COUNT(BrandID) WHERE BrandName = 'River City'), 1.0); 5 star ratings refers to StarRating = 5; River City refers to BrandName = 'River City';
SELECT CAST(COUNT(CASE WHEN T2.StarRating = 5 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.StarRating) FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T1.BrandName = 'River City'
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
beer_factory
When did Natalie Dorris buy her first root beer?
when a customer bought their first root beer refers to FirstPurchaseDate;
SELECT T2.TransactionDate FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'Natalie' AND T1.Last = 'Dorris' ORDER BY T2.TransactionDate LIMIT 1
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
talkingdata
How many of the apps belong in the "Equity Fund" category?
null
SELECT COUNT(T1.app_id) FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id WHERE T2.category = 'Equity Fund'
CREATE TABLE app_events ( `is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 `is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0 `event_id` INTEGER NOT NULL, --...
language_corpus
How many times on page number 16 does the second word in the pair of words 1 and 109 appear?
How many times appear refer to occurrences; page number 16 refers to pid = 16; Pair is a relationship of two words: w1st and w2nd, where w1st is word id of the first word and w2nd is a word id of the second word; w1st = 1; w2nd = 109;
SELECT SUM(T1.occurrences) FROM pages_words AS T1 INNER JOIN biwords AS T2 ON T2.w2nd = T1.wid WHERE T2.w2nd = 109 AND T2.w1st = 1 AND T1.pid = 16
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...
language_corpus
How many times does the Catalan word "nombre" repeat itself?
the Catalan means Catalan language and refers to lid = 1; How many times repeat refers to occurrences;
SELECT T1.occurrences FROM langs_words AS T1 INNER JOIN words AS T2 ON T1.wid = T2.wid WHERE T2.word = 'nombre'
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...
beer_factory
For the root beer brand which got the review with the content of "The quintessential dessert root beer. No ice cream required.", what is the current retail price of the root beer?
review with the content of "The quintessential dessert root beer. No ice cream required." refers to Review = 'The quintessential dessert root beer. No ice cream required.';
SELECT T1.CurrentRetailPrice - T1.WholesaleCost AS price FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T2.Review = 'The quintessential dessert root beer. No ice cream required.'
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
talkingdata
List all the devices' brands and models of events on 5/7/2016 at 6:03:22 AM.
devices' brands refers to phone_brand; models refers to device_model; on 5/7/2016 at 6:03:22 AM refers to timestamp = '2016-05-07 06:03:22';
SELECT T1.phone_brand, T1.device_model FROM phone_brand_device_model2 AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T2.timestamp = '2016-05-07 06:03:22'
CREATE TABLE app_events ( `is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 `is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0 `event_id` INTEGER NOT NULL, --...
language_corpus
How many times on page number 44 does the word "votives" appear?
How many times refers to occurrences; page number 44 refers to pid = 44;
SELECT T2.occurrences FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'votives' AND T2.pid = 44
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...
talkingdata
How many different models does the HTC brand have?
models refers to device_model; HTC brand refers to phone_brand = 'HTC';
SELECT COUNT(device_model) FROM phone_brand_device_model2 WHERE phone_brand = 'HTC'
CREATE TABLE app_events ( `is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 `is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0 `event_id` INTEGER NOT NULL, --...
language_corpus
What is the revision page ID of title "Aigua dolça"?
title "Aigua dolça" refers to title LIKE 'Aigua dolça%'
SELECT revision FROM pages WHERE title = 'Aigua dolça'
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...
address
How many postal points are there under the congress representative in Puerto Rico?
postal points refer to zip_code; Puerto Rico refers to state = 'Puerto Rico';
SELECT COUNT(T2.zip_code) FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.state = 'Puerto Rico'
CREATE TABLE state ( name TEXT, -- abbreviation TEXT primary key, ); CREATE TABLE country ( zip_code INTEGER, -- foreign key (state) references state(abbreviation), county TEXT, -- primary key (zip_code, county), state TEXT, -- foreign key (zip_code) references zip_data(zip_code), ); CREATE TABLE area...
beer_factory
How many female customers permit the company to send regular emails to them?
female refers to Gender = 'F'; customer permits the company to send regular emails to them refers to SubscribedToEmailList = 'TRUE';
SELECT COUNT(CustomerID) FROM customers WHERE Gender = 'F' AND SubscribedToEmailList = 'TRUE'
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
language_corpus
What percentage of Catalan-language Wikipedia pages have more than 10,000 words?
Catalan-language refers to lang = 'ca'; more than 10,000 words refer to words > 10000; DIVIDE(COUNT(pages WHERE words > 10000 and lang = 'ca'), COUNT(pages WHERE lang = 'ca')) as percentage;
SELECT CAST(COUNT(CASE WHEN T2.words > 10000 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.page) FROM langs AS T1 INNER JOIN pages AS T2 ON T1.lid = T2.lid WHERE T1.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...
beer_factory
For the customer who gave a 3 star rating to Frostie brand on 2014/4/24, did the user permit the company to send regular emails to him/her?
3 star rating refers to StarRating = 3; Frostie refers to  BrandName = 'Frostie'; if SubscribedToEmailList = 'TRUE', it means the user permit the company to send regular emails to him/her; if SubscribedToEmailList = FALSE', it means the user did not permit the company to send regular emails to him/her; rating on 2014/4...
SELECT CASE WHEN T1.SubscribedToEmailList LIKE 'TRUE' THEN 'YES' ELSE 'NO' END AS result FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeerbrand AS T3 ON T2.BrandID = T3.BrandID WHERE T2.StarRating = 3 AND T3.BrandName = 'Frostie' AND T2.ReviewDate = '2014-04-24'
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
talkingdata
What percentage of vivo devices belong to users with no information?
percentage = MULTIPLY(DIVIDE(SUM(gender = NULL and age = NULL and `group` = NULL), COUNT(device_id)), 1.0); vivo devices refers to phone_brand = 'vivo'; no information refers to gender = NULL AND age = NULL AND `group` = NULL;
SELECT SUM(IIF(T1.gender IS NULL AND T1.age IS NULL AND T1.`group` IS NULL, 1, 0)) / COUNT(T1.device_id) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo'
CREATE TABLE app_events ( `is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 `is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0 `event_id` INTEGER NOT NULL, --...
talkingdata
How many male users have a Galaxy Note 3?
male refers to gender = 'M'; Galaxy Note 3 refers to device_model = 'Galaxy Note 3';
SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Galaxy Note 3' AND T1.gender = 'M'
CREATE TABLE app_events ( `is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 `is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0 `event_id` INTEGER NOT NULL, --...
language_corpus
Which word has the most repetitions in the Catalan language?
the most repetitions refer to MAX(occurrences); Catalan language refers to lid = 1;
SELECT T2.word FROM langs_words AS T1 INNER JOIN words AS T2 ON T1.wid = T2.wid WHERE T1.occurrences = ( SELECT MAX(occurrences) FROM langs_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...
beer_factory
What are the full names of the first top 10 customers?
full name = First Last; first top 10 customers refers to MIN(FirstPurchaseDate) LIMIT 10;
SELECT First, Last FROM customers ORDER BY FirstPurchaseDate LIMIT 10
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
beer_factory
What is the average number of reviews of all the root beer brands from "CA" State?
average = DIVIDE(COUNT(CustomerID), COUNT(BrandID) WHERE state = CA);
SELECT CAST(COUNT(*) AS REAL) / COUNT(DISTINCT T1.BrandID) AS avgreview FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T1.State = 'CA'
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
movie_platform
Name the movie with the most ratings.
movie with the most rating refers to MAX(SUM(rating_score));
SELECT movie_title FROM movies GROUP BY movie_title ORDER BY COUNT(movie_title) DESC LIMIT 1
CREATE TABLE ratings_users ( user_cover_image_url TEXT, -- user_avatar_image_url TEXT, -- rating_date_utc TEXT, -- user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value S...
talkingdata
Which brand is most common among people in their twenties?
brand refers to phone_brand; brand that is most common refers to MAX(COUNT(phone_brand)); twenties refers to age BETWEEN 20 AND 30;
SELECT T.phone_brand FROM ( SELECT T2.phone_brand, COUNT(T2.phone_brand) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age BETWEEN 20 AND 30 GROUP BY T2.phone_brand ) AS T ORDER BY T.num DESC LIMIT 1
CREATE TABLE app_events ( `is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 `is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0 `event_id` INTEGER NOT NULL, --...
language_corpus
List out the total pages of Wikipedia in Catalan language.
This is not;
SELECT pages FROM langs
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...
beer_factory
How many customers are named Charles in Sacramento?
Sacramento refers to City = 'Sacramento';
SELECT COUNT(CustomerID) FROM customers WHERE First = 'Charles' AND City = 'Sacramento'
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
language_corpus
What is the percentage of the words that have been repeated under 180 times in the Catalan language?
repeated under 180 times refers to occurrences < 180; Catalan language refers to lang = 'ca'; DIVIDE(COUNT(words WHERE occurrences < 180 and lang = 'ca'), COUNT(words WHERE lang = 'ca')) as percentage;
SELECT CAST(COUNT(CASE WHEN T2.occurrences < 180 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.lid) FROM langs AS T1 INNER JOIN langs_words AS T2 ON T1.lid = T2.lid WHERE T1.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...
beer_factory
What is the name of the brand of the beer with the shortest brewed history?
name of the brand of the beer refers to BrandName; shortest brewed history refers to MAX(FirstBrewedYear);
SELECT BrandName FROM rootbeerbrand ORDER BY FirstBrewedYear DESC LIMIT 1
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
law_episode
How many keywords are there for season 9, episode 23 of law_and_order?
null
SELECT COUNT(T2.keyword) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.season = 9 AND T1.episode = 23
CREATE TABLE Award ( result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0 person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0 organi...
language_corpus
How many words has the appearance times greater than 10?
appearance times greater than 10 refers to occurrences > 10;
SELECT COUNT(w1st) AS countwords FROM biwords 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...
beer_factory
How many sweet bottled root beers that do not contain cane sugar were purchased in 2015 through the selling company located in Sac State American River Courtyard?
sweet refers to Honey = 'TRUE'; bottled refers to ContainerType = 'Bottle'; do not contain cane sugar refers to CaneSugar = 'FALSE'; in 2015 refers to PurchaseDate < = '2015-12-31'; Sac State American River Courtyard refers to LocationName = 'Sac State American River Courtyard';
SELECT COUNT(T1.BrandID) FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID INNER JOIN location AS T3 ON T1.LocationID = T3.LocationID WHERE T3.LocationName = 'Sac State American River Courtyard' AND T1.PurchaseDate LIKE '2015%' AND T2.Honey = 'TRUE' AND T2.CaneSugar = 'FALSE' AND T1.Containe...
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
talkingdata
Identify by their id all the apps that belong to the game-stress reliever category.
id refers to device_id;
SELECT T2.app_id FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'game-stress reliever'
CREATE TABLE app_events ( `is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 `is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0 `event_id` INTEGER NOT NULL, --...
law_episode
Please list all the keywords for the episodes with a rating of over 8.
a rating of over 8 refers to rating > 8
SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.rating > 8
CREATE TABLE Award ( result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0 person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0 organi...
movie_platform
What is the average number of Mubi users who love movies directed by Stanley Kubrick?
average = AVG(movie_popularity); number of Mubi users who loves the movie refers to movie_popularity;
SELECT AVG(movie_popularity) FROM movies WHERE director_name = 'Stanley Kubrick'
CREATE TABLE ratings_users ( user_cover_image_url TEXT, -- user_avatar_image_url TEXT, -- rating_date_utc TEXT, -- user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value S...
language_corpus
List down the page id of titles start with alphabet "b".
start with alphabet "b" refers to title LIKE 'b%'
SELECT pid FROM pages WHERE title LIKE 'b%'
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...
beer_factory
How many breweries are there in Australia?
Australia refers to Country = 'Australia';
SELECT COUNT(BreweryName) FROM rootbeerbrand WHERE Country = 'Australia'
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
law_episode
Please list all the keywords of the episode "Refuge: Part 1".
episode "Refuge: Part 1" refers to title = 'Refuge: Part 1'
SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Refuge: Part 1'
CREATE TABLE Award ( result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0 person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0 organi...
beer_factory
Which brand of root beer did Jayne Collins give the lowest rating?
brand of root beer refers to BrandName; lowest rating refers to MIN(StarRating);
SELECT T3.BrandName FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeerbrand AS T3 ON T2.BrandID = T3.BrandID WHERE T1.First = 'Jayne' AND T1.Last = 'Collins' AND T2.StarRating = 1
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
address
Count the number of postal points under New York-Newark-Jersey City, NY-NJ-PA.
postal points refer to zip_code; under New York-Newark-Jersey City, NY-NJ-PA refers to CBSA_name = 'New York-Newark-Jersey City, NY-NJ-PA';
SELECT COUNT(T2.zip_code) FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'New York-Newark-Jersey City, NY-NJ-PA'
CREATE TABLE state ( name TEXT, -- abbreviation TEXT primary key, ); CREATE TABLE country ( zip_code INTEGER, -- foreign key (state) references state(abbreviation), county TEXT, -- primary key (zip_code, county), state TEXT, -- foreign key (zip_code) references zip_data(zip_code), ); CREATE TABLE area...
language_corpus
List out the title of Catalan language Wikipedia page that has wikipedia revision page id as 106601.
Wikipedia revision page id as 106601 refers to revision = 106601;
SELECT title FROM pages WHERE revision = 106601
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...
law_episode
What is the title of the episode with the keyword "laundering money"?
keyword "laundering money" refers to keyword = 'laundering money'
SELECT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword = 'laundering money'
CREATE TABLE Award ( result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0 person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0 organi...
language_corpus
How many times the word "desena" occurs?
How many times occurs refers to occurrences;
SELECT occurrences FROM words WHERE word = 'desena'
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...
beer_factory
What are the full names of the customer who gave River City a 5-star?
full name = First, Last; River City refers to BrandName = 'River City'; 5-star refers to StarRating = 5;
SELECT T1.First, T1.Last FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeerbrand AS T3 ON T2.BrandID = T3.BrandID WHERE T3.BrandName = 'River City' AND T2.StarRating = 5
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
language_corpus
What is the locale of the language of the page titled "Anys 90"?
page titled "Anys 90" refers to title = 'Anys 90';
SELECT T1.locale FROM langs AS T1 INNER JOIN pages AS T2 ON T1.lid = T2.lid WHERE T2.title = 'Anys 90'
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...
law_episode
How many votes did the episode titled "Cherished" get in total?
titled "Cherished" refers to title = 'Cherished'
SELECT SUM(T2.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Cherished'
CREATE TABLE Award ( result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0 person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0 organi...
language_corpus
How many words have repetitions greater than 2000 and lower than 5000?
repetitions greater than 2000 and lower than 5000 refer to occurrences between 2000 and 5000;
SELECT COUNT(wid) FROM langs_words WHERE occurrences BETWEEN '2000' AND '5000'
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...
beer_factory
How many transactions were paid through MasterCard in 2014?
MasterCard refers to CreditCardType = 'MasterCard'; in 2014 refers to TransactionDate > = '2014-01-01' AND TransactionDate < = '2014-12-31';
SELECT COUNT(TransactionID) FROM `transaction` WHERE CreditCardType = 'MasterCard' AND TransactionDate LIKE '2014%'
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
talkingdata
State the number of users who are under 50 and above 20 use device model of Galaxy Premier.
under 50 and above 20 refers to age BTWEEEN 20 AND 50;
SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age BETWEEN 20 AND 50 AND T2.device_model = 'Galaxy Premier'
CREATE TABLE app_events ( `is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 `is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0 `event_id` INTEGER NOT NULL, --...
language_corpus
How many times that the word pair of "barcelona" and "precolombina" occur?
Pair is a relationship of two words: w1st and w2nd, where w1st is word id of the first word and w2nd is a word id of the second word; w1st or w2nd = 'barcelona'; w1st or w2nd = 'precolombina';
SELECT SUM(occurrences) FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'barcelona' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'precolombina' )
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...
beer_factory
How many Henry Weinhard's were bought by Nicholas Sparks?
Henry Weinhard's refers to BrandName = 'Henry Weinhard''s';
SELECT COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeer AS T3 ON T2.RootBeerID = T3.RootBeerID INNER JOIN rootbeerbrand AS T4 ON T3.BrandID = T4.BrandID WHERE T1.First = 'Nicholas' AND T1.Last = 'Sparks' AND T4.BrandName LIKE 'Henry Weinhard%s...
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
law_episode
Park Dietz was credited in which role in the episode titled "Cherished"?
credited refers to credited = 'true'; titled "Cherished" refers to title = 'Cherished'
SELECT T2.role FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.title = 'Cherished' AND T3.name = 'Park Dietz' AND T2.credited = 'true'
CREATE TABLE Award ( result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0 person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0 organi...
beer_factory
Which brewery does the most purchased root beer in 2016 belong to?
most purchased root beer refers to MAX(COUNT(BrandID)); in 2016 refers to PurchaseDate > = '2016-01-01' AND PurchaseDate < = '2016-12-31';
SELECT T2.BreweryName FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID WHERE T1.PurchaseDate BETWEEN '2016-01-01' AND '2016-12-31' GROUP BY T2.BrandID ORDER BY COUNT(T1.BrandID) DESC LIMIT 1
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
law_episode
How many 10-star votes were given to the episode titled "Cherished"?
10-star vote refers to stars = 10; titled "Cherished" refers to title = 'Cherished'
SELECT T2.votes FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Cherished' AND T2.stars = 10
CREATE TABLE Award ( result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0 person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0 organi...
language_corpus
What is the average words of the 10 fewest words title?
average words = avg(words); 10 fewest words refers to words > = 10
SELECT CAST(SUM(CASE WHEN words >= 10 THEN words ELSE 0 END) AS REAL) / SUM(CASE WHEN words >= 10 THEN 1 ELSE 0 END) 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...
beer_factory
Which brand of root beer was highly rated by customers?
brand of root beer refers to BrandName; highly rated refers to MAX(COUNT(StarRating = 5));
SELECT T1.BrandName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T2.StarRating = 5
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
law_episode
What is the title of the episode that got the most 10-star votes?
the most refers to max(votes); 10-star refers to stars = 10
SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 10 ORDER BY T2.votes DESC LIMIT 1
CREATE TABLE Award ( result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0 person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0 organi...
language_corpus
What is the locale of the language of the page titled "Abril"?
the page titled "Abril" refers to title = 'Abril';
SELECT T1.locale FROM langs AS T1 INNER JOIN pages AS T2 ON T1.lid = T2.lid WHERE T2.title = 'Abril'
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...
address
Who is the CBSA officer of the post point in the area with the highest number of employees?
CBSA officer refers to CBSA_name; the highest number of employees refers to MAX(employees);
SELECT T1.CBSA_name FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T2.employees = ( SELECT MAX(employees) FROM zip_data )
CREATE TABLE state ( name TEXT, -- abbreviation TEXT primary key, ); CREATE TABLE country ( zip_code INTEGER, -- foreign key (state) references state(abbreviation), county TEXT, -- primary key (zip_code, county), state TEXT, -- foreign key (zip_code) references zip_data(zip_code), ); CREATE TABLE area...
language_corpus
State the Wikipedia page title that has revision page id of 28040864.
revision page id of 28040864 refers to revision = 28040864;
SELECT title FROM pages WHERE revision = 28040864
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...
beer_factory
Between Sac State Union and Sac State American River Courtyard, which location sold the most Dog n Suds root beer?
Between Sac State Union and Sac State American River Courtyard refers to LocationName IN('Sac State American River Courtyard', 'Sac State Union'); Dog n Suds refers to BrandName = 'Dog n Suds'; sold the most root beer refers to MAX(COUNT(BrandID));
SELECT T3.LocationName FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID INNER JOIN location AS T3 ON T1.LocationID = T3.LocationID WHERE T2.BrandName = 'Dog n Suds' AND T3.LocationName IN ('Sac State American River Courtyard', 'Sac State Union') GROUP BY T1.LocationID ORDER BY COUNT(T1.Bran...
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
law_episode
Who was credited as "technical advisor" in the episode titled "Cherished"?
who refers to name; credited refers to credited = 'true'; as "technical advisor" refers to role = 'technical advisor'; titled "Cherished" refers to title = 'Cherished'
SELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.title = 'Cherished' AND T2.credited = 'true' AND T2.role = 'technical advisor'
CREATE TABLE Award ( result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0 person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0 organi...
language_corpus
List out the title of the word have id less than 20.
word have id less than 20 refers to wid < 20;
SELECT DISTINCT T1.title FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T2.wid < 20
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...
beer_factory
How many root beers did Tom Hanks purchase between 2015 to 2016?
between 2015 to 2016 refers to TransactionDate > = '2015-01-01' AND TransactionDate < '2016-12-31';
SELECT COUNT(T2.RootBeerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'Tom' AND T1.Last = 'Hanks' AND T2.TransactionDate BETWEEN '2015-01-01' AND '2016-12-31'
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
language_corpus
Which word that has 71303 appearance in the Catalan language?
has 71303 appearance refers to occurrences = 71303;
SELECT T1.word FROM words AS T1 INNER JOIN langs_words AS T2 ON T1.wid = T2.wid WHERE T2.occurrences = 71303
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...
beer_factory
What are the brands of the root beers that received 5-star ratings from no less than 5 customers?
brand of the root beer refers to BrandName; 5-star ratings refers to StarRating = 5; no less than 5 customers refers to COUNT(CustomerID) > = 5;
SELECT T1.BrandName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T2.StarRating = 5 GROUP BY T2.BrandID HAVING COUNT(T2.StarRating) >= 5
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
language_corpus
State the total pages of the words that has repeated times of 2593.
repeated times of 2593 refers to occurrences = 2593;
SELECT COUNT(T1.pages) FROM langs AS T1 INNER JOIN langs_words AS T2 ON T1.lid = T2.lid WHERE T2.occurrences = 2593
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...
beer_factory
Among the root beer brands that do not advertise on Facebook and Twitter, which brand has the highest number of purchases?
do not advertise on Facebook and Twitter refers to FacebookPage IS NULL AND Twitter IS NULL; highest number of purchases refers to MAX(COUNT(BrandID));
SELECT T2.BreweryName FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID WHERE T2.FacebookPage IS NULL AND T2.Twitter IS NULL GROUP BY T2.BrandID ORDER BY COUNT(T1.BrandID) DESC LIMIT 1
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
talkingdata
Identify all installed and activated apps by their id.
installed refers to is_installed = 1; activated refers to is_active = 1; id refers to app_id;
SELECT app_id FROM app_events WHERE is_active = 1 AND is_installed = 1
CREATE TABLE app_events ( `is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 `is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0 `event_id` INTEGER NOT NULL, --...
language_corpus
What are the word pairs that occured only twice?
word pair refers to w1st.word w2nd.word; occured only twice refers to occurrences = 2
SELECT T1.word, T3.word FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st INNER JOIN words AS T3 ON T3.wid = T2.w2nd WHERE T2.occurrences = 2
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...
beer_factory
What is the precise location of Sac State Union?
precise location = Latitude, Longitude; Sac State Union refers to LocationName = 'Sac State Union';
SELECT T2.Latitude, T2.Longitude FROM location AS T1 INNER JOIN geolocation AS T2 ON T1.LocationID = T2.LocationID WHERE T1.LocationName = 'Sac State Union'
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
law_episode
Please list the titles of all the episodes in which Park Dietz was credited.
credited refers to credited = 'true'
SELECT T1.title FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T2.credited = 'true' AND T3.name = 'Park Dietz'
CREATE TABLE Award ( result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0 person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0 organi...
language_corpus
How many word appeared 8 times? State the language id of the page.
appeared 8 times refers to occurrences = 8;
SELECT COUNT(T2.wid), T1.lid FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T2.occurrences = 8
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...
beer_factory
List the full name and phone number of male customers from Fair Oaks who are subscribed to the email list.
full name = First, Last; male customers refers to Gender = 'M'; Fair Oaks refers to City = 'Fair Oaks'; subscribed to the email list refers to SubscribedToEmailList = 'TRUE';
SELECT First, Last, PhoneNumber FROM customers WHERE Gender = 'M' AND City = 'Fair Oaks' AND SubscribedToEmailList = 'TRUE'
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
law_episode
How many people had filled a role in the episode titled "Cherished", but did not show up in the on-screen credits?
titled "Cherished" refers to title = 'Cherished'; did not show up in the on-screen credits refers to credited = ''
SELECT COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Cherished' AND T2.credited = 'false'
CREATE TABLE Award ( result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0 person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0 organi...
language_corpus
What is the total number of words in page containing pair of word id "100" and "317"?
Pair is a relationship of two words: w1st and w2nd, where w1st is word id of the first word and w2nd is a word id of the second word; w1st = 100; w2nd = 317;
SELECT words FROM langs WHERE lid = ( SELECT lid FROM biwords WHERE w1st = 100 AND w2nd = 317 )
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...
law_episode
For how many times was Park Dietz credited?
credited refers to credited = 'true'
SELECT COUNT(T3.person_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T2.credited = 'true' AND T3.name = 'Park Dietz'
CREATE TABLE Award ( result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0 person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0 organi...
language_corpus
State the name of the pair of word that have id of 20 and 50?
word that have id of 20 refers to wid = 20; word that have id of 50 refers to wid = 50;
SELECT T1.word, T3.word FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st INNER JOIN words AS T3 ON T3.wid = T2.w2nd WHERE T2.w1st = 20 AND T2.w2nd = 50
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...
beer_factory
How many canned A&W were purchased in 2016?
canned refers to ContainerType = 'Can'; A&W refers to BrandName = 'A&W'; in 2016 refers to PurchaseDate > = '2016-01-01' AND PurchaseDate < = '2016-12-31';
SELECT COUNT(T1.BrandID) FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID WHERE T1.ContainerType = 'Can' AND T2.BrandName = 'A&W' AND T1.PurchaseDate LIKE '2016%'
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
law_episode
How many keywords are there in the episode Disciple?
episode Disciple refers to title = 'Disciple'
SELECT COUNT(T2.keyword) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Disciple'
CREATE TABLE Award ( result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0 person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0 organi...
language_corpus
How many word that has number of different words equal to 3?
This is not;
SELECT COUNT(T2.wid) FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.words = 3
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...
language_corpus
List out the total pages of the words that has repeated times more than 3000.
repeated more than 3000 times refers to occurrences > 3000;
SELECT T1.pages FROM langs AS T1 INNER JOIN langs_words AS T2 ON T1.lid = T2.lid WHERE T2.occurrences > 3000 GROUP BY T1.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...
beer_factory
Which brand of root beer has the lowest unit profit available to wholesalers? Indicate the ID of the customer that has the highest number of purchases of the said brand.
brand of root beer refers to BrandName; lowest unit profit available to wholesalers refers to MIN(SUBTRACT(CurrentRetailPrice, WholesaleCost)); ID of the customer refers to CustomerID; highest number of purchases refers to MAX(COUNT(CustomerID));
SELECT T3.BrandName, T2.CustomerID FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID GROUP BY T3.BrandID ORDER BY T3.CurrentRetailPrice - T3.WholesaleCost, COUNT(T1.BrandID) DESC LIMIT 1
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
talkingdata
How many users who are between 20 and 60 use phone brand of TCL?
null
SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age BETWEEN 20 AND 60 AND T2.phone_brand = 'TCL'
CREATE TABLE app_events ( `is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 `is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0 `event_id` INTEGER NOT NULL, --...
address
How many postal points with unique post office types are there in Ohio?
postal points refer to zip_code; unique post office types refer to type = 'Unique Post Office'; Ohio is the name of the state, in which name = 'Ohio';
SELECT COUNT(T2.zip_code) FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Ohio' AND T2.type = 'Unique Post Office'
CREATE TABLE state ( name TEXT, -- abbreviation TEXT primary key, ); CREATE TABLE country ( zip_code INTEGER, -- foreign key (state) references state(abbreviation), county TEXT, -- primary key (zip_code, county), state TEXT, -- foreign key (zip_code) references zip_data(zip_code), ); CREATE TABLE area...
language_corpus
What is the title of corpus with most words?
most 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...
beer_factory
Give the name of the brands that brewed their first drink between 1996 and 2000 in the descending order of the date brewed.
name of the brands refers to BrandName; between 1996 and 2000 refers to FirstBrewedYear > = 1996 AND FirstBrewedYear < = 2000;
SELECT BrandName FROM rootbeerbrand WHERE FirstBrewedYear BETWEEN '1996' AND '2000' ORDER BY FirstBrewedYear DESC
CREATE TABLE rootbeerbrand ( Website TEXT, -- State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1 Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist...
law_episode
How many nominations did Law and Order season 9, episode 20 get?
Law and Order refers to series = 'Law and Order'
SELECT COUNT(T2.award_id) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T2.series = 'Law and Order' AND T1.season = 9 AND T1.episode = 20
CREATE TABLE Award ( result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0 person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0 organi...
language_corpus
Please list the titles of the Wikipedia pages on the Catalan language with more than 4000 words.
Catalan language refers to lid = 1; more than 4000 words refers to words > 4000;
SELECT title FROM pages WHERE lid = 1 AND words > 4000
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...