db_id
stringclasses
66 values
question
stringlengths
24
325
evidence
stringlengths
1
673
gold_query
stringlengths
23
804
db_schema
stringclasses
66 values
retail_world
What is the position of Robert King?
'Robert King' is the full name of an employee; full name refers to FirstName, LastName; position refers to Title
SELECT Title FROM Employees WHERE FirstName = 'Robert' AND LastName = 'King'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
student_loan
How many unemployed students still have payment due?
still have payment due refers to bool = 'pos'
SELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN no_payment_due AS T2 ON T1.name = T2.name WHERE T2.bool = 'pos'
CREATE TABLE longest_absense_from_school ( "name" TEXT default '' not null primary key, foreign key ("name") references person ("name") on update cascade on delete cascade, "month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ...
retail_world
Please indicate total order quantity of product Geitost and calculate the percentage of such product among all the order quantity.
'Geitost' is a ProductName; calculation = DIVIDE(ProductName = 'Geitost', COUNT(ProductID)) * 100
SELECT SUM(IF(T1.ProductName = 'Geitost', 1, 0)) AS sum , CAST(SUM(IF(T1.ProductName = 'Geitost', 1, 0)) AS REAL) / COUNT(T1.ProductID) FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
student_loan
List all the organisations of students who filed for bankcrupcy.
organization refers to organ; students who filed for bankrupcy refers to file_for_bankrupcy.name
SELECT T2.organ FROM filed_for_bankrupcy AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name
CREATE TABLE longest_absense_from_school ( "name" TEXT default '' not null primary key, foreign key ("name") references person ("name") on update cascade on delete cascade, "month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ...
retail_world
How many product names have order quantity less than 50? Calculate the percentage of orders less than 50 out of total order quantity.
order quantity less than 50 refers to Quantity < 50; Calculation = DIVIDE(SUM(Quantity < 50), SUM(ProductID)) * 100
SELECT SUM(CASE WHEN T2.Quantity < 50 THEN 1 ELSE 0 END) , CAST(SUM(IF(T2.Quantity < 50, 1, 0)) AS REAL) / COUNT(T1.ProductID) FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
student_loan
Please list all the female students that have filed for bankruptcy.
females students have filed for bankruptcy refers to name that appeared in both filed_for_bankrupcy and male tables
SELECT name FROM filed_for_bankrupcy WHERE name NOT IN ( SELECT name FROM male )
CREATE TABLE longest_absense_from_school ( "name" TEXT default '' not null primary key, foreign key ("name") references person ("name") on update cascade on delete cascade, "month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ...
retail_world
List all category name of Exotic Liquids 's product with units in stock over 100.
'Exotic Liquids' is a CompanyName; units in stock over 100 refers to UnitsInStock > 100
SELECT T3.CategoryName FROM Suppliers AS T1 INNER JOIN Products AS T2 ON T1.SupplierID = T2.SupplierID INNER JOIN Categories AS T3 ON T2.CategoryID = T3.CategoryID WHERE T2.UnitsInStock > 100 AND T1.CompanyName = 'Exotic Liquids'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
retail_world
Please indicate the product name of Tokyo Traders company with order quantity greater than 40.
'Tokyo Traders' is a CompanyName; order quantity greater than 40 refers to Quantity > 40
SELECT DISTINCT T2.ProductName FROM Suppliers AS T1 INNER JOIN Products AS T2 ON T1.SupplierID = T2.SupplierID INNER JOIN `Order Details` AS T3 ON T2.ProductID = T3.ProductID WHERE T1.CompanyName = 'Tokyo Traders' AND T3.Quantity > 40
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
retail_world
Which of Cooperativa de Quesos 'Las Cabras' products have a unit price greater than 20?
Cooperativa de Quesos 'Las Cabras'' is a CompanyName; unit price greater than 20 refers to UnitPrice > 20
SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName LIKE 'Cooperativa de Quesos%' AND T1.UnitPrice > 20
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
student_loan
How many SMC's students that absent for 7 months?
SMC's students refers to school = 'smc'; absent for 7 months refers to month = 7
SELECT COUNT(T1.name) FROM enrolled AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.name = T2.name WHERE T1.school = 'smc' AND T2.month = 7
CREATE TABLE longest_absense_from_school ( "name" TEXT default '' not null primary key, foreign key ("name") references person ("name") on update cascade on delete cascade, "month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ...
retail_world
What is the difference in number of unit price from Chef Anton's Cajun Seasoning product and Chef Anton's Gumbo Mix product of New Orleans Cajun Delights company.
Chef Anton's Cajun Seasoning' AND 'Chef Anton''s Gumbo Mix' are ProductName; 'New Orleans Cajun Delights' is a CompanyName; calculation = SUBTRACT(UnitPrice where ProductName = 'Chef Anton's Cajun Seasoning', UnitPrice where ProductName = 'Chef Anton''s Gumbo Mix')
SELECT ( SELECT T1.UnitPrice FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'New Orleans Cajun Delights' AND T1.ProductName LIKE 'Chef Anton%s Cajun Seasoning' ) - ( SELECT T1.UnitPrice FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierI...
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
student_loan
What is the percentage of male students in the navy department?
in the navy department refers to organ = 'navy'; percentage refers to DIVIDE(COUNT(name where organ = 'navy'), COUNT(name))
SELECT CAST(COUNT(T2.name) AS REAL) * 100 / COUNT(T1.name) FROM enlist AS T1 LEFT JOIN male AS T2 ON T1.`name` = T2.`name` WHERE T1.organ = 'navy'
CREATE TABLE longest_absense_from_school ( "name" TEXT default '' not null primary key, foreign key ("name") references person ("name") on update cascade on delete cascade, "month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ...
retail_world
Indicate the category name of the product name with the highest units on order.
null
SELECT T2.CategoryName FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.UnitsOnOrder = ( SELECT MAX(T1.UnitsOnOrder) FROM Products )
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
retail_world
Indicate the name of the country where Leka Trading supplies Ipoh Coffee product.
'Leka Trading' is a CompanyName; 'Ipoh Coffee' is a ProductName
SELECT T2.Country FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName = 'Ipoh Coffee' AND T2.CompanyName = 'Leka Trading'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
student_loan
Calculate the ratio between unemployed students and disabled students.
ratio refers to DIVIDE(COUNT(name from unemployed), COUNT(name from disabled))
SELECT CAST(( SELECT COUNT(name) FROM unemployed ) AS REAL ) / ( SELECT COUNT(name) FROM disabled )
CREATE TABLE longest_absense_from_school ( "name" TEXT default '' not null primary key, foreign key ("name") references person ("name") on update cascade on delete cascade, "month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ...
retail_world
Provide the category name of the Chef Anton's Gumbo Mix product that New Orleans Cajun Delights company has.
'Chef Anton's Gumbo Mix' is a ProductName; 'New Orleans Cajun Delights' is a CompanyName;
SELECT T3.CategoryName FROM Suppliers AS T1 INNER JOIN Products AS T2 ON T1.SupplierID = T2.SupplierID INNER JOIN Categories AS T3 ON T2.CategoryID = T3.CategoryID WHERE T1.CompanyName = 'New Orleans Cajun Delights' AND T2.ProductName LIKE 'Chef Anton%s Gumbo Mix'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
student_loan
List all the navy students who are disabled.
navy students refers to organ = 'navy'; disabled student refers to disabled.name
SELECT T1.name FROM disabled AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'navy'
CREATE TABLE longest_absense_from_school ( "name" TEXT default '' not null primary key, foreign key ("name") references person ("name") on update cascade on delete cascade, "month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ...
retail_world
Which product of Exotic Liquids company that have the highest reorder levels?
'Exotic Liquids' is a CompanyName; the highest reorder levels refers to MAX(ReorderLevel)
SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Exotic Liquids' ORDER BY T1.ReorderLevel DESC LIMIT 1
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
retail_world
Which company name in London city has the most stocked products?
the most stocked products refers to MAX(UnitsInStock)
SELECT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.City = 'London' ORDER BY T1.UnitsInStock DESC LIMIT 1
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
student_loan
How many students has the longest absense from school for 5 months?
absense from school for 5 month refers to month = 5
SELECT COUNT(name) FROM longest_absense_from_school WHERE month = 5
CREATE TABLE longest_absense_from_school ( "name" TEXT default '' not null primary key, foreign key ("name") references person ("name") on update cascade on delete cascade, "month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ...
retail_world
What is the name of the company that has the product with the highest unit price?
name of the company refers to CompanyName; the highest unit price refers to MAX(UnitPrice)
SELECT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.UnitPrice = ( SELECT MAX(UnitPrice) FROM Products )
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
retail_world
How many product names does the supplier Exotic Liquids have?
'Exotic Liquids' is a CompanyName
SELECT COUNT(T1.ProductName) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Exotic Liquids'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
retail_world
Indicate which company is located in France?
company refers to CompanyName; France is a country
SELECT CompanyName FROM Customers WHERE Country = 'France'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
student_loan
List all the disabled female students.
null
SELECT T1.name FROM disabled AS T1 INNER JOIN male AS T2 ON T1.name <> T2.name
CREATE TABLE longest_absense_from_school ( "name" TEXT default '' not null primary key, foreign key ("name") references person ("name") on update cascade on delete cascade, "month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ...
retail_world
Indicate the address of the company Eastern Connection whose contact name is Ann Devon.
'Eastern Connection' is a CompanyName; 'Ann Devon' is the full name of an employee; full name refers to FirstName, LastName
SELECT Address FROM Customers WHERE CompanyName = 'Eastern Connection' AND ContactName = 'Ann Devon'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
student_loan
How many students are enrolled in UCLA school?
enrolled in UCLA refers to school = 'ucla';
SELECT COUNT(name) FROM enrolled WHERE school = 'ucla'
CREATE TABLE longest_absense_from_school ( "name" TEXT default '' not null primary key, foreign key ("name") references person ("name") on update cascade on delete cascade, "month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ...
retail_world
How many companies are there in the city of London?
companies refers to CompanyName;
SELECT COUNT(CompanyName) FROM Customers WHERE City = 'London'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
student_loan
Find the percentage of male students enlisted in the fire department.
percentage refers to DIVIDE(COUNT(organ = 'fire_department'), COUNT(name))
SELECT CAST(COUNT(T2.name) AS REAL) * 100 / COUNT(T1.name) FROM enlist AS T1 LEFT JOIN male AS T2 ON T1.name = T2.name WHERE T1.organ = 'fire_department'
CREATE TABLE longest_absense_from_school ( "name" TEXT default '' not null primary key, foreign key ("name") references person ("name") on update cascade on delete cascade, "month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ...
retail_world
Indicate the fax of the company Blondesddsl pre et fils in Strasbourg city.
'Blondesddsl pre et fils' is a CompanyName
SELECT Fax FROM Customers WHERE CompanyName = 'Blondesddsl pre et fils' AND City = 'Strasbourg'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
student_loan
How many students are enlisted in the Army organization?
enlisted in the army refers to organ = 'army';
SELECT COUNT(name) FROM enlist WHERE organ = 'army'
CREATE TABLE longest_absense_from_school ( "name" TEXT default '' not null primary key, foreign key ("name") references person ("name") on update cascade on delete cascade, "month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ...
retail_world
List the phone number of company named Around the Horn.
phone number refers to Phone; 'Around the Horn' is a CompanyName
SELECT Phone FROM Customers WHERE CompanyName = 'Around the Horn'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
student_loan
Please list the departments the students are absent from school for 9 months are in.
absent from school for 9 months refers to month = 9
SELECT T2.organ FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T1.`month` = 9
CREATE TABLE longest_absense_from_school ( "name" TEXT default '' not null primary key, foreign key ("name") references person ("name") on update cascade on delete cascade, "month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ...
retail_world
Indicate category name of soft drinks, coffees, teas, beers, and ales in description list.
Soft drinks, coffees, teas, beers, and ales' is Description of CategoryName
SELECT CategoryName FROM Categories WHERE Description = 'Soft drinks, coffees, teas, beers, and ales'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
student_loan
List at least 5 students who has the longest absense from schoool?
longest absense refers to MAX(month)
SELECT name FROM longest_absense_from_school ORDER BY month DESC LIMIT 5
CREATE TABLE longest_absense_from_school ( "name" TEXT default '' not null primary key, foreign key ("name") references person ("name") on update cascade on delete cascade, "month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ...
food_inspection
Among the violations in 2016, how many of them have unscheduled inspections?
unscheduled inspections refer to type = 'Routine - Unschedule'; year(date) = 2016;
SELECT COUNT(T2.business_id) FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) = '2016' AND T2.type = 'Routine - Unscheduled'
CREATE TABLE violations ( `risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0 `date` DATE NOT NULL, -- `violation_type_id` TEXT NOT NULL, -- FOREIGN KEY (`business_id`) REFERENCES `businesses` (`busine...
university
Give the name of the country that has the most universities.
has the most universities refers to MAX(COUNT(id)); name of the country refers to country_name
SELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id GROUP BY T2.country_name ORDER BY COUNT(T1.university_name) DESC LIMIT 1
CREATE TABLE ranking_system ( id INTEGER not null primary key, system_name TEXT default NULL, -- Example Values: `Times Higher Education World University Ranking`, `Shanghai Ranking`, `Center for World University Rankings` | Value Statics: Total count 3 - Distinct count 3 - Null count 0 ); CREATE TABLE country ( ...
beer_factory
Which of the root beer brand have the lowest purchase?
root beer brand refers to BrandName; lowest purchase refers to MIN(COUNT(BrandID));
SELECT T2.BrandName FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID GROUP BY T2.BrandID ORDER BY COUNT(T1.BrandID) 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...
olympics
Among the Olympic games held in Los Angeles, what is the name of the Olympic game that has the most number of competitors?
Los Angeles refers to city_name = 'Lost Angeles'; the Olympic game refers to games_name; the most number of competitors refers to MAX(COUNT(games_name));
SELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN games_city AS T3 ON T2.games_id = T3.games_id INNER JOIN city AS T4 ON T3.city_id = T4.id WHERE T4.city_name = 'Los Angeles' GROUP BY T1.id ORDER BY COUNT(T2.person_id) DESC LIMIT 1
CREATE TABLE event ( event_name TEXT default NULL, -- sport_id INTEGER default NULL, -- foreign key (sport_id) references sport(id), id INTEGER not null primary key, ); CREATE TABLE sport ( id INTEGER not null primary key, sport_name TEXT default NULL, -- ); CREATE TABLE city ( city_name TEXT default NUL...
disney
How many of Gary Trousdale's movies are adventure movies?
Gary Trousdale refers director = 'Gary Trousdale'; the adventure movie refers to genre = 'Adventure';
SELECT COUNT(T.name) FROM ( SELECT T1.name FROM director AS T1 INNER JOIN movies_total_gross AS T2 ON T1.name = T2.movie_title WHERE T1.director = 'Gary Trousdale' AND T2.genre = 'Adventure' GROUP BY T1.name ) T
CREATE TABLE movies_total_gross ( MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0 release_date TEXT, -- total_gross TEXT, -- foreign key (movie_title) references characters(movie_title), movie_title TEXT, -- genre TEX...
movie_platform
What is the percentage of list created by user who was a subscriber when he created the list?
was a subscriber refers to user_subscriber = 1; percentage refers to DIVIDE(COUNT(user_subscriber = 1),COUNT(list_id))
SELECT CAST(SUM(CASE WHEN user_subscriber = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(list_id) FROM lists_users
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
In businesses with an owner address 500 California St, 2nd Floor of Silicon Valley, list the type of inspection of the business with the highest score.
the highest score MAX(score); Silicon Valley is located in 'SAN FRANCISCO';
SELECT T1.type FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.owner_address = '500 California St, 2nd Floor' AND T2.owner_city = 'SAN FRANCISCO' ORDER BY T1.score DESC LIMIT 1
CREATE TABLE violations ( `risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0 `date` DATE NOT NULL, -- `violation_type_id` TEXT NOT NULL, -- FOREIGN KEY (`business_id`) REFERENCES `businesses` (`busine...
university
What is the ID of the university that has only 1% of international students between 2011 to 2015?
has only 1% of international students refers to pct_international_students = 1; between 2011 to 2015 refers to year BETWEEN 2011 AND 2015; ID of university refers to university_id
SELECT university_id FROM university_year WHERE pct_international_students = 1 AND year BETWEEN 2011 AND 2015
CREATE TABLE ranking_system ( id INTEGER not null primary key, system_name TEXT default NULL, -- Example Values: `Times Higher Education World University Ranking`, `Shanghai Ranking`, `Center for World University Rankings` | Value Statics: Total count 3 - Distinct count 3 - Null count 0 ); CREATE TABLE country ( ...
beer_factory
What is the percentage of female customers who subscribed to the email list?
percentage = MULTIPLY(DIVIDE(COUNT(CustomerID WHERE Gender = 'F'), COUNT(CustomerID) WHERE SubscribedToEmailList = 'TRUE'), 1.0); female refers to Gender = 'F'; subscribed to the email list refers to SubscribedToEmailList = 'TRUE';
SELECT CAST(COUNT(CASE WHEN Gender = 'F' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(SubscribedToEmailList) FROM customers WHERE 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...
olympics
Calculate the average age of the persons who participated in the 1992 Summer Games.
DIVIDE(SUM(age), COUNT(person_id)) where games_name = '1992 Summer';
SELECT AVG(T2.age) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_name = '1992 Summer'
CREATE TABLE event ( event_name TEXT default NULL, -- sport_id INTEGER default NULL, -- foreign key (sport_id) references sport(id), id INTEGER not null primary key, ); CREATE TABLE sport ( id INTEGER not null primary key, sport_name TEXT default NULL, -- ); CREATE TABLE city ( city_name TEXT default NUL...
disney
Which director did Bill Thompson work the most with?
Bill Thompson refers to voice-actor = 'Bill Thompson'; worked the most refers to MAX(COUNT(name));
SELECT director FROM director AS T1 INNER JOIN `voice-actors` AS T2 ON T1.name = T2.movie WHERE T2.`voice-actor` = 'Bill Thompson' GROUP BY director ORDER BY COUNT(director) DESC LIMIT 1
CREATE TABLE movies_total_gross ( MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0 release_date TEXT, -- total_gross TEXT, -- foreign key (movie_title) references characters(movie_title), movie_title TEXT, -- genre TEX...
public_review_platform
What is the category of the business with medium review length and highest review stars within business ID from 6 t0 9?
category refers to category_name; highest review stars refers to max(review_stars); business ID from 6 to 9 refers to business_id between 6 and 9
SELECT T4.category_name FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T2.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T1.review_length LIKE 'Medium' AND T2.business_id BETWEEN 6 AND 9 ORDER BY ...
CREATE TABLE Attributes ( attribute_name TEXT, -- attribute_id INTEGER constraint Attributes_pk primary key, ); CREATE TABLE Elite ( year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ...
movie_platform
Provide list titles created by user who are eligible for trial when he created the list.
eligible for trial refers to user_eligible_for_trial = 1
SELECT DISTINCT T2.list_title FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T1.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
What is the owner's name of the of the business that violates 103156 on June 12, 2014?
business that violates 103156 on June 12, 2014 refers to business_id where violation_type_id = 103156 and date = '2014-06-12';
SELECT DISTINCT T2.owner_name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.violation_type_id = 103156 AND T1.`date` = '2014-06-12'
CREATE TABLE violations ( `risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0 `date` DATE NOT NULL, -- `violation_type_id` TEXT NOT NULL, -- FOREIGN KEY (`business_id`) REFERENCES `businesses` (`busine...
university
How many criteria belong to ranking system ID 3?
null
SELECT COUNT(id) FROM ranking_criteria WHERE ranking_system_id = 3
CREATE TABLE ranking_system ( id INTEGER not null primary key, system_name TEXT default NULL, -- Example Values: `Times Higher Education World University Ranking`, `Shanghai Ranking`, `Center for World University Rankings` | Value Statics: Total count 3 - Distinct count 3 - Null count 0 ); CREATE TABLE country ( ...
beer_factory
What is the percentage difference of River City sale compare to Frostie?
percentage difference = (DIVIDE(MULTIPLY(SUBTRACT(SUM(PurchasePrice WHERE BrandName = 'River City'), SUM(PurchasePrice WHERE BrandName = 'Frostie')), 100), SUM(PurchasePrice WHERE BrandName = 'Frostie'))); River City refers to BrandName = 'River City'; Frostie refers to BrandName = 'Frostie';
SELECT CAST((SUM(CASE WHEN T3.BrandName = 'River City' THEN T2.PurchasePrice ELSE 0 END) - SUM(CASE WHEN T3.BrandName = 'Frostie' THEN T2.PurchasePrice ELSE 0 END)) AS REAL) * 100 / SUM(CASE WHEN T3.BrandName = 'Frostie' THEN T2.PurchasePrice ELSE 0 END) FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeer...
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...
olympics
How many times was Larysa Semenivna Latynina (Diriy-) declared as champion in Gymnastics Women's Individual All-Around?
Gymnastics Women's Individual All-Around refers to event_name = 'Gymnastics Women''s Individual All-Around'; declared as champion refers to medal_name = 'Gold' or medal_id = 1;
SELECT COUNT(T1.id) FROM event AS T1 INNER JOIN competitor_event AS T2 ON T1.id = T2.event_id INNER JOIN games_competitor AS T3 ON T2.competitor_id = T3.id INNER JOIN person AS T4 ON T3.person_id = T4.id WHERE T4.full_name = 'Larysa Semenivna Latynina (Diriy-)' AND T1.event_name LIKE 'Gymnastics Women%s Individual All-...
CREATE TABLE event ( event_name TEXT default NULL, -- sport_id INTEGER default NULL, -- foreign key (sport_id) references sport(id), id INTEGER not null primary key, ); CREATE TABLE sport ( id INTEGER not null primary key, sport_name TEXT default NULL, -- ); CREATE TABLE city ( city_name TEXT default NUL...
public_review_platform
Among the Yelp_Businesses which are still running, how many of them fall under the category of "Food"?
are still running refers to active = 'true'; the category of "Food" refers to category_name = 'Food'
SELECT COUNT(T3.business_id) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id INNER JOIN Tips AS T4 ON T3.business_id = T4.business_id WHERE T1.category_name LIKE 'Food' AND T3.active LIKE 'TRUE'
CREATE TABLE Attributes ( attribute_name TEXT, -- attribute_id INTEGER constraint Attributes_pk primary key, ); CREATE TABLE Elite ( year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ...
movie_platform
Name all the list titles created by user 4208563.
user 4208563 refers to user_id = 4208563
SELECT list_title FROM lists WHERE user_id LIKE 4208563
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
List the violation type ID of business with business ID from 30 to 50 and located at 747 IRVING St, San Francisco.
business ID from 30 to 50 refers to business_id between 30 and 50; address = '747 IRVING St'; city = 'San Francisco';
SELECT DISTINCT T1.violation_type_id FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.business_id BETWEEN 30 AND 50 AND T2.address = '747 IRVING St' AND T2.city = 'San Francisco'
CREATE TABLE violations ( `risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0 `date` DATE NOT NULL, -- `violation_type_id` TEXT NOT NULL, -- FOREIGN KEY (`business_id`) REFERENCES `businesses` (`busine...
university
What is the student staff ratio of the university with the highest student staff ratio of all time?
highest student staff ratio refers to max(student_staff_ratio)
SELECT MAX(student_staff_ratio) FROM university_year WHERE student_staff_ratio = ( SELECT MAX(student_staff_ratio) FROM university_year )
CREATE TABLE ranking_system ( id INTEGER not null primary key, system_name TEXT default NULL, -- Example Values: `Times Higher Education World University Ranking`, `Shanghai Ranking`, `Center for World University Rankings` | Value Statics: Total count 3 - Distinct count 3 - Null count 0 ); CREATE TABLE country ( ...
beer_factory
How many transactions were made at Sac State Union?
Sac State Union refers to LocationName = 'Sac State Union';
SELECT COUNT(T1.TransactionID) FROM `transaction` AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.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...
disney
List all the voice actors in the movie directed by Ben Sharpsteen which was released on February 9, 1940.
Ben Sharpsteen refers to director = 'Ben Sharpsteen'; released on February 9, 1940 refers to release_date = 'Feb 9, 1940';
SELECT T2.`voice-actor` FROM director AS T1 INNER JOIN `voice-actors` AS T2 INNER JOIN movies_total_gross AS T3 ON T1.name = T2.movie AND T2.movie = T3.movie_title WHERE T1.director = 'Ben Sharpsteen' AND T3.release_date = 'Feb 9, 1940' AND T2.`voice-actor` != 'None' GROUP BY T2.`voice-actor`
CREATE TABLE movies_total_gross ( MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0 release_date TEXT, -- total_gross TEXT, -- foreign key (movie_title) references characters(movie_title), movie_title TEXT, -- genre TEX...
public_review_platform
What is the closing and opening time of businesses located at Tempe with highest star rating?
located at Tempe refers to city = 'Tempe'; highest star rating refers to max(stars)
SELECT T2.closing_time, T2.opening_time FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id WHERE T1.city LIKE 'Tempe' ORDER BY T1.stars DESC LIMIT 1
CREATE TABLE Attributes ( attribute_name TEXT, -- attribute_id INTEGER constraint Attributes_pk primary key, ); CREATE TABLE Elite ( year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ...
movie_platform
For all list titles with at least 200 movies in the list, what is their average number of followers?
at least 200 movies in the list refers to list_movie_number > 200; average number of followers refers to avg(list_followers)
SELECT AVG(list_followers) FROM lists WHERE list_movie_number > 200
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
Among the owners from Cameron Park, what is the business name of the business with a score of 100?
Cameron Park is a name of city;
SELECT DISTINCT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.owner_city = 'Cameron Park' AND T1.score = 100
CREATE TABLE violations ( `risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0 `date` DATE NOT NULL, -- `violation_type_id` TEXT NOT NULL, -- FOREIGN KEY (`business_id`) REFERENCES `businesses` (`busine...
university
How many state universities are there?
state universities refers to university_name LIKE '%State%';
SELECT COUNT(*) FROM university WHERE university_name LIKE '%State%'
CREATE TABLE ranking_system ( id INTEGER not null primary key, system_name TEXT default NULL, -- Example Values: `Times Higher Education World University Ranking`, `Shanghai Ranking`, `Center for World University Rankings` | Value Statics: Total count 3 - Distinct count 3 - Null count 0 ); CREATE TABLE country ( ...
beer_factory
Please name all of the cities in California.
California refers to State = 'CA';
SELECT DISTINCT City FROM customers WHERE 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...
olympics
How many athletes participated in the 2014 Winter Olympics?
athletes refer to person_id; 2014 Winter Olympics refer to games_name = '2014 Winter';
SELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '2014 Winter'
CREATE TABLE event ( event_name TEXT default NULL, -- sport_id INTEGER default NULL, -- foreign key (sport_id) references sport(id), id INTEGER not null primary key, ); CREATE TABLE sport ( id INTEGER not null primary key, sport_name TEXT default NULL, -- ); CREATE TABLE city ( city_name TEXT default NUL...
disney
Please list the release dates of all the movies in which Alan Tudyk is a voice actor.
FALSE;
SELECT T2.release_date FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title WHERE T1.`voice-actor` = 'Alan Tudyk'
CREATE TABLE movies_total_gross ( MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0 release_date TEXT, -- total_gross TEXT, -- foreign key (movie_title) references characters(movie_title), movie_title TEXT, -- genre TEX...
movie_platform
Name all lists created by a user who was a subcriber when created the list.
was a subscriber refers to user_subscriber = 1
SELECT DISTINCT T2.list_id FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T1.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
Who is the owner of the business that has a high risk violation of 103109 and described as unclean or unsanitary food contact surfaces?
owner refers to owner_name; high risk violation of 103109 and described as unclean or unsanitary food contact surfaces refers to risk_category = 'High Risk' where violation_type_id = 103109 and description = 'Unclean or unsanitary food contact surfaces';
SELECT DISTINCT T2.owner_name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' AND T1.violation_type_id = 103109 AND T1.description = 'Unclean or unsanitary food contact surfaces'
CREATE TABLE violations ( `risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0 `date` DATE NOT NULL, -- `violation_type_id` TEXT NOT NULL, -- FOREIGN KEY (`business_id`) REFERENCES `businesses` (`busine...
university
What is the ranking system ID of the award criteria?
award criteria refers to criteria_name = 'Award';
SELECT ranking_system_id FROM ranking_criteria WHERE criteria_name = 'Award'
CREATE TABLE ranking_system ( id INTEGER not null primary key, system_name TEXT default NULL, -- Example Values: `Times Higher Education World University Ranking`, `Shanghai Ranking`, `Center for World University Rankings` | Value Statics: Total count 3 - Distinct count 3 - Null count 0 ); CREATE TABLE country ( ...
beer_factory
How many purchases were made at Sac State American River Courtyard using Master Card?
Sac State American River Courtyard refers to LocationName = 'Sac State American River Courtyard'; Master Card refers to CreditCardType = 'MasterCard';
SELECT COUNT(T1.TransactionID) FROM `transaction` AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.LocationName = 'Sac State American River Courtyard' AND T1.CreditCardType = 'MasterCard'
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...
public_review_platform
Count the active businesses that has an attribute of caters with low review count.
active businesses refers to active = 'true'; attribute of caters refers to attribute_name = 'Caters'
SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T3.attribute_name LIKE 'Caters' AND T1.review_count LIKE 'Low' AND T1.active LIKE 'TRUE'
CREATE TABLE Attributes ( attribute_name TEXT, -- attribute_id INTEGER constraint Attributes_pk primary key, ); CREATE TABLE Elite ( year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ...
movie_platform
Among the lists with at least one follower, how many were created by user who was subscriber when created the list?
lists with at least one follower refers to list_followers > = 1; was a subscriber refers to user_subscriber = 1
SELECT COUNT(T1.list_id) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_followers >= 1 AND T1.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
In businesses that violates 103157 on May 27, 2016 , what is the name of the business that has an unscheduled inspection?
businesses that violates 103157 refer to business_id where violation_type_id = 103157; date = '2016-05-27'; unscheduled inspection refers to type = 'Routine - Unscheduled';
SELECT DISTINCT T3.name FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id INNER JOIN businesses AS T3 ON T2.business_id = T3.business_id WHERE T1.`date` = '2016-05-27' AND T1.violation_type_id = 103157 AND T2.type = 'Routine - Unscheduled'
CREATE TABLE violations ( `risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0 `date` DATE NOT NULL, -- `violation_type_id` TEXT NOT NULL, -- FOREIGN KEY (`business_id`) REFERENCES `businesses` (`busine...
university
How many universities have at least 80,000 students in the year 2011?
have at least 80,000 students refers to num_students > 8000; year = 2011
SELECT COUNT(*) FROM university_year WHERE num_students > 80000 AND year = 2011
CREATE TABLE ranking_system ( id INTEGER not null primary key, system_name TEXT default NULL, -- Example Values: `Times Higher Education World University Ranking`, `Shanghai Ranking`, `Center for World University Rankings` | Value Statics: Total count 3 - Distinct count 3 - Null count 0 ); CREATE TABLE country ( ...
public_review_platform
List the categories of active businesses in Surprise, AZ.
categories refers to category_name; active businesses refers to active = 'true'; in Surprise, AZ refers to city = 'Surprise' and state = 'AZ'
SELECT T3.category_name FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.active LIKE 'TRUE' AND T1.state LIKE 'AZ' AND T1.city LIKE 'Surprise' GROUP BY T3.category_name
CREATE TABLE Attributes ( attribute_name TEXT, -- attribute_id INTEGER constraint Attributes_pk primary key, ); CREATE TABLE Elite ( year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ...
movie_platform
Which title list has not been updated for the longest period of time? State how long it has not been updated?
not been updated for the longest period of time refers to MIN(list_update_timestamp_utc); how long it has not been updated refers to SUBTRACT(CURRENT_TIMESTAMP, list_update_timestamp_utc)
SELECT list_title , datetime(CURRENT_TIMESTAMP, 'localtime') - datetime(list_update_timestamp_utc) FROM lists ORDER BY list_update_timestamp_utc 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
List the tax code and inspection type of the business named "Rue Lepic".
"Rue Lepic" is the name of the business;
SELECT DISTINCT T3.tax_code, T2.type FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id INNER JOIN businesses AS T3 ON T2.business_id = T3.business_id WHERE T3.name = 'Rue Lepic'
CREATE TABLE violations ( `risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0 `date` DATE NOT NULL, -- `violation_type_id` TEXT NOT NULL, -- FOREIGN KEY (`business_id`) REFERENCES `businesses` (`busine...
music_platform_2
What is the average rating of the podcast "Please Excuse My Dead Aunt Sally"?
"Please Excuse My Dead Aunty Sally" is the title of podcast; Average rating = Divide (Sum(rating), Count(rating))
SELECT AVG(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Please Excuse My Dead Aunt Sally'
CREATE TABLE reviews ( author_id TEXT not null, -- rating INTEGER not null, -- Example Values: `5`, `1`, `3`, `4`, `2` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0 title TEXT not null, -- podcast_id TEXT not null constraint reviews_podcasts_podcast_id_fk references podcasts, -- co...
beer_factory
Which type of card did Dick Ruthven use to pay for all of his transactions?
type of card refers to CreditCardType;
SELECT DISTINCT T2.CreditCardType FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'Dick' AND T1.Last = 'Ruthven'
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...
olympics
How many Olympic games were held in London?
London refers to city_name = 'London';
SELECT COUNT(T1.games_id) FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id WHERE T2.city_name = 'London'
CREATE TABLE event ( event_name TEXT default NULL, -- sport_id INTEGER default NULL, -- foreign key (sport_id) references sport(id), id INTEGER not null primary key, ); CREATE TABLE sport ( id INTEGER not null primary key, sport_name TEXT default NULL, -- ); CREATE TABLE city ( city_name TEXT default NUL...
disney
What is the most popular movie directed by Ron Clements?
Ron Clements refers to director = 'Ron Clements'; the most popular movie refers to movie_title where MAX(total_gross);
SELECT T2.name FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T2.name = T1.movie_title WHERE T2.director = 'Ron Clements' ORDER BY CAST(REPLACE(SUBSTR(total_gross, 2), ',', '') AS int) DESC LIMIT 1
CREATE TABLE movies_total_gross ( MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0 release_date TEXT, -- total_gross TEXT, -- foreign key (movie_title) references characters(movie_title), movie_title TEXT, -- genre TEX...
movie_platform
Give the percentage of subscribers who rated who rated the movie "G.I. Jane".
movie "G.I. Jane" refers to movie_title = 'G.I. Jane'; subscribers refers to user_subscriber = 1; percentage refers to DIVIDE(COUNT(user_subscriber = 1),COUNT(user_subscriber))*100
SELECT CAST(SUM(CASE WHEN T3.user_subscriber = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id INNER JOIN lists_users AS T3 ON T1.user_id = T3.user_id WHERE T2.movie_title = 'G.I. Jane'
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
Among the businesses with score that ranges from 70 to 80, list their violation type ID and risk category.
businesses with score that ranges from 70 to 80 refer to business_id where score between 80 and 90;
SELECT DISTINCT T1.violation_type_id, T1.risk_category FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id INNER JOIN inspections AS T3 ON T2.business_id = T3.business_id WHERE T3.score BETWEEN 70 AND 80
CREATE TABLE violations ( `risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0 `date` DATE NOT NULL, -- `violation_type_id` TEXT NOT NULL, -- FOREIGN KEY (`business_id`) REFERENCES `businesses` (`busine...
music_platform_2
How many ratings of 5 have been given to the podcast "Please Excuse My Dead Aunt Sally"?
rating of 5 refers to rating = 5; 'Please Excuse My Dead Aunt Sally' is the title of podcast
SELECT COUNT(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Please Excuse My Dead Aunt Sally' AND T2.rating = 5
CREATE TABLE reviews ( author_id TEXT not null, -- rating INTEGER not null, -- Example Values: `5`, `1`, `3`, `4`, `2` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0 title TEXT not null, -- podcast_id TEXT not null constraint reviews_podcasts_podcast_id_fk references podcasts, -- co...
beer_factory
Which brand has the lowest star rating with a "Too spicy!" review?
lowest star rating refers to MIN(StarRating); "Too spicy!" review refers to Review = 'Too Spicy!';
SELECT T1.BrandName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T2.BrandID = T1.BrandID WHERE T2.StarRating = 1 AND T2.Review = 'Too Spicy!'
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...
public_review_platform
Among the active businesses located at Chandler, AZ, list the category and atrributes of business with a medium review count.
active businesses refers to active = 'true'; located at Chandler, AZ refers to city = 'Chandler', state = 'AZ'; category refers to category_name; atrributes refers to attribute_name
SELECT T3.category_name, T5.attribute_name FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id INNER JOIN Business_Attributes AS T4 ON T1.business_id = T4.business_id INNER JOIN Attributes ...
CREATE TABLE Attributes ( attribute_name TEXT, -- attribute_id INTEGER constraint Attributes_pk primary key, ); CREATE TABLE Elite ( year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ...
movie_platform
For the list with more than 200 followers, state the title and how long the list has been created?
more than 200 followers refers to list_followers >200; how long the list has been created refers to SUBTRACT(CURRENT_TIMESTAMP,list_creation_timestamp_utc)
SELECT list_title , 365 * (strftime('%Y', 'now') - strftime('%Y', list_creation_timestamp_utc)) + 30 * (strftime('%m', 'now') - strftime('%m', list_creation_timestamp_utc)) + strftime('%d', 'now') - strftime('%d', list_creation_timestamp_utc) FROM lists WHERE list_followers > 200
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
Among the businesses within the postal code 94117, what is total number of businesses with a high risk category?
businesses with a high risk category refer to business_id where risk_category = 'High Risk';
SELECT COUNT(DISTINCT T2.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.postal_code = 94117 AND T1.risk_category = 'High Risk'
CREATE TABLE violations ( `risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0 `date` DATE NOT NULL, -- `violation_type_id` TEXT NOT NULL, -- FOREIGN KEY (`business_id`) REFERENCES `businesses` (`busine...
music_platform_2
Please list the titles of the podcasts for which the author whose ID is F7E5A318989779D has written a review.
author whose ID is F7E5A318989779D refers to author_id = 'F7E5A318989779D'
SELECT T2.title FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.author_id = 'F7E5A318989779D'
CREATE TABLE reviews ( author_id TEXT not null, -- rating INTEGER not null, -- Example Values: `5`, `1`, `3`, `4`, `2` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0 title TEXT not null, -- podcast_id TEXT not null constraint reviews_podcasts_podcast_id_fk references podcasts, -- co...
disney
How many horror movies are there?
Horror refers to genre = 'Horror';
SELECT COUNT(movie_title) FROM `movies_total_gross` WHERE genre = 'Horror'
CREATE TABLE movies_total_gross ( MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0 release_date TEXT, -- total_gross TEXT, -- foreign key (movie_title) references characters(movie_title), movie_title TEXT, -- genre TEX...
movie_platform
List all the titles created by user who was a subsriber when he created the list and have less than 50 movies in the list.
have less than 50 movies in the list refers to list_movie_number <50; was a subscriber refers to user_subscriber = 1
SELECT DISTINCT T2.list_title FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_movie_number < 50 AND T1.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
List owner's name of businesses with a 100 score.
owner's name of businesses refers to owner_name;
SELECT DISTINCT T2.owner_name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score = 100
CREATE TABLE violations ( `risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0 `date` DATE NOT NULL, -- `violation_type_id` TEXT NOT NULL, -- FOREIGN KEY (`business_id`) REFERENCES `businesses` (`busine...
music_platform_2
Among the reviews for the podcast "Please Excuse My Dead Aunt Sally", how many of them are made in the year 2019?
"Please Excuse My Dead Aunt Sally" is the title of podcast; made in the year 2019 refers to created_at like '2019%'
SELECT COUNT(T2.created_at) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Please Excuse My Dead Aunt Sally' AND T2.created_at LIKE '2019-%'
CREATE TABLE reviews ( author_id TEXT not null, -- rating INTEGER not null, -- Example Values: `5`, `1`, `3`, `4`, `2` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0 title TEXT not null, -- podcast_id TEXT not null constraint reviews_podcasts_podcast_id_fk references podcasts, -- co...
beer_factory
What is the precise location of the place where Tommy Kono made a purchase in 2014?
precise location = Latitude, Longitude; in 2014 refers to TransactionDate LIKE '2014%';
SELECT DISTINCT T1.Latitude, T1.Longitude FROM geolocation AS T1 INNER JOIN `transaction` AS T2 ON T2.LocationID = T1.LocationID INNER JOIN customers AS T3 ON T3.CustomerID = T2.CustomerID WHERE T3.First = 'Tommy' AND T3.Last = 'Kono' AND T2.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...
olympics
At what age did Michael Fred Phelps, II join the Olympics?
At what age join the Olympics refers to MIN(age);
SELECT T2.age FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T1.full_name = 'Michael Fred Phelps, II' ORDER BY T2.age LIMIT 1
CREATE TABLE event ( event_name TEXT default NULL, -- sport_id INTEGER default NULL, -- foreign key (sport_id) references sport(id), id INTEGER not null primary key, ); CREATE TABLE sport ( id INTEGER not null primary key, sport_name TEXT default NULL, -- ); CREATE TABLE city ( city_name TEXT default NUL...
disney
How many movies for mature audiences or parental guidance suggested did Bill Thompson work as a voice actor?
movies for mature audiences or parental guidance refer to movie_title where MPAA_rating = 'PG';
SELECT COUNT(T.movie) FROM ( SELECT T1.movie FROM `voice-actors` AS T1 INNER JOIN movies_total_gross AS T2 ON T1.movie = T2.movie_title WHERE MPAA_rating = 'PG' AND `voice-actor` = 'Bill Thompson' GROUP BY T1.movie ) AS T
CREATE TABLE movies_total_gross ( MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0 release_date TEXT, -- total_gross TEXT, -- foreign key (movie_title) references characters(movie_title), movie_title TEXT, -- genre TEX...
movie_platform
Who is the user who created the list titled 'Sound and Vision'? Was he a subcriber when he created the list?
list titled 'Sound and Vision' refers to list_title = 'Sound and Vision'; user_subscriber = 1 means the user was a subscriber when he rated the movie; user_subscriber = 0 means the user was not a subscriber when he rated the movie
SELECT T1.user_id, T1.user_subscriber FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_title LIKE 'Sound and Vision'
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
Give the business ID and risk category of the business owned by San Francisco Madeleine, Inc.
business owned by San Francisco Madeleine, Inc. refers to business_id where owner_name = 'San Francisco Madeleine, Inc.';
SELECT DISTINCT T2.business_id, T1.risk_category FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.owner_name = 'San Francisco Madeleine, Inc.'
CREATE TABLE violations ( `risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0 `date` DATE NOT NULL, -- `violation_type_id` TEXT NOT NULL, -- FOREIGN KEY (`business_id`) REFERENCES `businesses` (`busine...
music_platform_2
How many reviews are created for the podcast "Scaling Global" under?
"Scaling Global" is the title of podcast
SELECT COUNT(T2.content) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Scaling Global'
CREATE TABLE reviews ( author_id TEXT not null, -- rating INTEGER not null, -- Example Values: `5`, `1`, `3`, `4`, `2` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0 title TEXT not null, -- podcast_id TEXT not null constraint reviews_podcasts_podcast_id_fk references podcasts, -- co...
beer_factory
How many stars did Urijah Faber rate for Frostie?
stars refers to StarRating; Frostie refers to BrandName = 'Frostie';
SELECT T2.StarRating 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 = 'Urijah' AND T1.Last = 'Faber' AND T3.BrandName = 'Frostie'
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...
disney
List the voice actors from the movie "Meet the Robinsons".
Meet the Robinsons refers to movie_title = 'Meet the Robinsons';
SELECT 'voice-actor' FROM `voice-actors` WHERE movie = 'Meet the Robinsons'
CREATE TABLE movies_total_gross ( MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0 release_date TEXT, -- total_gross TEXT, -- foreign key (movie_title) references characters(movie_title), movie_title TEXT, -- genre TEX...
public_review_platform
What is the attribute value of an active business with a high review count and 3 stars which is located at Mesa, AZ?
active business refers to active = 'true'; located at Mesa, AZ refers to city = 'Mesa', state = 'AZ'
SELECT T2.attribute_value FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T1.state LIKE 'AZ' AND T1.review_count LIKE 'High' AND T1.active LIKE 'TRUE' AND T1.city LIKE 'Mesa' AND T1.stars = 3
CREATE TABLE Attributes ( attribute_name TEXT, -- attribute_id INTEGER constraint Attributes_pk primary key, ); CREATE TABLE Elite ( year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ...