context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
What is the total number of establishments with the highest risk level?
SELECT COUNT(license_no) FROM establishment WHERE risk_level = 3
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
Who is the employee that receives 82700 as their salary?
SELECT first_name, last_name FROM employee WHERE salary = 82700
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
Provide the last name of the employee involved in the inspection ID 52256.
SELECT DISTINCT T1.last_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_id = 52256
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
Please list the names of taverns that paid a $100 fine upon inspection.
SELECT DISTINCT T1.dba_name 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 T1.facility_type = 'Tavern' AND T3.fine = 100
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
List point level of inspections with no fine.
SELECT DISTINCT T1.point_level FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T2.fine = 0
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
Provide the facility type and license number of establishments with the lowest risk level but failed the inspection.
SELECT DISTINCT T1.facility_type, T1.license_no FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.risk_level = 1 AND T2.results = 'Fail'
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
What is the result of the February 24, 2010 inspection involving the employee named "Arnold Holder"?
SELECT DISTINCT T2.results FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_date = '2010-02-24' AND T1.first_name = 'Arnold' AND T1.last_name = 'Holder'
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
How many restaurants failed the inspection in April 2010?
SELECT COUNT(DISTINCT T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y-%m', T2.inspection_date) = '2010-04' AND T1.facility_type = 'Restaurant' AND T2.results = 'Fail'
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
List all inspection IDs where the employee named "Rosemary Kennedy" was involved.
SELECT DISTINCT T2.inspection_id FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T1.first_name = 'Rosemary' AND T1.last_name = 'Kennedy'
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
What type of inspection was done on July 07, 2010, involving the employee named "Lisa Tillman"?
SELECT DISTINCT T2.inspection_type FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T1.first_name = 'Lisa' AND T1.last_name = 'Tillman' AND T2.inspection_date = '2010-07-07'
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
Provide the inspection ID of the inspection with the comment "MUST CLEAN AND BETTER ORGANIZE HALLWAY AREA" and sanitary operating requirement code of 7-38-030, 015, 010 (A), 005 (A).
SELECT T2.inspection_id FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T2.inspector_comment = 'MUST CLEAN AND BETTER ORGANIZE HALLWAY AREA' AND T1.code = '7-38-030, 015, 010 (A), 005 (A)'
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
List down the names of the establishments with the highest risk level and failed the inspection.
SELECT DISTINCT T1.dba_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.risk_level = 3 AND T2.results = 'Fail'
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
What is the inspection ID where the employee named "David Hodges" is currently employed in the "Kamayan Express" establishment?
SELECT T2.inspection_id FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN employee AS T3 ON T2.employee_id = T3.employee_id WHERE T3.first_name = 'David' AND T3.last_name = 'Hodges' AND T1.dba_name = 'KAMAYAN EXPRESS'
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
Provide the salary range of the employee involved in the inspection ID 58424.
SELECT T1.salary, T3.salary FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN employee AS T3 WHERE T2.inspection_id = 58424 ORDER BY T1.salary, T3.salary DESC LIMIT 1
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
List down the inspection ID with the inspector's comment "A certified food service manager must be present in all establishments at which potentially hazardous food is prepared or served. NO CERTIFIED FOOD MANAGER ON DUTY AT THIS TIME FOODS ARE COOKED AND SERVED SERIOUS CITATION ISSUED" and inspection category of Personnel.
SELECT T2.inspection_id FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T1.category = 'Personnel' AND T2.inspector_comment = 'A certified food service manager must be present in all establishments at which potentially hazardous food is prepared or served.FOUND NO CITY OF CHICAGO SANITATION CERTIFICATE POSTED OR VALID DOCUMENTATION DURING THIS INSPECTION.'
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
How many grocery stores paid $250 fine upon their inspection?
SELECT COUNT(DISTINCT T1.license_no) 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 T1.facility_type = 'Grocery Store' AND T3.fine = 250
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
What is the category of the inspection of the establishment named "J & J FOOD"?
SELECT DISTINCT T4.category 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 INNER JOIN inspection_point AS T4 ON T3.point_id = T4.point_id WHERE T1.dba_name = 'J & J FOOD'
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
Name the taverns that failed the inspection in January 2010.
SELECT DISTINCT T1.dba_name 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 strftime('%Y-%m', T2.inspection_date) = '2010-01' AND T2.results = 'Fail' AND T1.facility_type = 'TAVERN'
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
How many of the inspections with serious point levels have no fines?
SELECT COUNT(DISTINCT T2.inspection_id) FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T1.point_level = 'Serious ' AND T2.fine = 0
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
What is the establishment's name with an inspection category of No Smoking Regulations?
SELECT DISTINCT T1.dba_name 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 INNER JOIN inspection_point AS T4 ON T3.point_id = T4.point_id WHERE T4.category = 'No Smoking Regulations'
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
What is the difference in the number of restaurants that passed and failed the canvass inspection type?
SELECT COUNT(CASE WHEN T2.results = 'Pass' THEN T1.license_no END) - COUNT(CASE WHEN T2.results = 'Fail' THEN T1.license_no END) AS diff FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.inspection_type = 'Canvass' AND T1.facility_type = 'Restaurant'
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
Among the establishments that failed the inspection in February 2010, list the names of the employees with a salary greater than 70% of the average salary of all employees.
SELECT DISTINCT T1.employee_id FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.results = 'Fail' AND strftime('%Y-%m', T2.inspection_date) = '2010-02' AND T1.salary > 0.7 * ( SELECT AVG(salary) FROM employee )
bird
CREATE TABLE food_inspection_2 (employee_id integer, first_name text, last_name text, address text, city text, state text, zip integer, phone text, title text, salary integer, supervisor integer, license_no integer, dba_name text, aka_name text, facility_type text, risk_level integer, address text, city text, state text, zip integer, latitude real, longitude real, ward integer, inspection_id integer, inspection_date date, inspection_type text, results text, employee_id integer, license_no integer, followup_to integer, point_id integer, Description text, category text, code text, fine integer, point_level text, inspection_id integer, point_id integer, fine integer, inspector_comment text)
Among the establishments that paid a 500 fine, what is the percentage of restaurants?
SELECT CAST(COUNT(CASE WHEN T1.facility_type = 'Restaurant' THEN T1.license_no END) AS REAL) * 100 / COUNT(T1.facility_type) 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 T3.fine = 500
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
Name the coin that has the highest market capitalization for all transactions in 2018.
SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date LIKE '2018%' AND T2.market_cap = ( SELECT MAX(market_cap) FROM historical WHERE STRFTIME('%Y', date) = '2018' )
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
What is the total value of Argentum coined traded in the past 24 hours on 2016/10/11.
SELECT T2.volume_24h FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Argentum' AND T2.date = '2016-10-11'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
List the price for Zetacoin on 13/11/1 and the next 7 consecutive days. What is the average price for these 7 days?
SELECT T2.price FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Zetacoin' AND T2.date BETWEEN '2013-11-01' AND '2013-11-07' UNION ALL SELECT AVG(T2.PRICE) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Zetacoin' AND T2.date BETWEEN '2013-11-01' AND '2013-11-07'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
For all transactions for WRAP in August 2016, list the time to achieve highest price and the time to achieve the lowest price.
SELECT T2.time_high, T2.time_low, T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'WARP' AND STRFTIME('%Y-%m', T2.date) = '2016-08'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
State the transaction date whereby DigixDAO was transacted at the hightest price.
SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'DigixDAO' ORDER BY T2.price DESC LIMIT 1
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
Name the coin with the highest percentage price changed in 24 hours. State the transaction date and price.
SELECT T1.name, T2.DATE, T2.price FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.percent_change_24h = ( SELECT MAX(percent_change_24h) FROM historical )
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
What is the average monthly circulating supply for Frozen in 2014.
SELECT CAST(SUM(T2.circulating_supply) AS REAL) / 12 FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Frozen' AND STRFTIME('%Y', T2.date) = '2014'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
List all the inactive coins and state the last date of its transaction?
SELECT T1.NAME, MAX(T2.DATE) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.ID = T2.coin_id WHERE T1.status = 'inactive' ORDER BY T2.DATE DESC LIMIT 1
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
What was the price of 1 Bitcoin in 2016?
SELECT AVG(T2.price) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Bitcoin' AND STRFTIME('%Y', T2.date) = '2016'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
State the transaction date and the price when Bitcoin was bottomed?
SELECT T2.date, T2.price FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Bitcoin' ORDER BY T2.price LIMIT 1
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
For all coins with average price more than $1000. State the current status of the coin.
SELECT T1.status FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id GROUP BY T1.name HAVING AVG(T2.price) > 1000
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
Name the coin and date of transactions with the greatest decline in percent change in 1 hour.
SELECT T1.name, T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.percent_change_1h = ( SELECT MIN(percent_change_1h) FROM historical )
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
Name the coin under the token category that gives the highest max profit.
SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.category = 'token' ORDER BY T2.high - T2.low DESC LIMIT 1
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
Name the coin that have higher than average percentage price changed from the previous 24 hours for transaction on 2013/6/22.
SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2020-06-22' GROUP BY T1.name HAVING AVG(T2.percent_change_24h) > T2.PRICE
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
Which crytocurrency was ranked the first by CoinMarketCap on 2013/4/28?
SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T2.cmc_rank = 1
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
How much dollars was a Bitcoin worth on 2013/4/28 according to the coin market?
SELECT T2.market_cap FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name = 'Bitcoin'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
Which crytocurrency was not opened on 2013/5/3?
SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-05-03' AND T2.open IS NULL
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
What was the price of Bitcoin when it closed at the end of the day on 2013/4/29?
SELECT T2.close FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-29' AND T1.name = 'Bitcoin'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
When did Bitcoin reach its highest price on 2013/4/29?
SELECT T2.time_high FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-29' AND T1.name = 'Bitcoin'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
What was the max profit a user can make on Bitcoin on 2013/4/28?
SELECT T2.high - T2.low FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name = 'Bitcoin'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
What was the number of Bitcoins verifiably burned until 2013/4/28?
SELECT T2.max_supply - T2.total_supply FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name = 'Bitcoin'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
Which crytocurrency was traded in the highest value on 2016/1/8?
SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2016-01-08' AND T2.volume_24h = ( SELECT MAX(volume_24h) FROM historical WHERE date = '2016-01-08' )
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
Please list the names of the crytocurrencies that have a total amount of existence of over 10000000 on 2013/4/28.
SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T2.total_supply > 10000000
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
Had Bitcoin's price increased or decreased on 2013/5/5 compared with the price 7 days before?
SELECT (CASE WHEN T2.percent_change_7d > 0 THEN 'INCREASED' ELSE 'DECREASED' END) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-05-05' AND T1.name = 'Bitcoin'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
Which crytocurrency had a bigger number of coins circulating in the market and in the general public's hands on 2013/4/28, Bitcoin or Litecoin?
SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name IN ('Bitcoin', 'Litecoin') ORDER BY T2.circulating_supply DESC LIMIT 1
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
How much was a Bitcoin on 2013/4/28?
SELECT T2.price FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name = 'Bitcoin'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
What was the average price of a Bitcoin in the year 2013?
SELECT AVG(T2.price) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE STRFTIME('%Y', T2.date) = '2013' AND T1.name = 'Bitcoin'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
What was the percentage of the Bitcoins verifiably burned until 2018/4/28?
SELECT CAST((SUM(T2.max_supply) - SUM(T2.total_supply)) AS REAL) / SUM(T2.total_supply) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date < '2018-04-28' AND T1.name = 'Bitcoin'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
Please list the names of coins that has been disappeared.
SELECT name FROM coins WHERE status = 'extinct'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
What's the descripition of BitBar?
SELECT description FROM coins WHERE name = 'BitBar'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
How many coins were added in May 2013? Please list the names of coins.
SELECT COUNT(id) num FROM coins WHERE STRFTIME('%Y-%m', date_added) = '2013-05' UNION ALL SELECT name FROM coins WHERE STRFTIME('%Y-%m', date_added) = '2013-05'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
List the names and symbols of the coins that were added on June 14, 2013.
SELECT name, symbol FROM coins WHERE date_added LIKE '2013-06-14%'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
List the names of coins that cannot be traded in 2014.
SELECT name FROM coins WHERE date_added LIKE '2014%' AND status = 'untracked'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
Name the coins that have three tags.
SELECT name FROM coins WHERE LENGTH(tag_names) - LENGTH(replace(tag_names, ',', '')) = 2
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
What is the name of the coin with the highest price?
SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.price = ( SELECT MAX(price) FROM historical )
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
Please name the coin that ranked first among the coins traded on April 29, 2013.
SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-29' AND T2.cmc_rank = 1
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
When is the best time to purchase Bitcoin?
SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Bitcoin' ORDER BY T2.low LIMIT 1
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
What is the name of the coin that creates the most total value in the past 24 hours?
SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.volume_24h = ( SELECT MAX(volume_24h) FROM historical )
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
Name the coins that were not opened on May 2013.
SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE STRFTIME('%Y-%m', T2.date) = '2013-05' AND T2.open IS NULL
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
When is the highest closed price of CHNCoin?
SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'CHNCoin' ORDER BY T2.close DESC LIMIT 1
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
When did Peercoin rank fifth?
SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Peercoin' AND T2.cmc_rank = 5
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
When is Devcoin most valuable in the market?
SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Devcoin' ORDER BY T2.market_cap DESC LIMIT 1
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
List the names of the top five coins traded on January 1, 2014.
SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2014-01-01' AND T2.cmc_rank <= 5
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
When was Lebowskis not opened?
SELECT DISTINCT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Lebowskis' AND (T2.open IS NULL OR T2.open = 0)
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
When is the highest price of Terracoin?
SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Terracoin' ORDER BY T2.price DESC LIMIT 1
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
How many times was Bytecoin traded in June 2013?
SELECT COUNT(T2.coin_id) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Bytecoin' AND STRFTIME('%Y-%m', T2.date) = '2013-06'
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
List the names of the coins above the average price on April 28, 2013.
SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2018-04-28' AND T2.price > ( SELECT AVG(price) FROM historical WHERE date = '2018-04-28' )
bird
CREATE TABLE coinmarketcap (id integer, name text, slug text, symbol text, status text, category text, description text, subreddit text, notice text, tags text, tag_names text, website text, platform_id integer, date_added text, date_launched text, date date, coin_id integer, cmc_rank integer, market_cap real, price real, open real, high real, low real, close real, time_high text, time_low text, volume_24h real, percent_change_1h real, percent_change_24h real, percent_change_7d real, circulating_supply real, total_supply real, max_supply real, num_market_pairs integer)
What's the percentage of coins that is higher than the price 1 hour ago in May 29,2013? List the names of these coins.
SELECT T1.NAME FROM coins AS T1 INNER JOIN historical AS T2 ON T1.ID = T2.coin_id WHERE T2.DATE = '2013-05-29' AND T2.percent_change_1h > 0
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
How many employees have obtained a doctorate?
SELECT COUNT(EmployeeID) FROM Employees WHERE TitleOfCourtesy = 'Dr.'
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
To whom does Nancy Davolio report? Please give that employee's full name.
SELECT FirstName, LastName FROM Employees WHERE EmployeeID = ( SELECT ReportsTo FROM Employees WHERE LastName = 'Davolio' AND FirstName = 'Nancy' )
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
Which phone number should I call if I want to reach Nancy Davolio's home?
SELECT HomePhone FROM Employees WHERE LastName = 'Davolio' AND FirstName = 'Nancy'
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
How many employees have Andrew Fuller as their direct supervisor?
SELECT COUNT(EmployeeID) FROM Employees WHERE ReportsTo = ( SELECT EmployeeID FROM Employees WHERE LastName = 'Fuller' AND FirstName = 'Andrew' )
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
Which employee has the highest salary? Please give his or her full name.
SELECT FirstName, LastName FROM Employees WHERE Salary = ( SELECT MAX(Salary) FROM Employees )
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
How much higher is the salary of Andrew Fuller than that of Nancy Davolio?
SELECT ( SELECT Salary FROM Employees WHERE LastName = 'Fuller' AND FirstName = 'Andrew' ) - ( SELECT Salary FROM Employees WHERE LastName = 'Davolio' AND FirstName = 'Nancy' ) AS RESULT
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
Among the employees working as Sales Representatives, how many of them are located in the UK?
SELECT COUNT(Country) FROM Employees WHERE Title = 'Sales Representative' AND Country = 'UK'
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
Which employee is in charge of the sales in Hollis? Please give the employee's full name.
SELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID WHERE T3.TerritoryDescription = 'Hollis'
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
The sales of how many territories is Nancy Davolio in charge of?
SELECT COUNT(T2.TerritoryID) FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.FirstName = 'Nancy' AND T1.LastName = 'Davolio'
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
Please list the names of all the territories whose sales are taken in charge by Nancy Davolio.
SELECT T3.TerritoryDescription FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID WHERE T1.FirstName = 'Nancy' AND T1.LastName = 'Davolio'
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
The sales of how many territories in total do the employees in London take charge of?
SELECT COUNT(T2.TerritoryID) FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.City = 'London'
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
Please list the territories whose sales are taken in charge by the employees who report to Andrew Fuller.
SELECT T3.TerritoryDescription FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID WHERE T1.ReportsTo = ( SELECT EmployeeID FROM Employees WHERE FirstName = 'Andrew' AND LastName = 'Fuller' )
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
How many employees in the UK takes charge of the sales in over 4 territories?
SELECT COUNT(COUNTEID) FROM ( SELECT T1.EmployeeID AS COUNTEID FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.Country = 'UK' GROUP BY T1.EmployeeID HAVING COUNT(T2.TerritoryID) > 4 ) T1
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
How many territories are there in the Eastern Region?
SELECT COUNT(T1.TerritoryID) FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Eastern'
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
Please list all the territories in the Eastern Region.
SELECT DISTINCT T1.TerritoryDescription FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Eastern'
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
How many employees in total are in charge of the sales in the Eastern Region?
SELECT COUNT(T.EmployeeID) FROM ( SELECT T3.EmployeeID FROM Region AS T1 INNER JOIN Territories AS T2 ON T1.RegionID = T2.RegionID INNER JOIN EmployeeTerritories AS T3 ON T2.TerritoryID = T3.TerritoryID WHERE T1.RegionDescription = 'Eastern' GROUP BY T3.EmployeeID ) T
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
Please list the home phone numbers of the employees who are in charge of the sales in the territories in the Eastern Region.
SELECT T1.HomePhone FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID INNER JOIN Region AS T4 ON T3.RegionID = T4.RegionID WHERE T4.RegionDescription = 'Eastern ' GROUP BY T1.HomePhone
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
How many more territories are there in than Eastern Region than in the Southern Region?
SELECT ( SELECT COUNT(T1.TerritoryID) FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Eastern' ) - ( SELECT COUNT(T1.TerritoryID) FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Southern' ) AS Calu
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
Please list the names of all the products ordered in order no. 10248.
SELECT T1.ProductName FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T2.OrderID = 10248
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
What is the quantity of Ikura ordered in order no. 10273?
SELECT T2.Quantity FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T2.OrderID = 10273 AND T1.ProductName = 'Ikura'
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
What is the total price of Ikura ordered in order no. 10273?
SELECT T2.UnitPrice * T2.Quantity FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T2.OrderID = 10273 AND T1.ProductName = 'Ikura'
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
What is the total production of the product that is ordered in the highest quantity in order no. 10248?
SELECT T1.UnitsInStock + T1.UnitsOnOrder FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T2.OrderID = 10248 ORDER BY T2.Quantity DESC LIMIT 1
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
Of all the products ordered in order no. 10248, which product has the highest user satisfaction?
SELECT T1.ProductName FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T2.OrderID = 10248 ORDER BY T1.ReorderLevel DESC LIMIT 1
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
How many orders have asked for the product Tofu?
SELECT COUNT(T2.OrderID) FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductName = 'Tofu'
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
Please list the IDs of the orders with a product whose production is not continuous.
SELECT T2.OrderID FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Discontinued = 1
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
Of all the orders that have ordered Ikura, how many of them enjoys a unit price that's lower than its standard unit price?
SELECT COUNT(T2.OrderID) FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductName = 'Ikura' AND T2.UnitPrice < T1.UnitPrice
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
What is the name of the supplier company for Aniseed Syrup?
SELECT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName = 'Aniseed Syrup'
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
Please list the names of all the products whose supplier is in Japan.
SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.Country = 'Japan'
bird
CREATE TABLE retail_world (CategoryID integer, CategoryName text, Description text, CustomerID integer, CustomerName text, ContactName text, Address text, City text, PostalCode text, Country text, EmployeeID integer, LastName text, FirstName text, BirthDate date, Photo text, Notes text, ShipperID integer, ShipperName text, Phone text, SupplierID integer, SupplierName text, ContactName text, Address text, City text, PostalCode text, Country text, Phone text, ProductID integer, ProductName text, SupplierID integer, CategoryID integer, Unit text, Price real, OrderID integer, CustomerID integer, EmployeeID integer, OrderDate datetime, ShipperID integer, OrderDetailID integer, OrderID integer, ProductID integer, Quantity integer)
Please list the phone numbers of the suppliers of the products that have a higher units on order than units in stock.
SELECT DISTINCT T2.Phone FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.UnitsInStock < T1.UnitsOnOrder
bird