db_id
stringclasses
69 values
question
stringlengths
24
325
evidence
stringlengths
0
673
SQL
stringlengths
23
804
question_id
int64
0
9.43k
difficulty
stringclasses
1 value
food_inspection_2
List down the dba name of restaurants that were inspected due to license.
inspected due to license refers to inspection_type = 'License'
SELECT T1.dba_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.inspection_type = 'License'
6,200
food_inspection_2
How many inspections done in 2010 had serious food safety issue?
in 2010 refers to inspection_date like '2010%'; had serious food safety issue refers to risk_level = 3
SELECT COUNT(T2.inspection_id) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y', T2.inspection_date) = '2010' AND T1.risk_level = 3
6,201
food_inspection_2
State the name of dbas with verified quality.
name of dba refers to dba_name; with verified quality refers to results = 'Pass' or results = 'Pass w/Conditions'
SELECT DISTINCT T1.dba_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.results LIKE '%Pass%'
6,202
food_inspection_2
Calculate the total salary for employees who did inspection from ID 52270 to 52272.
inspection from ID 52270 to 52272 refers to inspection_id between 52270 and 52272
SELECT SUM(T2.salary) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T1.inspection_id BETWEEN 52270 AND 52272
6,203
food_inspection_2
Calculate the average salary for employees who did inspection on License Re-Inspection.
inspection on License Re-Inspection refers to inspection_type = 'License Re-Inspection'; average salary = avg(salary)
SELECT AVG(T2.salary) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T1.inspection_type = 'License Re-Inspection'
6,204
food_inspection_2
Did license number 1222441 pass the inspection and what is the zip code number of it?
license number 1222441 refers to license_no = 1222441; result of the inspection refers to results; zip code number refers to zip
SELECT DISTINCT T2.results, T1.zip FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.license_no = 1222441
6,205
food_inspection_2
When did restaurant John Schaller has its first inspection in 2010?
John Schaller refers to dba_name = 'JOHN SCHALLER'; first inspection refers to min(inspection_date); in 2010 refers to inspection_date like '2010%'
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 = 'JOHN SCHALLER' AND strftime('%Y', T2.inspection_date) = '2010'
6,206
food_inspection_2
What is the full name of the employee that inspected establishments with license 1334073?
full name refers to first_name, last_name; with license 1334073 refers to license_no = 1334073
SELECT DISTINCT T1.first_name, T1.last_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.license_no = 1334073
6,207
food_inspection_2
Which establishments did Joshua Rosa inspect?
establishment name refers to dba_name
SELECT DISTINCT T3.dba_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN establishment AS T3 ON T2.license_no = T3.license_no WHERE T1.first_name = 'Joshua' AND T1.last_name = 'Rosa'
6,208
food_inspection_2
How many employees have salary greater than 70000 but fail the inspection?
salary greater than 70000 refers to salary > 70000; fail the inspection refers to results = 'Fail'
SELECT COUNT(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 T1.salary > 70000
6,209
food_inspection_2
Name the food businesses that passed the inspection in 2010.
business name refers to dba_name; food business refers to restaurant; pass the inspection refers to results = 'Pass'; in 2010 refers to inspection_date like '2010%'
SELECT DISTINCT T1.dba_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y', T2.inspection_date) = '2010' AND T2.results = 'Pass' AND T1.facility_type = 'Liquor'
6,210
food_inspection_2
What is the name of the establishment that Joshua Rosa inspected?
name of the establishment refers to dba_name
SELECT DISTINCT T3.dba_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN establishment AS T3 ON T2.license_no = T3.license_no WHERE T1.first_name = 'Joshua' AND T1.last_name = 'Rosa'
6,211
food_inspection_2
How many taverns failed in July 2010?
tavern refers to facility_type = 'Tavern'; failed refers to results = 'Fail'; in July 2010 refers to inspection_date like '2010-07%'
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-07' AND T2.results = 'Fail' AND T1.facility_type = 'Restaurant'
6,212
food_inspection_2
What is the risk level of the establishment that Bob Benson inspected?
SELECT DISTINCT T3.risk_level FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN establishment AS T3 ON T2.license_no = T3.license_no WHERE T1.first_name = 'Bob' AND T1.last_name = 'Benson'
6,213
food_inspection_2
Which establishments did Bob Benson inspect in 2010 and what was the results?
establishment name refers to dba_name; in 2010 refers to inspection_date like '2010%'
SELECT DISTINCT T3.dba_name, T2.results FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN establishment AS T3 ON T2.license_no = T3.license_no WHERE T1.first_name = 'Bob' AND T1.last_name = 'Benson' AND strftime('%Y', T2.inspection_date) = '2010'
6,214
food_inspection_2
What is the title of the employee that inspected the establishment with license number 1576687?
license number 1576687 refers to license_no = 1576687
SELECT DISTINCT T1.title FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.license_no = 1576687
6,215
food_inspection_2
How many inspection points with serious point level that have no fine?
serious point level refers to point_level = 'Serious '; have no fine refers to fine = 0
SELECT COUNT(DISTINCT T2.point_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
6,216
food_inspection_2
What is the percentage of restaurants that paid a fine of 250 among all establishments?
a fine of 250 refers to fine = 250; percentage = divide(sum(license_no where fine = 250), count(license_no)) * 100%
SELECT CAST(COUNT(CASE WHEN T3.fine = 250 THEN T1.license_no END) AS REAL) * 100 / COUNT(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 = 'Restaurant'
6,217
food_inspection_2
What is the percentage of establishments with a risk level of 1 among all of the establishments that passed the inspection?
a risk level of 1 refers to risk_level = 1; pass the inspection refers to results = 'Pass'; percentage = divide(sum(license_no where risk_level = 1), count(license_no)) * 100% where results = 'Pass'
SELECT CAST(COUNT(CASE WHEN T1.risk_level = 1 THEN T1.license_no END) AS REAL) * 100 / COUNT(T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.results = 'Pass'
6,218
food_inspection_2
Where does the employee named "Standard Murray" live?
address refers to address, city, state
SELECT address, city, state FROM employee WHERE first_name = 'Standard' AND last_name = 'Murray'
6,219
food_inspection_2
What is the facility type of the establishment named "Kinetic Playground"?
the establishment named "Kinetic Playground" refers to dba_name = 'Kinetic Playground'
SELECT facility_type FROM establishment WHERE dba_name = 'Kinetic Playground'
6,220
food_inspection_2
How much salary does Jessica Anthony receive?
SELECT salary FROM employee WHERE first_name = 'Jessica' AND last_name = 'Anthony'
6,221
food_inspection_2
What is the restaurant's name at "41.9532864854" latitude and "-87.7673790701422" longitude?
restaurant refers to facility_type = 'Restaurant'; name refers to dba_name; "41.9532864854" latitude and "-87.7673790701422" longitude refers to latitude = 41.9532864854 and longitude = -87.7673790701422
SELECT dba_name FROM establishment WHERE latitude = 41.9532864854 AND longitude = -87.7673790701422 AND facility_type = 'Restaurant'
6,222
food_inspection_2
Among the list of employees, what is the total number of supervisors?
supervisor refers to title = 'Supervisor'
SELECT COUNT(employee_id) FROM employee WHERE title = 'Supervisor'
6,223
food_inspection_2
Where in Chicago does the restaurant named "Old Timers Rest & Lounge" located?
in Chicago refers to city = 'CHICAGO'; restaurant refers to facility_type = 'Restaurant'; "Old Timers Rest & Lounge" refers to dba_name = 'OLD TIMERS REST & LOUNGE'; location refers to address
SELECT address FROM establishment WHERE city = 'CHICAGO' AND dba_name = 'OLD TIMERS REST & LOUNGE' AND facility_type = 'Restaurant'
6,224
food_inspection_2
How many employees are living in Hoffman Estates, IL?
in Hoffman Estates refers to city = 'Hoffman Estates'; IL refers to state = 'IL'
SELECT COUNT(employee_id) FROM employee WHERE state = 'IL' AND city = 'Hoffman Estates'
6,225
food_inspection_2
What is the total number of establishments with the highest risk level?
total number of establishments with the highest risk level = count(max(risk_level))
SELECT COUNT(license_no) FROM establishment WHERE risk_level = 3
6,226
food_inspection_2
Who is the employee that receives 82700 as their salary?
employee name refers to first_name, last_name; receives 82700 as salary refers to salary = 82700
SELECT first_name, last_name FROM employee WHERE salary = 82700
6,227
food_inspection_2
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
6,228
food_inspection_2
Please list the names of taverns that paid a $100 fine upon inspection.
name refers to dba_name; tavern refers to facility_type = 'Tavern'; a $100 fine refers to fine = 100
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
6,229
food_inspection_2
List point level of inspections with no fine.
no fine refers to fine = 0
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
6,230
food_inspection_2
Provide the facility type and license number of establishments with the lowest risk level but failed the inspection.
license number refers to license_no; the lowest risk level refers to min(risk_level); failed the inspection refers to results = 'Fail'
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'
6,231
food_inspection_2
What is the result of the February 24, 2010 inspection involving the employee named "Arnold Holder"?
February 24, 2010 refers to inspection_date = '2010-02-24'
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'
6,232
food_inspection_2
How many restaurants failed the inspection in April 2010?
restaurant refers to facility_type = 'Restaurant'; failed the inspection refers to results = 'Fail'; in April 2010 refers to inspection_date like '2010-04%'
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'
6,233
food_inspection_2
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'
6,234
food_inspection_2
What type of inspection was done on July 07, 2010, involving the employee named "Lisa Tillman"?
type of inspection refers to inspection_type; on July 07, 2010 refers to inspection_date = '2010-07-07'
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'
6,235
food_inspection_2
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).
comment "MUST CLEAN AND BETTER ORGANIZE HALLWAY AREA" refers to inspector_comment = 'MUST CLEAN AND BETTER ORGANIZE HALLWAY AREA'; sanitary operating requirement code of 7-38-030, 015, 010 (A), 005 (A) refers to code = '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)'
6,236
food_inspection_2
List down the names of the establishments with the highest risk level and failed the inspection.
name of establishment refers to dba_name; the highest risk level refers to max(risk_level); failed the inspection refers to results = 'Fail'
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'
6,237
food_inspection_2
What is the inspection ID where the employee named "David Hodges" is currently employed in the "Kamayan Express" establishment?
the "Kamayan Express" establishment refers to dba_name = 'KAMAYAN EXPRESS'
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'
6,238
food_inspection_2
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
6,239
food_inspection_2
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.
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" refers to 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.'; inspection category of Personnel refers to category = '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.'
6,240
food_inspection_2
How many grocery stores paid $250 fine upon their inspection?
grocery store refers to facility_type = 'Grocery Store'; $250 fine refers to fine = 250
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
6,241
food_inspection_2
What is the category of the inspection of the establishment named "J & J FOOD"?
the establishment named "J & J FOOD" refers to dba_name = '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'
6,242
food_inspection_2
Name the taverns that failed the inspection in January 2010.
tavern refers to facility_type = 'Tavern'; failed the inspection refers to results = 'Fail'; in January 2010 refers to inspection_date like '2010-01%'
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'
6,243
food_inspection_2
How many of the inspections with serious point levels have no fines?
serious point level refers to point_level = 'Serious'; no fines refers to fine = 0
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
6,244
food_inspection_2
What is the establishment's name with an inspection category of No Smoking Regulations?
establishment's name refers to dba_name; an inspection category of No Smoking Regulations refers to category = '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'
6,245
food_inspection_2
What is the difference in the number of restaurants that passed and failed the canvass inspection type?
canvass inspection type refers to inspection_type = 'Canvass'; restaurant refers to facility_type = 'Restaurant'; difference = subtract(count(inspection_id where results = 'Pass'), count(inspection_id where results = 'Fail'))
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'
6,246
food_inspection_2
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.
failed the inspection refers to results = 'Fail'; in January 2010 refers to inspection_date like '2010-01%'; name of employee refers to first_name, last_name; a salary greater than 70% of the average salary refers to salary > multiply(avg(salary), 0.7)
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 )
6,247
food_inspection_2
Among the establishments that paid a 500 fine, what is the percentage of restaurants?
a 500 fine refers to fine = 500; restaurant refers to facility_type = 'Restaurant'; percentage = divide(count(license_no where facility_type = 'Restaurant'), count(license_no)) * 100% where fine = 500
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
6,248
coinmarketcap
Name the coin that has the highest market capitalization for all transactions in 2018.
highest market capitalization refers to max(market_cap); in 2018 refers to year(date) = 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' )
6,249
coinmarketcap
What is the total value of Argentum coined traded in the past 24 hours on 2016/10/11.
total value in the past 24 hours refers to volume_24h; on 11/10/16 refers to date = '2016-11-10'
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'
6,250
coinmarketcap
List the price for Zetacoin on 13/11/1 and the next 7 consecutive days. What is the average price for these 7 days?
on 1/11/13 and the next 7 consecutive days refers to DATE BETWEEN '2013-11-01' AND '2013-11-07'; average price refers to AVG(price); Zetacoin refers to name = 'Zetacoin'
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'
6,251
coinmarketcap
For all transactions for WRAP in August 2016, list the time to achieve highest price and the time to achieve the lowest price.
in May 2013 refers to month(date) = 5 AND year(date) = 2013; time to achieve the highest price refers to time_high; time to achieve the lowest price refers to time_low; WRAP refers to name = 'WARP'
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'
6,252
coinmarketcap
State the transaction date whereby DigixDAO was transacted at the hightest price.
the highest price refers to max(price); DigixDAO refers to name = 'DigixDAO'
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
6,253
coinmarketcap
Name the coin with the highest percentage price changed in 24 hours. State the transaction date and price.
the highest percentage price changed in 24 hours refers to max(percent_change_24h)
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 )
6,254
coinmarketcap
What is the average monthly circulating supply for Frozen in 2014.
average monthly circulating supply = AVG(circulating_supply); in 2017 refers to date BETWEEN '2017-01-01' AND '2017-12-31'
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'
6,255
coinmarketcap
List all the inactive coins and state the last date of its transaction?
the last date refers to max(date); inactive coins refers to status = 'inactive'
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
6,256
coinmarketcap
What was the price of 1 Bitcoin in 2016?
2016 refers to historical date where year(date) = 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'
6,257
coinmarketcap
State the transaction date and the price when Bitcoin was bottomed?
was bottomed refers to min(price)
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
6,258
coinmarketcap
For all coins with average price more than $1000. State the current status of the coin.
average price more than $1000 refers to AVG(price)>1000
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
6,259
coinmarketcap
Name the coin and date of transactions with the greatest decline in percent change in 1 hour.
the greatest decline in percent change in 1 hour refers to max(percent_change_1h)
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 )
6,260
coinmarketcap
Name the coin under the token category that gives the highest max profit.
the highest max profit refers to max(subtract(high, low))
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
6,261
coinmarketcap
Name the coin that have higher than average percentage price changed from the previous 24 hours for transaction on 2013/6/22.
average percentage price changed from the previous 24 hours refers to AVG(percent_change_24h); on 15/5/2013 refers to DATE = '2013-04-15'
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
6,262
coinmarketcap
Which crytocurrency was ranked the first by CoinMarketCap on 2013/4/28?
ranked the first refers to cmc_rank = 1; on 2013/4/28 refers to date = '2013-04-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
6,263
coinmarketcap
How much dollars was a Bitcoin worth on 2013/4/28 according to the coin market?
worth refers to price; on 2013/4/28 refers to date = '2013-04-28'
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'
6,264
coinmarketcap
Which crytocurrency was not opened on 2013/5/3?
not opened refers to open IS NULL; on 2013/5/3 refers to date = '2013-05-03'
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
6,265
coinmarketcap
What was the price of Bitcoin when it closed at the end of the day on 2013/4/29?
price when it closed refers to close; on 2013/4/29 refers to date = '2013-04-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'
6,266
coinmarketcap
When did Bitcoin reach its highest price on 2013/4/29?
time that a coin reaches its highest price refers to time_high; on 2013/4/29 refers to date = '2013-04-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'
6,267
coinmarketcap
What was the max profit a user can make on Bitcoin on 2013/4/28?
the max profit = subtract(high, low); on 2013/4/28 refers to date = '2013-04-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'
6,268
coinmarketcap
What was the number of Bitcoins verifiably burned until 2013/4/28?
the number of Bitcoins verifiably burned = max_supply - total_supply; 2013/4/28 refers to date = '2013-04-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'
6,269
coinmarketcap
Which crytocurrency was traded in the highest value on 2016/1/8?
traded in the highest value refers to max(volume_24h); on 2016/1/8 refers to date = '2016-01-08'
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' )
6,270
coinmarketcap
Please list the names of the crytocurrencies that have a total amount of existence of over 10000000 on 2013/4/28.
a total amount of existence of over 10000000 refers to total_supply>10000000; on 2013/4/28 refers to date = '2013-04-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
6,271
coinmarketcap
Had Bitcoin's price increased or decreased on 2013/5/5 compared with the price 7 days before?
price increased refers to percent_change_7d>0; decreased refers percent_change_7d<0; on 2013/5/5 refers to date = '2013-05-05'
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'
6,272
coinmarketcap
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?
a bigger number of coins circulating in the market refers to max(circulating_supply); on 2013/4/28 refers to date = '2013-04-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 T1.name IN ('Bitcoin', 'Litecoin') ORDER BY T2.circulating_supply DESC LIMIT 1
6,273
coinmarketcap
How much was a Bitcoin on 2013/4/28?
how much refers to price; on 2013/4/28 refers to date = '2013-04-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'
6,274
coinmarketcap
What was the average price of a Bitcoin in the year 2013?
average price refers SUM(price)/COUNT(named = 'Bitcoin'); in the year 2013 refers to year(date) = 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'
6,275
coinmarketcap
What was the percentage of the Bitcoins verifiably burned until 2018/4/28?
the percentage of the Bitcoins verifiably burned = divide(subtract(SUM(max_supply), SUM(total_supply)),SUM(total_supply))*100%; until 2013/4/28 refers to date<'2013-04-08'
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'
6,276
coinmarketcap
Please list the names of coins that has been disappeared.
has disappeared refers to status = 'extinct'
SELECT name FROM coins WHERE status = 'extinct'
6,277
coinmarketcap
What's the descripition of BitBar?
SELECT description FROM coins WHERE name = 'BitBar'
6,278
coinmarketcap
How many coins were added in May 2013? Please list the names of coins.
in May 2013 refers to year(date_added) = 2013 and month(date_added) = 5
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'
6,279
coinmarketcap
List the names and symbols of the coins that were added on June 14, 2013.
added on June 14, 2013 refers to date_added like '2013-06-14%'
SELECT name, symbol FROM coins WHERE date_added LIKE '2013-06-14%'
6,280
coinmarketcap
List the names of coins that cannot be traded in 2014.
cannot be tracked refers to status = 'untracked'; in 2014 refers to year(date_added) = '2014'
SELECT name FROM coins WHERE date_added LIKE '2014%' AND status = 'untracked'
6,281
coinmarketcap
Name the coins that have three tags.
have three tags refers to length(tag_names)-length(replace(tag_names,',','')) = 2
SELECT name FROM coins WHERE LENGTH(tag_names) - LENGTH(replace(tag_names, ',', '')) = 2
6,282
coinmarketcap
What is the name of the coin with the highest price?
the highest price refers to max(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 )
6,283
coinmarketcap
Please name the coin that ranked first among the coins traded on April 29, 2013.
ranked first refers to cmc_rank = 1; on April 29, 2013 refers to date = '2013-04-29'
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
6,284
coinmarketcap
When is the best time to purchase Bitcoin?
lowest price refers to low; best time refers to date with the low;
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
6,285
coinmarketcap
What is the name of the coin that creates the most total value in the past 24 hours?
creates the most total value in the past 24 hours refers to max(volume_24h)
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 )
6,286
coinmarketcap
Name the coins that were not opened on May 2013.
not opened refers to open IS NULL; on May 2013 refers to year(date) = 2019 AND month(date) = 5
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
6,287
coinmarketcap
When is the highest closed price of CHNCoin?
the highest closed price refers to max(close)
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
6,288
coinmarketcap
When did Peercoin rank fifth?
when refers to date; rank fifth refers to cmc_rank = 5
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
6,289
coinmarketcap
When is Devcoin most valuable in the market?
when refers to date; most valuable refers to max(market_cap)
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
6,290
coinmarketcap
List the names of the top five coins traded on January 1, 2014.
the top five coins refers to cmc_rank< = 5; on January 1, 2014 refers to date = '2014-01-01'
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
6,291
coinmarketcap
When was Lebowskis not opened?
when refers to date; not opened refers to open IS NULL
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)
6,292
coinmarketcap
When is the highest price of Terracoin?
when refers to date; the highest price refers to max(price)
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
6,293
coinmarketcap
How many times was Bytecoin traded in June 2013?
in June 2013 refers to year(date) = 2013 AND month(date) = 6
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'
6,294
coinmarketcap
List the names of the coins above the average price on April 28, 2013.
average price = divide(sum(price), count(name)); on April 28, 2013 refers to date = '2013-04-28'
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' )
6,295
coinmarketcap
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.
percentage that is higher than the price 1 hour ago refers to percent_change_1h>0; in May 29,2013 refers to date = '2013-05-29'
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
6,296
retail_world
How many employees have obtained a doctorate?
doctorate refers to TitleOfCourtesy = 'Dr.;
SELECT COUNT(EmployeeID) FROM Employees WHERE TitleOfCourtesy = 'Dr.'
6,297
retail_world
To whom does Nancy Davolio report? Please give that employee's full name.
to whom refers to ReportsTo; full name = FirstName, LastName;
SELECT FirstName, LastName FROM Employees WHERE EmployeeID = ( SELECT ReportsTo FROM Employees WHERE LastName = 'Davolio' AND FirstName = 'Nancy' )
6,298
retail_world
Which phone number should I call if I want to reach Nancy Davolio's home?
phone number of Nancy Davolio's home refers to HomePhone WHERE FirstName = 'Nancy' AND LastName = 'Davolio';
SELECT HomePhone FROM Employees WHERE LastName = 'Davolio' AND FirstName = 'Nancy'
6,299