db_id
stringclasses
66 values
question
stringlengths
24
325
evidence
stringlengths
1
673
gold_query
stringlengths
23
804
db_schema
stringclasses
66 values
regional_sales
What is the average median income for all City type of stores?
AVG(Median Income) where Type = 'City';
SELECT AVG(`Median Income`) FROM `Store Locations` WHERE Type = 'City'
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
food_inspection_2
Which employee was responsible for inspection no.48224? Give the full name.
inspection no.48224 refers to inspection_id = '48224'; full name refers to first_name, last_name;
SELECT T2.first_name, T2.last_name FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T1.inspection_id = 48224
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...
regional_sales
Please calculate the total number of orders by each city in 2019.
total number of orders refers to COUNT(OrderNumber); 2019 refers to OrderDate between 01-01-2019 and 31-12-2019; city refers to City Name;
SELECT COUNT(T1.OrderNumber) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T1.OrderDate LIKE '%/%/19' GROUP BY T2.`City Name` HAVING COUNT(T1.OrderNumber)
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
food_inspection_2
How many restaurants were inspected on 2015/5/8?
restaurant refers to facility_type = 'Restaurant'; on 2015/5/8 refers to inspection_date = '2015-05-08'
SELECT COUNT(T2.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.inspection_date = '2015-05-08' AND T1.facility_type = 'Restaurant'
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...
regional_sales
What is the unit cost of order SO - 000103?
OrderNumber = 'SO - 000103';
SELECT DISTINCT T FROM ( SELECT IIF(OrderNumber = 'SO - 000103', `Unit Cost`, NULL) AS T FROM `Sales Orders` ) WHERE T IS NOT NULL
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
regional_sales
What is the detailed position of the store which has order SO - 000115?
Latitude and Longitude coordinates can be used to identify the detailed position of stores; store refers to StoreID WHERE OrderNumber = 'SO - 000115';
SELECT T2.Latitude, T2.Longitude FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T1.OrderNumber = 'SO - 000115'
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
books
Provide the International Standard Book Number of the book The Mystery in the Rocky Mountains.
International Standard Book Number refers to isbn13; 'The Mystery in the Rocky Mountains' is the title of the book
SELECT isbn13 FROM book WHERE title = 'The Mystery in the Rocky Mountains'
CREATE TABLE order_line ( book_id INTEGER references book, -- price REAL, -- line_id INTEGER primary key autoincrement, order_id INTEGER references cust_order, -- ); CREATE TABLE customer ( customer_id INTEGER primary key, first_name TEXT, -- last_name TEXT, -- email TEXT, -- ); CREATE TABLE book_...
app_store
Which education App has the worst rating and state the translated review if available.
education App refers to Category = 'EDUCATION'; worst rated app refers to Rating = 1;
SELECT T1.App, T2.Translated_Review FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Category = 'EDUCATION' GROUP BY T1.App, T2.Translated_Review ORDER BY T1.Rating ASC LIMIT 1
CREATE TABLE playstore ( Rating REAL, -- Size TEXT, -- App TEXT, -- Category TEXT, -- Price TEXT, -- "Content Rating" TEXT, -- Example Values: `Everyone`, `Teen`, `Everyone 10+`, `Mature 17+`, `Adults only 18+` | Value Statics: Total count 10840 - Distinct count 6 - Null count 0 Installs TEXT, -- ...
food_inspection_2
State the number of violations did Royal Thai Cuisine has during the 2015/5/8 inspection.
Royal Thai Cuisine refers to dba_name = 'ROYAL THAI CUISINE'; 2015/5/8 refers to inspection_date = '2015-05-08'
SELECT COUNT(T3.point_id) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id WHERE T2.inspection_date = '2015-05-08' AND T1.dba_name = 'ROYAL THAI CUISINE'
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...
regional_sales
What were the total orders of Medsep Group from 2018 to 2020?
Medsep Group is the name of the customer; total orders refer to COUNT(OrderNumber); from 2018 to 2020 refers to SUBSTR(OrderDate, -2) IN ('18', '19', '20');
SELECT SUM(CASE WHEN SUBSTR(T1.OrderDate, -2) IN ('18', '19', '20') AND T2.`Customer Names` = 'Medsep Group' THEN 1 ELSE 0 END) FROM `Sales Orders` AS T1 INNER JOIN Customers AS T2 ON T2.CustomerID = T1._CustomerID
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
food_inspection_2
When did Wing Hung Chop Suey Restaurant have its first inspection?
Wing Hung Chop Suey Restaurant refers to aka_name = 'WING HUNG CHOP SUEY RESTAURANT'; first inspection refers to min(inspection_date)
SELECT MIN(T2.inspection_date) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.aka_name = 'WING HUNG CHOP SUEY RESTAURANT'
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...
food_inspection_2
How many "food maintenance" related violations did inspection no.1454071 have?
"food maintenance" related refers to category = 'Food Maintenance'; inspection no.1454071 refers to inspection_id = '1454071'
SELECT COUNT(T2.point_id) FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T2.inspection_id = '1454071' AND T1.category = 'Food Maintenance'
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...
food_inspection_2
Who is responsible for most of the inspections? Give the full name.
full name refers to first_name, last_name; most of the inspections refers to max(count(employee_id))
SELECT T.first_name, T.last_name FROM ( SELECT T2.employee_id, T2.first_name, T2.last_name, COUNT(T1.inspection_id) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id GROUP BY T2.employee_id, T2.first_name, T2.last_name ORDER BY COUNT(T1.inspection_id) DESC LIMIT 1 ) AS T
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...
app_store
What is the average rating of Apps falling under the racing genre and what is the percentage ratio of positive sentiment reviews?
average rating = AVG(Rating); percentage = MULTIPLY(DIVIDE((SUM(Sentiment = 'Positive')), (COUNT(*)), 100));
SELECT AVG(T1.Rating), CAST(COUNT(CASE WHEN T2.Sentiment = 'Positive' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.Sentiment) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Genres = 'Racing'
CREATE TABLE playstore ( Rating REAL, -- Size TEXT, -- App TEXT, -- Category TEXT, -- Price TEXT, -- "Content Rating" TEXT, -- Example Values: `Everyone`, `Teen`, `Everyone 10+`, `Mature 17+`, `Adults only 18+` | Value Statics: Total count 10840 - Distinct count 6 - Null count 0 Installs TEXT, -- ...
books
List all books published by ADV Manga.
"ADV Manga" is the publisher_name; books refers to title
SELECT T1.title FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'ADV Manga'
CREATE TABLE order_line ( book_id INTEGER references book, -- price REAL, -- line_id INTEGER primary key autoincrement, order_id INTEGER references cust_order, -- ); CREATE TABLE customer ( customer_id INTEGER primary key, first_name TEXT, -- last_name TEXT, -- email TEXT, -- ); CREATE TABLE book_...
regional_sales
What is the percentage of total orders of Stephen Payne that had a net profit of over 1000?
Sales Team = 'Stephen Payne'; net profit can be computed as SUBTRACT(Unit Price, Unit Cost); DIVIDE(COUNT(OrderNumber where Sales Team = 'Stephen Payne' and Net Profit > 1000)), (COUNT(OrderNumber where Sales Team = 'Stephen Payne')) as percentage;
SELECT CAST(SUM(CASE WHEN REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') > 1000 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.OrderNumber) FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T2.`Sales Team` = 'Stephen Payne'
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
regional_sales
Please list the names of customers who have total orders of over 3 in 2018.
total orders of over 3 in 2018 refer to COUNT(OrderNumber) > 3 where SUBSTR(OrderDate, -2) = '18';
SELECT DISTINCT IIF(COUNT(T2.CustomerID) > 3, T2.`Customer Names`, NULL) FROM `Sales Orders` AS T1 INNER JOIN Customers AS T2 ON T2.CustomerID = T1._CustomerID WHERE T1.OrderDate LIKE '%/%/18' GROUP BY T1._CustomerID HAVING COUNT(T2.CustomerID)
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
food_inspection_2
For the sanitarian who lives on 5000 N Wolcott Ave, how many establishments did he/she inspect in the May of 2011?
sanitarian refers to title = 'Sanitarian'; 5000 N Wolcott Ave refers to address = '5000 N Wolcott Ave'; in May 2011 refers to inspection_date between '2011-04-30' and '2011-06-01'
SELECT COUNT(T1.inspection_id) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T2.address = '5000 N Wolcott Ave' AND T2.title = 'Sanitarian' AND strftime('%Y-%m', T1.inspection_date) = '2011-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...
regional_sales
State the name of all city in Maricopa County along with its latitude and longitude.
null
SELECT DISTINCT `City Name`, Latitude, Longitude FROM `Store Locations` WHERE County = 'Maricopa County'
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
movie_platform
What is the list ID that was first created by user 85981819?
first created list refers to oldest list_creation_date_utc;
SELECT list_id FROM lists_users WHERE user_id = 85981819 ORDER BY list_creation_date_utc ASC 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
For the grocery store located at "3635 W DIVERSEY AVE", how many inspections did it have?
grocery store refers to facility_type = 'Grocery Store'; "3635 W DIVERSEY AVE" refers to address = '3635 W DIVERSEY AVE'
SELECT COUNT(T2.inspection_id) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.address = '3635 W DIVERSEY AVE ' AND T1.facility_type = 'Grocery Store'
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...
food_inspection_2
How many inspections done by Lisa Tillman ended up with the result of "Out of Business"?
the result of "Out of Business" refers to results = 'Out of Business'
SELECT COUNT(T1.inspection_id) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T2.first_name = 'Lisa' AND T2.last_name = 'Tillman' AND T1.results = 'Out of Business'
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...
regional_sales
Please list the customer names whose order quantity was more than 5 on 6/1/2018.
order quantity was more than 5 on 6/1/2018 refers to Order Quantity > 5 where OrderDate = 6/1/2018;
SELECT T FROM ( SELECT DISTINCT CASE WHEN SUM(T1.`Order Quantity`) > 5 THEN T2.`Customer Names` END AS T FROM `Sales Orders` T1 INNER JOIN Customers T2 ON T2.CustomerID = T1._CustomerID WHERE T1.OrderDate = '6/1/18' GROUP BY T1._CustomerID ) WHERE T IS NOT NULL
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
movie_platform
What are the URL to the list page on Mubi of the lists with followers between 1-2 and whose last update timestamp was on 2012?
URL to the list page on Mubi refers to list_url; list_followers = 1 OR list_followers = 2; last update timestamp was on 2012 refers to list_update_timestamp_utc BETWEEN '2012-1-1' AND '2012-12-31';
SELECT list_url FROM lists WHERE list_update_timestamp_utc LIKE '2012%' AND list_followers BETWEEN 1 AND 2 ORDER BY list_update_timestamp_utc 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
State the salary of the employee who did the most inspections.
the most inspections refers to max(count(employee_id))
SELECT T1.salary FROM employee AS T1 INNER JOIN ( SELECT T.employee_id, COUNT(T.inspection_id) FROM inspection AS T GROUP BY T.employee_id ORDER BY COUNT(T.inspection_id) DESC LIMIT 1 ) AS T2 ON T1.employee_id = T2.employee_id
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...
regional_sales
Calculate ratio between the highest unit cost and the lowest unit cost?
ratio can be calculated as DIVIDE(MAX(Unit_Cost)), MIN(Unit Cost);
SELECT ( SELECT REPLACE(`Unit Cost`, ',', '') FROM `Sales Orders` WHERE REPLACE(`Unit Cost`, ',', '') = ( SELECT REPLACE(`Unit Cost`, ',', '') FROM `Sales Orders` ORDER BY REPLACE(`Unit Cost`, ',', '') DESC LIMIT 1 ) ORDER BY REPLACE(`Unit Cost`, ',', '') DESC LIMIT 1 ) / ( SELECT REPLACE(`Unit Cost`, ',', '') FROM `Sa...
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
books
Which country is 9 Green Ridge Point, Arendal located at?
"9" is the street_number; 'Green Reidge Point' is the street_name; 'Arendal' is the city
SELECT T2.country_name FROM address AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE T1.street_number = 9 AND T1.street_name = 'Green Ridge Point' AND T1.city = 'Arendal'
CREATE TABLE order_line ( book_id INTEGER references book, -- price REAL, -- line_id INTEGER primary key autoincrement, order_id INTEGER references cust_order, -- ); CREATE TABLE customer ( customer_id INTEGER primary key, first_name TEXT, -- last_name TEXT, -- email TEXT, -- ); CREATE TABLE book_...
regional_sales
How many sales team were from Northeast?
Northeast is the name of the region;
SELECT SUM(CASE WHEN Region = 'Northeast' THEN 1 ELSE 0 END) FROM `Sales Team`
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
food_inspection_2
State the inspection pass rate of Pockets Restaurant.
Pockets refers to dba_name = 'POCKETS'; Restaurant refers to facility_type = 'Restaurant'; pass refers to results = 'Pass'; the inspection pass rate = divide(sum(inspection_id where results = 'Pass'), count(license_no)) where dba_name = 'POCKETS' and facility_type = 'Restaurant'
SELECT CAST(COUNT(CASE WHEN T2.results = 'Pass' THEN T2.inspection_id ELSE NULL END) AS REAL) * 100 / COUNT(T2.inspection_id) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.dba_name = 'POCKETS' AND T1.facility_type = 'Restaurant'
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...
regional_sales
List all the name of products with the ID of 30 to 40.
products with the ID of 30 to 40 refer to Product Name WHERE ProductID BETWEEN 30 AND 40;
SELECT T FROM ( SELECT CASE WHEN ProductID BETWEEN 30 AND 40 THEN `Product Name` ELSE NULL END AS T FROM Products ) WHERE T IS NOT NULL
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
food_inspection_2
Show the phone number of the sanitarian who was responsible for inspection no.634597.
phone number refers to phone; sanitarian refers to title = 'Sanitarian'; inspection no.634597 refers to inspection_id = '634597'
SELECT T2.phone FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T1.inspection_id = 634597 AND T2.title = 'Sanitarian'
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...
regional_sales
List all the customers with name containing the word 'Group'.
name containing the word 'Group' refers to Customer Names LIKE '%Group%';
SELECT T FROM ( SELECT IIF(`Customer Names` LIKE '%Group%', `Customer Names`, NULL) AS T FROM Customers ) WHERE T IS NOT NULL
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
regional_sales
How many products sold by Adam Hernandez?
products sold by Adam Hernandez refer to SUM(Order Quantity where Sales Team = 'Adam Hernandez');
SELECT SUM(CASE WHEN T2.`Sales Team` = 'Adam Hernandez' THEN 1 ELSE 0 END) FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
regional_sales
Which order have the highest unit cost?
order have the highest unit cost refers to OrderNumber where MAX(Unit Cost);
SELECT OrderNumber FROM `Sales Orders` WHERE REPLACE(`Unit Cost`, ',', '') = ( SELECT REPLACE(`Unit Cost`, ',', '') FROM `Sales Orders` ORDER BY REPLACE(`Unit Cost`, ',', '') DESC LIMIT 1 )
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
food_inspection_2
What is the assumed name of the business located at 2903 W Irving Park Rd?
assumed name refers to dba_name; 2903 W Irving Park Rd refers to address = '2903 W IRVING PARK RD '
SELECT DISTINCT dba_name FROM establishment WHERE address = '2903 W IRVING PARK RD '
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...
regional_sales
State the order number where Qualitest ordered the highest product quantity.
Qualitest ordered the highest product quantity refers to Customer Names where MAX(Order Quantity);
SELECT T1.OrderNumber FROM `Sales Orders` AS T1 INNER JOIN Customers AS T2 ON T2.CustomerID = T1._CustomerID WHERE T2.`Customer Names` = 'Qualitest ' ORDER BY T1.`Order Quantity` DESC LIMIT 1
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
food_inspection_2
What is the average number of inspections did risk level 3 taverns have?
risk level 3 refers to risk_level = '3'; tavern refers to facility_type = 'TAVERN'; average number = divide(count(inspection_id), sum(license_no)) where risk_level = '3' and facility_type = 'TAVERN'
SELECT CAST(COUNT(T2.inspection_id) AS REAL) / COUNT(DISTINCT T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.risk_level = 3 AND T1.facility_type = 'TAVERN'
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...
regional_sales
Which product was ordered the most in 2018?
product refers to Product Name; ordered the most in 2018 refers to MAX(COUNT(OrderNumber)) where SUBSTR(OrderDate, -2) = '18';
SELECT T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T1.OrderDate LIKE '%/%/18' GROUP BY T1._ProductID ORDER BY COUNT(T1._ProductID) DESC LIMIT 1
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
food_inspection_2
How many establishments that are doing business as Homemade Pizza have a risk level of 2?
Homemade Pizza refers to dba_name = 'HOMEMADE PIZZA'; a risk level of 2 refers to risk_level = 2
SELECT COUNT(license_no) FROM establishment WHERE risk_level = 2 AND dba_name = 'HOMEMADE PIZZA'
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...
food_inspection_2
How many sanitarian employees in Chicago are from the zip code 60617?
sanitarian refers to title = 'Sanitarian'; in Chicago refers to city = 'Chicago'; zip code 60617 refers to zip = 60617
SELECT COUNT(employee_id) FROM employee WHERE zip = '60617'
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...
regional_sales
How many orders made by Rochester Ltd?
Rochester Ltd is the name of the customer; orders refer to OrderNumber;
SELECT SUM(CASE WHEN T1.`Customer Names` = 'Rochester Ltd' THEN 1 ELSE 0 END) FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
food_inspection_2
How many employees are under Gregory Cardenas?
null
SELECT COUNT(T1.employee_id) FROM employee AS T1 WHERE T1.supervisor = ( SELECT employee_id FROM employee WHERE first_name = 'Gregory' AND last_name = 'Cardenas' )
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...
food_inspection_2
What is the full name of the employee with the lowest salary?
full name refers to first_name, last_name; the lowest salary refers to min(salary)
SELECT first_name, last_name FROM employee ORDER BY salary ASC LIMIT 1
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...
app_store
Among the role playing game genre, how many are targeted to teens and what is their average sentiment polarity score?
targeted to teen refers to Content Rating = 'Teen'; average = AVG(Sentiment_Polarity);
SELECT COUNT(T1.App), AVG(T2.Sentiment_Polarity) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1."Content Rating" = 'Teen' AND T1.Genres = 'Role Playing'
CREATE TABLE playstore ( Rating REAL, -- Size TEXT, -- App TEXT, -- Category TEXT, -- Price TEXT, -- "Content Rating" TEXT, -- Example Values: `Everyone`, `Teen`, `Everyone 10+`, `Mature 17+`, `Adults only 18+` | Value Statics: Total count 10840 - Distinct count 6 - Null count 0 Installs TEXT, -- ...
food_inspection_2
How many inspections with critical food safety problems are under inspection point id 3?
critical food safety problems refers to fine = 500; point_id = 3
SELECT COUNT(inspection_id) FROM violation WHERE point_id = 3 AND fine = 500
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...
regional_sales
List the order for all in-store sales along with the products sold.
orders for all in-store sales refer to OrderNumber where Sales Channel = 'In-Store'; products refer to Product Name;
SELECT DISTINCT T1.OrderNumber, T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T1.`Sales Channel` = 'In-Store'
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
food_inspection_2
When did Renaldi's Pizza had its first inspection?
Renaldi's Pizza refers to dba_name = 'RENALDI''S PIZZA'; first inspection refers to min(inspection_date)
SELECT MIN(T2.inspection_date) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.dba_name = 'RENALDI''S PIZZA'
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...
books
Among all orders updated in 2022, identify the percentage that has been returned.
order updated in 2022 refers to SUBSTR(status_date, 1, 4) = '2022'; has been returned refers to status_value = 'Returned'; percentage = Divide (Count(status_value = 'Returned'), Count(status_value)) * 100
SELECT CAST(SUM(CASE WHEN T1.status_value = 'Returned' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE STRFTIME('%Y', T2.status_date) = '2022'
CREATE TABLE order_line ( book_id INTEGER references book, -- price REAL, -- line_id INTEGER primary key autoincrement, order_id INTEGER references cust_order, -- ); CREATE TABLE customer ( customer_id INTEGER primary key, first_name TEXT, -- last_name TEXT, -- email TEXT, -- ); CREATE TABLE book_...
regional_sales
List all orders where its products were shipped from Daly City.
shipped from Daly City refers to Store Locations where City Name = 'Daly City'; orders refer to OrderNumber;
SELECT T FROM ( SELECT DISTINCT CASE WHEN T2.`City Name` = 'Daly City' THEN T1.OrderNumber END AS T FROM `Sales Orders` T1 INNER JOIN `Store Locations` T2 ON T2.StoreID = T1._StoreID ) WHERE T IS NOT NULL
CREATE TABLE Regions ( State TEXT, -- Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0 StateCode TEXT constraint Regions_pk primary key, ); CREATE TABLE Sales Orders ( OrderNumber TEXT constraint "Sales Orders_pk" primary...
music_tracker
What are the top 5 tags with the highest amount of downloads?
the highest amount of downloads refers to MAX(totalSnatched);
SELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'album' ORDER BY T1.totalSnatched DESC LIMIT 5
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
How many times was the album released by blowfly in 1980 downloaded?
blowfly is an artist; groupYear = 1980; album refers to releaseType; downloaded refers to totalSnatched;
SELECT totalSnatched FROM torrents WHERE artist LIKE 'blowfly' AND groupYear = 1980
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
What are the tags of the top 5 least downloaded live albums?
least downloaded album refers to MIN(totalSnatched where releaseType = 'album');
SELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'album' ORDER BY T1.totalSnatched LIMIT 5
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
What is the tag of the album with the highest amount of downloads?
album refers to releaseType; the highest amount of downloads refers to MAX(totalSnatched);
SELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'album' ORDER BY T1.totalSnatched DESC LIMIT 1
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
Name all the release titles of the "ep's" under the alternative tag.
release titles of the "ep's" refer to groupName where releaseType = 'ep';
SELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag LIKE 'alternative' AND T1.releaseType = 'ep'
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
What is the release title of the single that was released by Ron Hunt in 1979 that was downloaded 239 times?
release title refers to groupName; Ron Hunt is an artist; groupYear = 1979; releaseType = 'single'; downloaded 239 times refer to totalSnatched = 239;
SELECT groupName FROM torrents WHERE artist LIKE 'ron hunt & ronnie g & the sm crew' AND groupYear = 1979 AND releaseType LIKE 'single' AND totalSnatched = 239
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
How many releases are tagged "1980s"?
tag = '1980s';
SELECT COUNT(id) FROM tags WHERE tag LIKE '1980s'
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
What is the release title of the single under the "funk" tag that was released the oldest?
release title of single refers to groupName where releaseType = 'single'; the oldest means coming before all others in time and refers to MIN(groupYear);
SELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag LIKE 'funk' AND T1.releaseType = 'single' ORDER BY T1.groupYear LIMIT 1
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
What are the tags of the release "sugarhill gang"?
release "sugarhill gang" refers to groupName = 'sugarhill gang';
SELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupName = 'sugarhill gang'
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
What is the tag and the artist of the most downloaded single?
the most downloaded single refers to MAX(totalSnatched where releaseType = 'single');
SELECT T2.tag, T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'single' ORDER BY T1.totalSnatched DESC LIMIT 1
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
Please list the releases that have been downloaded for more than 20000 times.
releases refer to groupName; downloaded for more than 20000 times refers to totalSnatched > 20000;
SELECT groupName FROM torrents WHERE totalSnatched > 20000
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
soccer_2016
What are the names of players who had been man of the match more than 5 times in season year 2008?
man of the match more than 5 times refers to COUNT(Man_of_the_Match) > 5; in season year 2008 refers to Season_Year = 2008; name of player refers to Player_Name;
SELECT CASE WHEN COUNT(T2.Man_of_the_Match) > 5 THEN T1.Player_Name ELSE 0 END FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match INNER JOIN Player_Match AS T3 ON T3.Player_Id = T1.Player_Id INNER JOIN Season AS T4 ON T2.Season_Id = T4.Season_Id WHERE T4.Season_Year = 2008
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
music_tracker
Please list the titles of all the releases with the tag "1980s".
titles refer to groupName;
SELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = '1980s'
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
How many times has the release "city funk" been downloaded?
groupName = 'city funk'; downloaded refers to totalSnatched;
SELECT totalSnatched FROM torrents WHERE groupName LIKE 'city funk'
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
Among the releases that were released in 2000, how many of them were released as an album and tagged "pop"?
groupYear = 2000; album refers to releaseType;
SELECT COUNT(T1.groupName) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'pop' AND T1.releaseType = 'album' AND T1.groupYear = 2000
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
How many tags does the release "city funk" have?
release "city funk" refers to groupName = 'city funk';
SELECT COUNT(T2.tag) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupName = 'city funk'
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
How many releases by the artist michael jackson are tagged "pop"?
tag = 'pop';
SELECT COUNT(T1.groupName) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'pop' AND T1.artist = 'michael jackson'
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
Provide the name of the artist who released his or her Single-Table in 2012 with the highest number of downloads. Name the Single-Table title as well.
title refers to groupName; the highest number of downloads refers to MAX(totalSnatched where groupYear = 2012 and releaseType = 'single');
SELECT artist, groupName FROM torrents WHERE groupYear = 2012 AND releaseType LIKE 'Single' ORDER BY totalSnatched DESC LIMIT 1
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
Among the releases with the tag "1980s", which one of them is the most downloaded? Please give its title.
title refers to groupName; the most downloaded refers to MAX(totalSnatched);
SELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = '1980s' ORDER BY T1.totalSnatched DESC LIMIT 1
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
Name the title of the top three releases with the highest number of downloads.
title refers to groupName; the highest number of downloads refers to MAX(totalSnatched);
SELECT groupName FROM torrents ORDER BY totalSnatched DESC LIMIT 3
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
soccer_2016
Give the match's venue and winning team for the match ID 392194.
venue refers to Venue_Name; winning team refers to match_winner
SELECT T1.Venue_Name, T3.Team_Name FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.venue_id = T2.venue_id INNER JOIN Team AS T3 ON T2.match_winner = T3.Team_Id WHERE T2.Match_Id = 392194
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
music_tracker
An American rapper '2Pac' released his first solo album in 1991, how many years have passed until his next album was released?
2Pac is an artist; album refers to releaseType; groupYear = 1991; SUBTRACT(groupYear = 1991, groupYear where releaseType = 'album' LIMIT 1 OFFSET 1);
SELECT ( SELECT groupYear FROM torrents WHERE artist LIKE '2Pac' AND releaseType LIKE 'album' ORDER BY groupYear LIMIT 1, 1 ) - groupYear FROM torrents WHERE artist LIKE '2Pac' AND releaseType LIKE 'album' AND groupYear = 1991
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
What are the average download times for the a release tagged "1980s"?
AVG(totalSnatched where tag = '1980s');
SELECT CAST(SUM(T1.totalSnatched) AS REAL) / COUNT(T2.tag) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = '1980s'
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
Provide the name of artists who released at least two bootlegs in 2016.
at least two bootlegs refer to COUNT(releaseType = 'bootleg')≥ 2; groupYear = 2016;
SELECT artist FROM torrents WHERE groupYear = 2016 AND releaseType LIKE 'bootleg' GROUP BY artist HAVING COUNT(releaseType) > 2
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
How many albums and Single-Tables were released by the artist named '50 cent' between 2010 and 2015?
albums refer to releaseType = 'album'; releaseType = 'single'; between 2010 and 2015 refers to groupYear between 2010 and 2015;
SELECT COUNT(id), ( SELECT COUNT(id) FROM torrents WHERE groupYear BETWEEN 2010 AND 2015 AND artist LIKE '50 cent' AND releaseType LIKE 'album' ) FROM torrents WHERE groupYear BETWEEN 2010 AND 2015 AND artist LIKE '50 cent' AND releaseType LIKE 'Single'
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
Provide the title, release year and the tag associated with the live album that has the highest number of downloads?
release year refers to groupYear; title of live album refers to groupName where releaseType = 'live album'; the highest number of downloads refers to MAX(totalSnatched);
SELECT T1.groupName, T1.groupYear, T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'live album' ORDER BY T1.totalSnatched DESC LIMIT 1
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
soccer_2016
Among the matches held in St. George's Park, give the match ID of the match with the highest winning margin points.
held in St. George's Park refers to Venue_Name = 'St George''s Park'; highest winning margin points refers to MAX(Win_Margin)
SELECT T2.Match_Id FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.venue_id = T2.venue_id WHERE T1.Venue_Name = 'St George''s Park' ORDER BY T2.Win_Margin DESC LIMIT 1
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
music_tracker
Indicates groups with id from 10 to 20 with singles downloaded at least 20.
releaseType = 'single'; downloaded at least 20 refers to totalSnatched ≥ 20; id from 10 to 20 refer to id between 10 and 20; groups refer to groupName;
SELECT groupName FROM torrents WHERE totalSnatched >= 20 AND releaseType LIKE 'single' AND id BETWEEN 10 AND 20
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
Find the average number of downloads for Single-Tables released by '2Pac' between 2001 and 2013.
2Pac is an artist; releaseType = 'single'; between 2001 and 2013 refers to groupYear between 2001 and 2013; average number of downloads = AVG(totalSnatched);
SELECT AVG(totalSnatched) FROM torrents WHERE artist LIKE '2Pac' AND releaseType LIKE 'Single' AND groupYear BETWEEN 2001 AND 2013
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
Which artist has released the most singles with the tag "soul"?
the most singles refer to MAX(COUNT(releaseType = 'single'));
SELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'soul' AND T1.releaseType = 'single' GROUP BY T1.artist ORDER BY COUNT(T1.releaseType) DESC LIMIT 1
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
Which artist released singles between 1980 to 1982?
releaseType = 'single'; between 1980 to 1982 refers to groupYear between 1980 and 1982;
SELECT artist FROM torrents WHERE groupYear BETWEEN 1980 AND 1982 AND releaseType LIKE 'single'
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
Provide the name of artists who had no more than 100 downloads and are tagged "funk" in 1980.
no more than 100 downloads refer to totalSnatched ≤ 100; groupYear = 1980; tag = 'funk';
SELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'funk' AND T1.groupYear = 1980 AND T1.totalSnatched <= 100
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
soccer_2016
Among the matches of Delhi Daredevils in 2009, what is the percentage of their matches won by wickets?
Delhi Daredevils refers to team_name = 'Delhi Daredevils'; in 2009 refers to Match_Date = '2009%'; won by wickets refers to Win_Type = 'wickets'; percentage refers to DIVIDE(COUNT(Win_Type = 'wickets'), COUNT(Win_Type))
SELECT CAST(SUM(CASE WHEN T3.Win_Type = 'wickets' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.Win_Type) FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Match_Winner INNER JOIN Win_By AS T3 ON T2.Win_Type = T3.Win_Id WHERE T1.Team_Name = 'Delhi Daredevils'
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
music_tracker
List the group name has the most downloaded that have released jazz genres from 1982 or later.
the most downloaded refers to MAX(totalSnatched); tag = 'jazz'; from 1982 or later refers to groupYear ≥ 1982;
SELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'jazz' AND T1.groupYear >= 1982 ORDER BY T1.totalSnatched DESC LIMIT 1
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
Among the artists from 1980 to 1982. Which artist was tagged as "disco"?
from 1980 to 1982 refers to groupYear between 1980 and 1982; tag = 'disco';
SELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'disco' AND T1.groupYear BETWEEN 1980 AND 1982
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
List the name of artists who have released albums and mixtape from 1980 to 1985 in "dance" genre.
albums and mixtape refer to releaseType; from 1980 to 1985 refers to groupYear between 1980 and 1985; tag = 'dance';
SELECT COUNT(T1.artist) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'dance' AND T1.groupYear BETWEEN 1980 AND 1985 AND T1.releaseType LIKE 'album' OR T1.releaseType LIKE 'mixtape'
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
Among the artists with the id from 10 to 30. Which artist released the product with the tag "funk" in 1980?
id from 10 to 30 refers to id between 10 and 30; groupYear = 1980;
SELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'funk' AND T1.groupYear = 1980 AND T1.id BETWEEN 10 AND 30
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
Among id from 10 to 50. Which artist tagged as "new.york" has the most downloads?
Among id from 10 to 50 refers to id between 10 and 50; tag = 'new.york'; the most downloads refer to MAX(totalSnatched);
SELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.id BETWEEN 10 AND 50 AND T2.tag LIKE 'new.york' ORDER BY T1.totalSnatched DESC LIMIT 1
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
How many singles were released in 1979?
releaseType = 'single'; groupYear = 1979;
SELECT COUNT(releaseType) FROM torrents WHERE releaseType LIKE 'single' AND groupYear = 1979
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
Which artist has id "16"? Provide her or his tag genre.
FALSE;
SELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.id = 16
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
How many christmas albums were released in 2004?
album refers to releaseType; groupYear = 2004; tag = 'christmas';
SELECT COUNT(T1.id) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'christmas' AND T1.groupYear = 2004 AND T1.releaseType LIKE 'album'
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
How many singles were released between 1979 and 1981 labeled as "soul"?
releaseType = 'single'; between 1979 and 1981 refers to groupYear between 1979 and 1981; tag = 'soul';
SELECT COUNT(T2.tag) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'soul' AND T1.groupYear BETWEEN 1979 AND 1981 AND T1.releaseType LIKE 'single'
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
In 1980, how many singles were released by sugar daddy?
sugar daddy is an artist; releaseType = 'single'; groupYear = 1980;
SELECT COUNT(releaseType) FROM torrents WHERE artist LIKE 'sugar daddy' AND releaseType LIKE 'Single' AND groupYear = 1980
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
Which album title and tag that millie jackson released in 1980?
millie jackson is an artist; album title refers to groupName where releaseType = 'album'; groupYear = 1980;
SELECT T1.groupName, T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupYear = 1980 AND T1.artist LIKE 'millie jackson' AND T1.releaseType LIKE 'album'
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
soccer_2016
What is the total number of players born between 1970 to 1975?
born between 1970 to 1975 refers to strftime('%Y',DOB) between '1970' and '1975'
SELECT COUNT(Player_Id) FROM Player WHERE strftime('%Y', DOB) BETWEEN '1970' AND '1975'
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
music_tracker
From 1980 to 2000, which artist had the most disco releases?
From 1980 to 2000 refers to groupYear between 1980 and 2000; tag = 'disco'; the most releases refer to MAX(COUNT(id));
SELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupYear BETWEEN 1980 AND 2000 AND T2.tag LIKE 'disco' GROUP BY T1.artist ORDER BY COUNT(T2.tag) DESC LIMIT 1
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
Please list all tags of kurtis blow from 2000 to 2010.
kurtis blow is an artist; from 2000 to 2010 refers to groupYear between 2000 and 2010;
SELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupYear BETWEEN 2000 AND 2010 AND T1.artist LIKE 'kurtis blow'
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
Please list all release titles whose tag is jazz in 2005.
release titles refer to groupName; groupYear = 2005;
SELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupYear = 2005 AND T2.tag LIKE 'jazz'
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
music_tracker
From 1979 to 1982, what was the percentage of united.states albums out of total albums were released?
From 1979 to 1982 refers to groupYear between 1979 and 1982; United States refer to tag; albums refer to releaseType; DIVIDE(COUNT(releaseType = 'album' where tag = 'united.states' and groupYear between 1979 and 1982), COUNT(releaseType = 'album' where groupYear between 1979 and 1982)) as percentage;
SELECT CAST(SUM(CASE WHEN T2.tag LIKE 'united.states' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.releaseType) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupYear BETWEEN 1979 AND 1982 AND T1.releaseType LIKE 'album'
CREATE TABLE torrents ( groupName TEXT, -- totalSnatched INTEGER, -- id INTEGER constraint torrents_pk primary key, artist TEXT, -- releaseType TEXT, -- Example Values: `single`, `album`, `live album`, `ep`, `unknown` | Value Statics: Total count 75719 - Distinct count 15 - Null count 0 groupYear INTEGER...
soccer_2016
What is the average of Indian players that were born between 1975 and 1985 among all players?
Indian players refers to Country_Name = 'India'; born between 1975 and 1985 refers to strftime('%Y',T1.DOB) between '1975' and '1985'; average refers to DIVIDE(COUNT(Country_Name = 'India'), COUNT(Player_Id))
SELECT CAST(SUM(CASE WHEN T2.Country_Name = 'India' THEN 1 ELSE 0 END) AS REAL) / COUNT(T1.Player_Id) FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_ID WHERE strftime('%Y', T1.DOB) BETWEEN '1975' AND '1985'
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
world_development_indicators
What's the description of the series code SM.POP.TOTL for Aruba?
Aruba is the name of the country where ShortName = 'Aruba'
SELECT T2.Description FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.ShortName = 'Aruba' AND T2.Seriescode = 'SM.POP.TOTL'
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, --...