db_id
stringclasses
66 values
question
stringlengths
24
325
evidence
stringlengths
1
673
gold_query
stringlengths
23
804
db_schema
stringclasses
66 values
beer_factory
List the brands of root beer produced by Dr Pepper Snapple Group and calculate their percentage of purchases between 2014 to 2016.
brand of root beer refers to BrandName; produced by Dr Pepper Snapple Group refers to BreweryName = 'Dr Pepper Snapple Group'; percentage of purchases = MULTIPLY(DIVIDE(SUM(BrandID WHERE PurchaseDate > = '2014-01-01' AND PurchaseDate < = '2016-12-31'), COUNT(BrandID) WHERE BreweryName = 'Dr Pepper Snapple Group'), 1.0)...
SELECT T1.BrandName , CAST(SUM(CASE WHEN T2.PurchaseDate >= '2014-01-01' AND T2.PurchaseDate <= '2016-12-31' THEN 1 ELSE 0 END) AS REAL) / COUNT(T2.BrandID) AS purchase FROM rootbeerbrand AS T1 INNER JOIN rootbeer AS T2 ON T1.BrandID = T2.BrandID WHERE T1.BreweryName = 'Dr Pepper Snapple Group' GROUP BY T2.BrandID
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
Was Anthony Azzara's role in episode tt0629204 displayed in the credits at the end of the episode?
episode tt0629204 refers to episode_id = 'tt0629204'; credited refers to credited = 'true'; not credited refers to credited = ''
SELECT T1.credited FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Anthony Azzara' AND T1.episode_id = 'tt0629204'
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
Calculate the average percentage of word appearance in the page that have revision page id smaller than 106680.
revision page id smaller than 106680 refers to revision < 106680; word appearance refers to occurrences; DIVIDE(SUM(occurrences where revision < 106680), COUNT(occurrences)) as percentage;
SELECT CAST(SUM(T1.words) AS REAL) * 100 / SUM(T2.occurrences) FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.revision < 106680
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 brands of root beers are available in cans and contain corn syrup and artificial sweeteners?
available in cans refers to AvailableInCans = 'TRUE'; contain corn syrup refers to CornSyrup = 'TRUE'; contain artificial sweeteners refers to ArtificialSweetener = 'TRUE';
SELECT COUNT(BrandID) FROM rootbeerbrand WHERE CornSyrup = 'TRUE' AND ArtificialSweetener = 'TRUE' AND AvailableInCans = '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 is the occurrence of the word "nombre"?
This is not;
SELECT occurrences FROM words WHERE 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
Among the root beer purchased in 2014, what percentage were sold in cans?
in 2014 refers to PurchaseDate > = '2014-01-01' AND PurchaseDate < = '2014-12-31'; percentage = MULTIPLY(DIVIDE(SUM(ContainerType = 'Can'), COUNT(RootBeerID) WHERE PurchaseDate > = '2014-01-01' AND PurchaseDate < = '2014-12-31'), 1.0); in cans refers to ContainerType = 'Can';
SELECT CAST(COUNT(CASE WHEN ContainerType = 'Can' THEN RootBeerID ELSE NULL END) AS REAL) * 100 / COUNT(RootBeerID) FROM rootbeer WHERE PurchaseDate 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...
language_corpus
How many pages of Wikipedia are there in total on the Catalan language?
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...
law_episode
Which episode got the most 1 star votes? Give its title.
the most refers to max(votes); 1 star refers to stars = '1'
SELECT T2.title FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.stars = 1 ORDER BY T1.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...
beer_factory
Among the transactions, what percentage is done by using a visa card?
visa card refers to CreditCardType = 'Visa'; percentage = MULTIPLY(DIVIDE(SUM(CreditCardType = 'Visa'), COUNT(TransactionID)), 1.0);
SELECT CAST(COUNT(CASE WHEN CreditCardType = 'Visa' THEN TransactionID ELSE NULL END) AS REAL) * 100 / COUNT(TransactionID) FROM `transaction`
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
Describe what happened in the episode of award no.296.
description of what happened refers to summary; award no.296 refers to award_id = '296'
SELECT T1.summary FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T2.award_id = 296
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
Which of these pages have more words, the page titled "Afluent" or "Asclepi"?
COUNT(words where title = 'Afluent')> COUNT(words where title = 'Asclepi')
SELECT CASE WHEN ( SELECT words FROM pages WHERE title = 'Asclepi' ) > ( SELECT words FROM pages WHERE title = 'Afluent' ) THEN 'Asclepi' ELSE 'Afluent' END
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 from the House of Representatives in Mississippi?
postal points refer to zip_code; Mississippi is the name of the state, in which name = 'Mississippi';
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 = 'Mississippi'
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...
talkingdata
How many apps are labeled 7?
labeled 7 refers to label_id = 7;
SELECT COUNT(app_id) FROM app_labels WHERE label_id = 7
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, --...
beer_factory
On average how many caffeinated root beers are sold a day?
average = DIVIDE(COUNT(RootBeerID WHERE Caffeinated = 'TRUE'), COUNT(PurchaseDate)); caffeinated refers to Caffeinated = 'TRUE';
SELECT CAST(COUNT(T2.RootBeerID) AS REAL) / COUNT(DISTINCT T2.PurchaseDate) FROM rootbeerbrand AS T1 INNER JOIN rootbeer AS T2 ON T1.BrandID = T2.BrandID INNER JOIN `transaction` AS T3 ON T2.RootBeerID = T3.RootBeerID WHERE T1.Caffeinated = '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 is the total word of title "Adam" and "Acampada"?
total word refers to sum(words); title "Adam" and "Acampada" refers to title IN('Adam','Acampada')
SELECT SUM(words) FROM pages WHERE title IN ('Adam', 'Acampada')
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
Find the brand Id of the root beer which has the most number of customers who gave 1-star ratings.
most number of customers who gave 1-star ratings refers to MAX(COUNT(StarRating = 1)); 1-star ratings refers to StarRating = 1;
SELECT BrandID FROM rootbeerreview WHERE StarRating = 1 GROUP BY BrandID ORDER BY COUNT(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 awards has Rene Balcer been nominated for?
null
SELECT COUNT(T2.award_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T1.name = 'Rene Balcer'
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 "Asclepi"?
page titled "Asclepi" refers to title = 'Asclepi' ;
SELECT T2.locale FROM pages AS T1 INNER JOIN langs AS T2 ON T1.lid = T2.lid WHERE T1.title = 'Asclepi'
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 average cost of root beers purchased for more than 2 dollars and sold in bottles?
average cost = DIVIDE(SUM(PurchasePrice > 2), COUNT(RootBeerID) WHERE PurchasePrice > 2); more than 2 dollars refers to PurchasePrice > 2; in bottles refers to ContainerType = 'Bottle';
SELECT AVG(T2.PurchasePrice) FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID WHERE T1.ContainerType = 'Bottle' AND T2.PurchasePrice > 2
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
How many words are there on the page titled "Asclepi"?
page titled "Asclepi" refers to title = 'Asclepi' ;
SELECT words FROM pages WHERE title = 'Asclepi'
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 season 9, episode 17 of the show Law and Order, how many roles have been included in the credit?
Law and Order refers to series = 'Law and Order'; included in the credit refers to credited = 'true'
SELECT COUNT(T2.role) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.series = 'Law and Order' AND T1.season = 9 AND T1.episode = 17 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...
language_corpus
How many words are there on the page that the word "grec" has occurred for 52 times?
the word "grec" refers to word = 'grec'; occurred for 52 times refers to occurrences = 52
SELECT SUM(T3.words) FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T1.word = 'grec' AND T2.occurrences = 52
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
Calculate the percentage of sales done at Sac State American River Courtyard.
percentage =   MULTIPLY(DIVIDE(SUM(LocationName = 'Sac State American River Courtyard'), COUNT(LocationID)), 1.0); Sac State American River Courtyard refers to LocationName = 'Sac State American River Courtyard';
SELECT CAST(COUNT(CASE WHEN T2.LocationName = 'Sac State American River Courtyard' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.TransactionID) FROM `transaction` AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID
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
Which role did Joseph Blair play in the show?
null
SELECT T1.role FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Joseph Blair'
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
Find the root beer with the most and least amount of profit per unit and list the container types in which these root beers are sold.
most amount of profit per unit refers to MAX(SUBTRACT(CurrentRetailPrice, WholesaleCost)); least amount of profit per unit refers to MIN(SUBTRACT(CurrentRetailPrice, WholesaleCost));
SELECT * FROM ( SELECT T1.BrandName, T2.ContainerType FROM rootbeerbrand AS T1 INNER JOIN rootbeer AS T2 ON T1.BrandID = T2.BrandID ORDER BY T1.CurrentRetailPrice - T1.WholesaleCost DESC LIMIT 1 ) UNION ALL SELECT * FROM ( SELECT T3.BrandName, T4.ContainerType FROM rootbeerbrand AS T3 INNER JOIN rootbeer AS T4 ON T3.Br...
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 nominated for award no.313? Give the full name.
award no.313 refers to award_id = '313'; full name refers to name
SELECT T1.name FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.award_id = 313
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...
address
Provide the congress representatives' IDs of the postal points in East Springfield.
congress representatives' IDs refer to CID; East Springfield is the city;
SELECT T2.district FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code WHERE T1.city = 'East Springfield'
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
Please list the Catalan words with an occurrence of over 200000.
occurrence of over 200000 refers to occurrences > 200000;
SELECT word FROM words WHERE occurrences > 200000
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 located in North America?
North America refers to country = 'United States'; North America is the name of continent where country = 'United States' is located;
SELECT COUNT(BrandID) FROM rootbeerbrand WHERE Country = 'United States'
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
Please list the title of the pages on which the word "grec" occurred for over 20 times.
occurred for over 20 times refers to occurrences > 20;
SELECT T3.title FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T1.word = 'grec' AND T2.occurrences > 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...
talkingdata
Among the users who use SUGAR, calculate the percentage of those who are above 20 years old.
SUGAR refers to phone_brand = 'SUGAR'; percentage = MULTIPLY(DIVIDE(SUM(age > 20), COUNT(device_id)) 1.0); above 20 years old refers to age > 20;
SELECT SUM(IIF(T1.age > 20, 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 = 'SUGAR'
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, --...
beer_factory
Among the customers not subscribed to the mailing list, what percentage has given three or more stars in a review?
not subscribed to the mailing list refers to SubscribedToEmailList = 'FALSE'; percentage = MULTIPLY(DIVIDE(SUM(CustomerID WHERE StarRating > 3), COUNT(CustomerID) WHERE SubscribedToEmailList = 'FALSE'), 1.0);
SELECT CAST(COUNT(CASE WHEN T2.StarRating > 3 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.CustomerID) FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.SubscribedToEmailList = 'FALSE'
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 times is the number of keywords in "Refuge: Part 1" episode than "Shield" episode?
"Refuge: Part 1" episode refers to title = 'Refuge: Part 1'; "Shield" episode refers to title = 'Shield'; times = divide(count(keyword where title = 'Refuge: Part 1'), count(keyword where title = 'Shield'))
SELECT CAST(SUM(CASE WHEN T1.title = 'Refuge: Part 1' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.title = 'Shield' THEN 1 ELSE 0 END) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id
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
Which biwords pair has a higher occurrence, "àbac-xinès" or "àbac-grec"?
higher occurrence is MAX(occurrences); àbac refers to word = 'àbac'; xinès refers to word = 'xinès'; grec refers to word = 'grec'
SELECT CASE WHEN ( SELECT occurrences FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'àbac' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'xinès' ) ) > ( SELECT occurrences FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'àbac' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'grec' ...
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 the episode with the most votes, give its air date.
the most votes refers to max(votes)
SELECT T2.air_date FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id GROUP BY T2.episode_id ORDER BY SUM(T1.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
How many times did the word "grec" occur on the page titled "Àbac"?
how many times occur refers to occurrences; page titled "Àbac" refers to title = 'Àbac' ;
SELECT T2.occurrences FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T3.title = 'Àbac' AND T1.word = 'grec'
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
In the female customers, how many bought root beer that contains artificial sweetener?
female refers to Gender = 'F'; contains artificial sweetener refers to ArtificialSweetener = 'TRUE';
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.Gender = 'F' AND T4.ArtificialSweetener = '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
Display the number of 9-star votes the episode Sideshow received.
9-star vote refers to stars = '9'; episode Sideshow refers to title = 'Sideshow'
SELECT T2.votes FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 9 AND T1.title = 'Sideshow'
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
Among the root beers sold in bottles, how many are sold at the location 38.559615, -121.42243?
in bottles refers to ContainerType = 'Bottle';  location 38.559615, -121.42243 refers to latitude = 38.559615 AND longitude = -121.42243;
SELECT COUNT(T4.BrandID) FROM `transaction` AS T1 INNER JOIN geolocation AS T2 ON T1.LocationID = T2.LocationID INNER JOIN location AS T3 ON T1.LocationID = T3.LocationID INNER JOIN rootbeer AS T4 ON T1.RootBeerID = T4.RootBeerID WHERE T2.Latitude = 38.559615 AND T2.Longitude = -121.42243 AND T4.ContainerType = 'Bottle...
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 total occurrence of the biwords pairs with "àbac" as its first word?
occurrence refers to occurrences; àbac refers to word = 'àbac'; first word refers to w1st
SELECT COUNT(T2.w1st) 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 T1.word = 'àbac'
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 are the names of the person that were not credited at the end of episode tt0629391?
not credited refers to credited = ''; episode tt0629391 refers to episode_id = 'tt0629391'
SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.credited = 'false' AND T1.episode_id = 'tt0629391'
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
Among the male customers in Sacramento, what percentage bought Dominion root beer in 2013?
male customers refers to Gender = 'M'; Sacramento refers to City = 'Sacramento'; percentage = MULTIPLY(DIVIDE(SUM(BrandID WHERE BrandName = 'Dominion'), COUNT(BrandID) WHERE City = 'Sacramento'), 1.0); Dominion refers to BrandName = 'Dominion'; in 2013 refers to TransactionDate > = 2013-01-01 AND TransactionDate < 2014...
SELECT CAST(COUNT(CASE WHEN T4.BrandName = 'Dominion' THEN T1.CustomerID ELSE NULL END) AS REAL) * 100 / 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....
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 episodes did J.K. Simmons' role appear on the show?
null
SELECT COUNT(T1.role) FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'J.K. Simmons'
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's the occurrence of the biwords pair whose first word is "àbac" and second word is "xinès"?
àbac refers to word = 'àbac'; xinès refers to word = 'xinès'; occurrence refers to occurrences
SELECT occurrences FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'àbac' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'xinès' )
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 root beer got the most five stars in 2012? Give the brand name of this beer.
most five stars refers to MAX(COUNT(StarRating = 5)); in 2012 refers to FirstBrewedYear = 2012;
SELECT T3.BrandName FROM rootbeer AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID WHERE T2.StarRating = 5 AND strftime('%Y', T2.ReviewDate) = '2012' GROUP BY T1.BrandID ORDER BY COUNT(T2.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
Calculate the average number of cast members that appeared in the credit from the 185th to the 193rd episode.
appeared in the credit refers to credited = 'TRUE'; from the 185th to the 193rd episode refers to number_in_series between 185 and 193; cast refers to category = 'Cast'; average number = divide(count(episode_id), 9)
SELECT CAST(COUNT(T1.episode_id) AS REAL) / (193 - 185 + 1) FROM Credit AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.category = 'Cast' AND T1.credited = 'true' AND T2.number_in_series BETWEEN 185 AND 193
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 brewed the most sold root beer in 2015?
brewery refers to BreweryName; most sold root beer refers to MAX(COUNT(BrandID)); in 2015 refers to TransactionDate > = '2015-01-01' AND TransactionDate < = '2015-12-31';
SELECT T3.BreweryName FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID WHERE T2.TransactionDate LIKE '2015%' GROUP BY T3.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
Who is the script supervisor of the series in episode tt0629204?
who refers to name; script supervisor refers to role = 'script supervisor'; episode tt0629204 refers to episode_id = 'tt0629204'
SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.episode_id = 'tt0629204' AND T1.role = 'script supervisor'
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 all the biwords pairs with "àbac" as its first word.
àbac refers to word = 'àbac'; first word refers to w1st
SELECT T1.word AS W1, T3.word AS W2 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 T1.word = 'àbac'
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
Give the number of male users who use phone branded HTC.
male refers to gender = 'M';
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.gender = 'M' AND T2.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 word pair that occured the highest amount of times in Addicio? Indicate how many times such word pair occured.
word pair refers to w1st.word w2nd.word; occurred the highest amount of times refers to max(occurrences); Addicio refers to title = 'Addicio'; times occurred refer to occurrences
SELECT T3.w1st, T3.w2nd, T3.occurrences FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid INNER JOIN biwords AS T3 ON T2.wid = T3.w1st OR T2.wid = T3.w2nd WHERE T1.title = 'Addicio' ORDER BY T3.occurrences DESC LIMIT 1
CREATE TABLE words ( occurrences INTEGER DEFAULT 0, -- word TEXT UNIQUE, -- wid INTEGER PRIMARY KEY AUTOINCREMENT, ); CREATE TABLE langs ( lid INTEGER PRIMARY KEY AUTOINCREMENT, pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0 lang TEXT...
law_episode
How many people, who were born in Canada, won an award in 1999?
born in Canada refers to birth_country = 'Canada'; in 1999 refers to year = 1999
SELECT COUNT(T1.person_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.year = 1999 AND T1.birth_country = 'Canada'
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 much higher in percentage does the word "grec" occur on the page titled "Àbac" than on the page titled "Astronomia"?
grec refers to word = 'grec'; Àbac refers to title = 'Àbac'; Astronomia refers to title = 'Astronomia'; percentage = DIVIDE(SUBTRACT(occurrences where title = 'Àbac' AND word = 'grec', occurrences where title = 'Astronomia' AND word = 'grec'), occurrences where title = 'Astronomia' AND word = 'grec')
SELECT CAST((SUM(CASE WHEN T3.title = 'Àbac' THEN T2.occurrences END) - SUM(CASE WHEN T3.title = 'Astronomia' THEN T2.occurrences END)) AS REAL) * 100 / SUM(CASE WHEN T3.title = 'Astronomia' THEN T2.occurrences END) FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.p...
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
Calculate the difference between the number of root beers sold that use cane sugar and corn syrup.
difference = SUBTRACT(SUM(CaneSugar = 'TRUE'), SUM(CornSyrup = 'TRUE')); use cane sugar refers to CaneSugar = 'TRUE'; corn syrup refers to CornSyrup = 'TRUE';
SELECT COUNT(CASE WHEN T3.CaneSugar = 'TRUE' THEN T1.BrandID ELSE NULL END) - COUNT(CASE WHEN T3.CornSyrup = 'TRUE' THEN T1.BrandID ELSE NULL END) AS DIFFERENCE FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID
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 have won at least 3 awards?
won refers to result = 'Winner'; at least 3 awards refers to count(result) > 3
SELECT COUNT(T1.person_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.result = 'Winner' GROUP BY T1.person_id HAVING COUNT(T2.award_id) >= 3
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...
law_episode
Who is the tallest camera operator?
who refers to name; the tallest refers to max(height_meters); camera operator refers to role = 'camera operator'
SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.role = 'camera operator' ORDER BY T2.height_meters 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
How many more times does the first word in the biwords pair "àbac-xinès" occur than the biwords pair itself?
àbac refers to word = 'àbac'; xinès refers to word = 'xinès'; How many more times the first word in the biwords occur than the biwords pair itself means SUBTRACT(words.occurrence, biwords.occurrences)
SELECT occurrences - ( SELECT occurrences FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'àbac' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'xinès' ) ) AS CALUS FROM words WHERE word = 'àbac'
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 are the keywords of the "Shield" episode?
"Shield" episode refers to title = 'Shield'
SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Shield'
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...
law_episode
How many awards has Julia Roberts been nominated for?
been nominated refers to result = 'Nominee'
SELECT COUNT(T2.award_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T1.name = 'Julia Roberts' AND T2.result = 'Nominee'
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...
law_episode
How many people gave the most enjoyed episode a 10-star rating?
the most enjoyed refers max(rating); 10-star refers to stars = 10
SELECT COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE 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
How many pages does the Catalan language have in Wikipedia?
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...
address
Provide the zip codes and area codes of the postal points with the community post office type at the elevation above 6000.
community post office type refers to type = 'Community Post Office'; elevation above 6000 refers to elevation > 6000;
SELECT T1.zip_code, T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.type = 'Community Post Office ' AND T2.elevation > 6000
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...
law_episode
What is the percentage of people who gave the "True North" episode a 1-star rating?
the "True North" episode refers to title = 'True North'; 1-star refers to stars = 1; percentage = divide(count(episode_id where stars = 1), count(episode_id)) * 100% where title = 'True North'
SELECT CAST(SUM(CASE WHEN T2.stars = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'True North' AND T1.episode_id = 'tt0629477'
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 Wikipedia pages are there on the language of the biwords pair "àbac-xinès"?
àbac refers to word = 'àbac'; xinès refers to word = 'xinès'; Wikipedia pages refer to pages
SELECT COUNT(T1.pages) FROM langs AS T1 INNER JOIN biwords AS T2 ON T1.lid = T2.lid WHERE T2.w1st = ( SELECT wid FROM words WHERE word = 'àbac' ) AND T2.w2nd = ( SELECT wid FROM words WHERE word = 'xinès' )
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
Indicate the location of all the events that occurred on April 30, 2016.
location = longitude, latitude; on April 30, 2016 refers timestamp BETWEEN '2016-04-30 00:00:00' AND '2016-04-30 23:59:59';
SELECT longitude, latitude FROM events WHERE date(timestamp) = '2016-04-30'
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, --...
food_inspection_2
What is the job title of employee who did inspection ID 52269?
job title refers to title
SELECT T1.title FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_id = 52269
CREATE TABLE inspection ( followup_to INTEGER, -- foreign key (employee_id) references employee(employee_id), employee_id INTEGER, -- license_no INTEGER, -- foreign key (followup_to) references inspection(inspection_id), foreign key (license_no) references establishment(license_no), inspection_id INTEGER p...
world_development_indicators
In 2005, which series codes use the International Monetary Fund, Balance of Payments Statistics Yearbook and data files source?
Year contains '2005'; series codes contain 'International Monetary Fund'
SELECT T1.Seriescode, T2.Source FROM Footnotes AS T1 INNER JOIN Series AS T2 ON T1.Seriescode = T2.SeriesCode WHERE T1.Year LIKE '%2005%' AND T2.Source LIKE 'International Monetary Fund%'
CREATE TABLE CountryNotes ( primary key (Countrycode, Seriescode), FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode), Seriescode TEXT NOT NULL, -- Countrycode TEXT NOT NULL, -- Description TEXT, -- FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode), ); CREATE TABLE Series ( BasePeriod TEXT, --...
food_inspection_2
What is the inspection result for inspection done by Thomas Langley?
inspection result refers to results
SELECT DISTINCT T2.results FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T1.first_name = 'Thomas' AND T1.last_name = 'Langley'
CREATE TABLE inspection ( followup_to INTEGER, -- foreign key (employee_id) references employee(employee_id), employee_id INTEGER, -- license_no INTEGER, -- foreign key (followup_to) references inspection(inspection_id), foreign key (license_no) references establishment(license_no), inspection_id INTEGER p...
world_development_indicators
From 1960 to 1965, which country had the highest Death rate, crude (per 1,000 people)?
IndicatorName = 'Death rate, crude (per 1,000 people)'; the highest refers to MAX(Value); from 1960 to 1965 refers to Year between '1960' and '1965'; country refers to CountryName;
SELECT CountryName FROM Indicators WHERE Year BETWEEN 1960 AND 1965 AND IndicatorName = 'Death rate, crude (per 1,000 people)' ORDER BY Value DESC LIMIT 1
CREATE TABLE CountryNotes ( primary key (Countrycode, Seriescode), FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode), Seriescode TEXT NOT NULL, -- Countrycode TEXT NOT NULL, -- Description TEXT, -- FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode), ); CREATE TABLE Series ( BasePeriod TEXT, --...
movie_platform
In which year was the movie "La Antena" released?
movie La Antena refers to movie_title = 'La Antena'; which year refers to movie_release_year;
SELECT movie_release_year FROM movies WHERE movie_title = 'La Antena'
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...
world_development_indicators
What is the minimum of International migrant stock, total of heavily indebted poor countries?
IndicatorName = 'International migrant stock, total'; heavily indebted poor countries referred to by its abbreviated 'HIPC' = OtherGroups; MIN(Value);
SELECT MIN(T2.Value) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.OtherGroups = 'HIPC' AND T2.IndicatorName = 'International migrant stock, total'
CREATE TABLE CountryNotes ( primary key (Countrycode, Seriescode), FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode), Seriescode TEXT NOT NULL, -- Countrycode TEXT NOT NULL, -- Description TEXT, -- FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode), ); CREATE TABLE Series ( BasePeriod TEXT, --...
movie_platform
Among the movie lists created after 2010/1/1, how many of them have over 200 followers?
created after 2010/1/1 refers to list_update_timestamp_utc>'2010/1/1'; over 200 followers refers to list_followers>200;
SELECT COUNT(*) FROM lists WHERE list_followers > 200 AND list_update_timestamp_utc > '2010-01-01'
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...
food_inspection_2
List down the phone numbers of employees who did Canvass inspection.
phone number refers to phone; Canvass inspection refers to inspection_type = 'Canvass'
SELECT DISTINCT T1.phone FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_type = 'Canvass'
CREATE TABLE inspection ( followup_to INTEGER, -- foreign key (employee_id) references employee(employee_id), employee_id INTEGER, -- license_no INTEGER, -- foreign key (followup_to) references inspection(inspection_id), foreign key (license_no) references establishment(license_no), inspection_id INTEGER p...
world_development_indicators
Which country has the highest value of Merchandise imports by the reporting economy (current US$)?
country refers to CountryName; the highest value implies MAX(Value); IndicatorName = 'Merchandise imports by the reporting economy (current US$)';
SELECT CountryName FROM Indicators WHERE IndicatorName = 'Merchandise imports by the reporting economy (current US$)' ORDER BY Value DESC LIMIT 1
CREATE TABLE CountryNotes ( primary key (Countrycode, Seriescode), FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode), Seriescode TEXT NOT NULL, -- Countrycode TEXT NOT NULL, -- Description TEXT, -- FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode), ); CREATE TABLE Series ( BasePeriod TEXT, --...
movie_platform
Which movie is more popular, "The General" or "Il grido"?
The General and Il grido are movie_title; more popular movie refers to higher (movie_popularity);
SELECT movie_title FROM movies WHERE movie_title = 'The General' OR movie_title = 'Il grido' ORDER BY movie_popularity 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...
food_inspection_2
Tell the address of employee who did inspection ID 52238?
null
SELECT T1.address FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_id = 52238
CREATE TABLE inspection ( followup_to INTEGER, -- foreign key (employee_id) references employee(employee_id), employee_id INTEGER, -- license_no INTEGER, -- foreign key (followup_to) references inspection(inspection_id), foreign key (license_no) references establishment(license_no), inspection_id INTEGER p...
movie_platform
How many movie lists were created by user 83373278 when he or she was a subscriber?
the user was a subscriber when he created the list refers to user_subscriber = 1; user 83373278 refers to user_id = 83373278;
SELECT COUNT(*) FROM lists_users WHERE user_id = 83373278 AND user_subscriber = 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...
food_inspection_2
What type of inspection was done at John Schaller?
type of inspection refers to inspection_type; John Schaller refers to dba_name = 'JOHN SCHALLER'
SELECT DISTINCT T2.inspection_type FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.dba_name = 'JOHN SCHALLER'
CREATE TABLE inspection ( followup_to INTEGER, -- foreign key (employee_id) references employee(employee_id), employee_id INTEGER, -- license_no INTEGER, -- foreign key (followup_to) references inspection(inspection_id), foreign key (license_no) references establishment(license_no), inspection_id INTEGER p...
world_development_indicators
What percentage of countries in South Asia have the Life expectancy at birth, female (years) greater than 50?
South Asia is the name of the region; IndicatorName = 'Life expectancy at birth, female (years)'; greater than 50 refers to Value>50; DIVIDE(COUNT(CountryCode where IndicatorName = 'Life expectancy at birth, female (years)'; Value>50; Region = 'South Asia'), COUNT(CountryCode where Region = 'South Asia')) as percentage...
SELECT CAST(SUM(CASE WHEN T2.value > 50 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.CountryCode) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Region = 'South Asia' AND T2.IndicatorName = 'Life expectancy at birth, female (years)'
CREATE TABLE CountryNotes ( primary key (Countrycode, Seriescode), FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode), Seriescode TEXT NOT NULL, -- Countrycode TEXT NOT NULL, -- Description TEXT, -- FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode), ); CREATE TABLE Series ( BasePeriod TEXT, --...
movie_platform
Was the user who created the list "250 Favourite Films" a trialist when he or she created the list?
the user was a trialist when he created the list refers to user_trailist = 1; 250 Favourite Films is list_title;
SELECT T2.user_trialist FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.list_title = '250 Favourite Films'
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...
food_inspection_2
List down the address of employees who did inspection dated 11/5/2010.
dated 11/5/2010 refers to inspection_date = '2010-11-05'
SELECT DISTINCT T1.address FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_date = '2010-11-05'
CREATE TABLE inspection ( followup_to INTEGER, -- foreign key (employee_id) references employee(employee_id), employee_id INTEGER, -- license_no INTEGER, -- foreign key (followup_to) references inspection(inspection_id), foreign key (license_no) references establishment(license_no), inspection_id INTEGER p...
world_development_indicators
Which country had the highest value of indicator belongs to Private Sector & Trade: Exports topic? Please list the country name and indicator name.
country refers to CountryName;
SELECT T1.CountryName, T1.IndicatorName FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName WHERE T2.Topic = 'Private Sector & Trade: Exports' ORDER BY T1.Value DESC LIMIT 1
CREATE TABLE CountryNotes ( primary key (Countrycode, Seriescode), FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode), Seriescode TEXT NOT NULL, -- Countrycode TEXT NOT NULL, -- Description TEXT, -- FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode), ); CREATE TABLE Series ( BasePeriod TEXT, --...
movie_platform
Please give me the url of the movie "La Antena".
movie La Antena refers to movie_title = 'La Antena'; url refers to movie_url;
SELECT movie_url FROM movies WHERE movie_title = 'La Antena'
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...
food_inspection_2
How many inspections done in 2010 had serious food safety issue?
in 2010 refers to inspection_date like '2010%'; had serious food safety issue refers to risk_level = 3
SELECT COUNT(T2.inspection_id) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y', T2.inspection_date) = '2010' AND T1.risk_level = 3
CREATE TABLE inspection ( followup_to INTEGER, -- foreign key (employee_id) references employee(employee_id), employee_id INTEGER, -- license_no INTEGER, -- foreign key (followup_to) references inspection(inspection_id), foreign key (license_no) references establishment(license_no), inspection_id INTEGER p...
world_development_indicators
Please list the indicator names of Arab World whose values are higher than 50 in 1960.
Arab World refers to CountryName; Year = '1960'; values are higher than 50 refers to Value>50;
SELECT IndicatorName FROM Indicators WHERE CountryName = 'Arab World' AND Year = 1960 AND Value > 50
CREATE TABLE CountryNotes ( primary key (Countrycode, Seriescode), FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode), Seriescode TEXT NOT NULL, -- Countrycode TEXT NOT NULL, -- Description TEXT, -- FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode), ); CREATE TABLE Series ( BasePeriod TEXT, --...
movie_platform
How many movie lists with over 100 movies had user 85981819 created when he or she was a paying subscriber?
the user was a paying subscriber when he created the list refers to user_has_payment_method = 1;  movie lists with over 100 refers to list_movie_number >100;  user 85981819 refers to user_id = 85981819;
SELECT COUNT(*) FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.user_id = 85981819 AND T1.list_movie_number > 100 AND T2.user_has_payment_method = 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...
food_inspection_2
What are the inspection results for Xando Coffee & Bar / Cosi Sandwich Bar?
Xando Coffee & Bar / Cosi Sandwich Bar refers to dba_name = 'XANDO COFFEE & BAR / COSI SANDWICH BAR'
SELECT DISTINCT T2.results FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.dba_name = 'XANDO COFFEE & BAR / COSI SANDWICH BAR'
CREATE TABLE inspection ( followup_to INTEGER, -- foreign key (employee_id) references employee(employee_id), employee_id INTEGER, -- license_no INTEGER, -- foreign key (followup_to) references inspection(inspection_id), foreign key (license_no) references establishment(license_no), inspection_id INTEGER p...
world_development_indicators
From 1968 to 1970, what are indicator names whose license type is open and values are less than 100?
From 1968 to 1970 refers to Year between '1968' and '1970'; values are less than 100 imply Value<100;
SELECT DISTINCT T1.IndicatorName FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName WHERE T1.Year >= 1968 AND T1.Year < 1971 AND T2.LicenseType = 'Open' AND T1.Value < 100
CREATE TABLE CountryNotes ( primary key (Countrycode, Seriescode), FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode), Seriescode TEXT NOT NULL, -- Countrycode TEXT NOT NULL, -- Description TEXT, -- FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode), ); CREATE TABLE Series ( BasePeriod TEXT, --...
movie_platform
How many movies registered on Mubi are directed by Hong Sang-soo?
Hong Sang-soo is the name of director;
SELECT COUNT(movie_id) FROM movies WHERE director_name = 'Hong Sang-soo'
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...
world_development_indicators
Please list out all annual indicator names of Sudan in 1961?
Sudan is the name of the country; Periodicity = 'Annual'; Year = '1961'
SELECT T1.IndicatorName FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName WHERE T1.CountryName = 'Sudan' AND T1.Year = 1961 AND T2.Periodicity = 'Annual'
CREATE TABLE CountryNotes ( primary key (Countrycode, Seriescode), FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode), Seriescode TEXT NOT NULL, -- Countrycode TEXT NOT NULL, -- Description TEXT, -- FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode), ); CREATE TABLE Series ( BasePeriod TEXT, --...
movie_platform
Please list the titles of the movie lists user 32172230 created when he or she was eligible for trial.
the user was eligible for trail when he created the list refers to user_eligile_for_trail = 1; user 32172230 refers to user_id = 32172230;
SELECT T1.list_title FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.user_id = 32172230 AND T2.user_eligible_for_trial = 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...
food_inspection_2
List down the dba name of restaurants that were inspected due to license.
inspected due to license refers to inspection_type = 'License'
SELECT T1.dba_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.inspection_type = 'License'
CREATE TABLE inspection ( followup_to INTEGER, -- foreign key (employee_id) references employee(employee_id), employee_id INTEGER, -- license_no INTEGER, -- foreign key (followup_to) references inspection(inspection_id), foreign key (license_no) references establishment(license_no), inspection_id INTEGER p...
world_development_indicators
Please list annual indicator names which have values of more than 100 in 1965.
Annual refers to Periodicity; values of more than 100 implies Value>100; Year = '1965';
SELECT DISTINCT T2.IndicatorName FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName WHERE T1.Year = 1965 AND T1.Value > 100 AND T2.Periodicity = 'Annual'
CREATE TABLE CountryNotes ( primary key (Countrycode, Seriescode), FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode), Seriescode TEXT NOT NULL, -- Countrycode TEXT NOT NULL, -- Description TEXT, -- FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode), ); CREATE TABLE Series ( BasePeriod TEXT, --...
movie_platform
How much is the popularity of the movie that has the highest popularity between 1920 to 1929 and when did the movie received its first rating score of 1 from the users who were a paying subscriber when they rated the movie ?
movie with highest popularity refers to MAX(movie_popularity); movie_release_year BETWEEN 1920 AND 1929; when the movie received its first rating score of 1 refers to oldest date in rating_timestamp_utc where rating score = 1; user was a paying subscriber when they rated the movie refers to user_has_payment_method = 1;
SELECT MAX(T2.movie_popularity), MIN(T1.rating_timestamp_utc) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year BETWEEN 1920 AND 1929 AND T1.rating_score = 1 AND T1.user_has_payment_method = 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...
food_inspection_2
Calculate the total salary for employees who did inspection from ID 52270 to 52272.
inspection from ID 52270 to 52272 refers to inspection_id between 52270 and 52272
SELECT SUM(T2.salary) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T1.inspection_id BETWEEN 52270 AND 52272
CREATE TABLE inspection ( followup_to INTEGER, -- foreign key (employee_id) references employee(employee_id), employee_id INTEGER, -- license_no INTEGER, -- foreign key (followup_to) references inspection(inspection_id), foreign key (license_no) references establishment(license_no), inspection_id INTEGER p...
world_development_indicators
What percentage of upper middle income countries which have the CO2 emissions from liquid fuel consumption (% of total) less than 80%?
IndicatorName = 'CO2 emissions from liquid fuel consumption (% of total)'; less than 80% implies Value<80%; IncomeGroup = 'Upper middle income'; DIVIDE(COUNT(CountryCode where IndicatorName = 'CO2 emissions from liquid fuel consumption (% of total)'; Value<80%; IncomeGroup = 'Upper middle income'), COUNT(CountryCode wh...
SELECT SUM(CASE WHEN T2.IndicatorName = 'CO2 emissions FROM liquid fuel consumption (% of total)' AND t2.Value < 80 THEN 1 ELSE 0 END) * 1.0 / COUNT(T1.CountryCode) persent FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IncomeGroup = 'Upper middle income'
CREATE TABLE CountryNotes ( primary key (Countrycode, Seriescode), FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode), Seriescode TEXT NOT NULL, -- Countrycode TEXT NOT NULL, -- Description TEXT, -- FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode), ); CREATE TABLE Series ( BasePeriod TEXT, --...
movie_platform
What is the URL to the user profile image on Mubi of the user who gave the movie id of 1103 a 5 ratinng score on 4/19/2020?
URL to the user profile image on Mubi  refers to user_avatar_image_url;  4/19/2020 refers to rating_date_utc
SELECT T2.user_avatar_image_url FROM ratings AS T1 INNER JOIN ratings_users AS T2 ON T1.user_id = T2.user_id WHERE T2.user_id = 1103 AND rating_score = 5 AND T2.rating_date_utc = '2020-04-19'
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...
food_inspection_2
Write down the last name of employee who did inspection ID 52238?
null
SELECT T1.last_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_id = 52238
CREATE TABLE inspection ( followup_to INTEGER, -- foreign key (employee_id) references employee(employee_id), employee_id INTEGER, -- license_no INTEGER, -- foreign key (followup_to) references inspection(inspection_id), foreign key (license_no) references establishment(license_no), inspection_id INTEGER p...
world_development_indicators
Which indicator name uses the Weighted average method and has the lowest value?
AggregationMethod = 'Weighted average'; the lowest value implies MIN(Value);
SELECT T1.IndicatorName, MIN(T1.Value) FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName WHERE T2.AggregationMethod = 'Weighted average'
CREATE TABLE CountryNotes ( primary key (Countrycode, Seriescode), FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode), Seriescode TEXT NOT NULL, -- Countrycode TEXT NOT NULL, -- Description TEXT, -- FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode), ); CREATE TABLE Series ( BasePeriod TEXT, --...
world_development_indicators
List out the series code of countries using Euro as their currency unit.
null
SELECT DISTINCT T2.SeriesCode FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.CurrencyUnit = 'Euro'
CREATE TABLE CountryNotes ( primary key (Countrycode, Seriescode), FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode), Seriescode TEXT NOT NULL, -- Countrycode TEXT NOT NULL, -- Description TEXT, -- FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode), ); CREATE TABLE Series ( BasePeriod TEXT, --...