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)
How many inspections did All Style Buffet Restaurant have?
SELECT COUNT(T2.inspection_id) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.facility_type = 'Restaurant' AND T1.dba_name = 'All Style Buffet'
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)
When did Wing Hung Chop Suey Restaurant have its first inspection?
SELECT MIN(T2.inspection_date) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.aka_name = 'WING HUNG CHOP SUEY RESTAURANT'
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 were inspected on 2015/5/8?
SELECT COUNT(T2.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.inspection_date = '2015-05-08' AND T1.facility_type = 'Restaurant'
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 "food maintenance" related violations did inspection no.1454071 have?
SELECT COUNT(T2.point_id) FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T2.inspection_id = '1454071' AND T1.category = 'Food Maintenance'
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)
State the number of violations did Royal Thai Cuisine has during the 2015/5/8 inspection.
SELECT COUNT(T3.point_id) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id WHERE T2.inspection_date = '2015-05-08' AND T1.dba_name = 'ROYAL THAI CUISINE'
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)
For the grocery store located at "3635 W DIVERSEY AVE", how many inspections did it have?
SELECT COUNT(T2.inspection_id) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.address = '3635 W DIVERSEY AVE ' AND T1.facility_type = 'Grocery Store'
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 responsible for most of the inspections? Give the full name.
SELECT T.first_name, T.last_name FROM ( SELECT T2.employee_id, T2.first_name, T2.last_name, COUNT(T1.inspection_id) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id GROUP BY T2.employee_id, T2.first_name, T2.last_name ORDER BY COUNT(T1.inspection_id) DESC LIMIT 1 ) AS T
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 inspections done by Lisa Tillman ended up with the result of "Out of Business"?
SELECT COUNT(T1.inspection_id) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T2.first_name = 'Lisa' AND T2.last_name = 'Tillman' AND T1.results = 'Out of Business'
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)
For the sanitarian who lives on 5000 N Wolcott Ave, how many establishments did he/she inspect in the May of 2011?
SELECT COUNT(T1.inspection_id) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T2.address = '5000 N Wolcott Ave' AND T2.title = 'Sanitarian' AND strftime('%Y-%m', T1.inspection_date) = '2011-05'
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)
Show the phone number of the sanitarian who was responsible for inspection no.634597.
SELECT T2.phone FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T1.inspection_id = 634597 AND T2.title = 'Sanitarian'
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)
State the salary of the employee who did the most inspections.
SELECT T1.salary FROM employee AS T1 INNER JOIN ( SELECT T.employee_id, COUNT(T.inspection_id) FROM inspection AS T GROUP BY T.employee_id ORDER BY COUNT(T.inspection_id) DESC LIMIT 1 ) AS T2 ON T1.employee_id = T2.employee_id
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 average number of inspections did risk level 3 taverns have?
SELECT CAST(COUNT(T2.inspection_id) AS REAL) / COUNT(DISTINCT T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.risk_level = 3 AND T1.facility_type = 'TAVERN'
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)
State the inspection pass rate of Pockets Restaurant.
SELECT CAST(COUNT(CASE WHEN T2.results = 'Pass' THEN T2.inspection_id ELSE NULL END) AS REAL) * 100 / COUNT(T2.inspection_id) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.dba_name = 'POCKETS' AND T1.facility_type = 'Restaurant'
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 sanitarian employees in Chicago are from the zip code 60617?
SELECT COUNT(employee_id) FROM employee WHERE zip = '60617'
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 assumed name of the business located at 2903 W Irving Park Rd?
SELECT DISTINCT dba_name FROM establishment WHERE address = '2903 W IRVING PARK RD '
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 full name of the employee with the lowest salary?
SELECT first_name, last_name FROM employee ORDER BY salary ASC 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)
How many establishments that are doing business as Homemade Pizza have a risk level of 2?
SELECT COUNT(license_no) FROM establishment WHERE risk_level = 2 AND dba_name = 'HOMEMADE PIZZA'
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 inspections with critical food safety problems are under inspection point id 3?
SELECT COUNT(inspection_id) FROM violation WHERE point_id = 3 AND fine = 500
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 employees are under Gregory Cardenas?
SELECT COUNT(T1.employee_id) FROM employee AS T1 WHERE T1.supervisor = ( SELECT employee_id FROM employee WHERE first_name = 'Gregory' AND last_name = 'Cardenas' )
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)
When did Renaldi's Pizza had its first inspection?
SELECT MIN(T2.inspection_date) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.dba_name = 'RENALDI''S PIZZA'
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 full name of the employee who was responsible for the most inspection in March 2016?
SELECT T3.first_name, T3.last_name FROM ( SELECT T1.employee_id, COUNT(T1.inspection_id) FROM inspection AS T1 WHERE strftime('%Y-%m', T1.inspection_date) = '2016-03' GROUP BY T1.employee_id ORDER BY COUNT(T1.inspection_id) DESC LIMIT 1 ) AS T2 INNER JOIN employee AS T3 ON T2.employee_id = T3.employee_id
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 are the names of the businesses that passed with conditions in May 2012?
SELECT DISTINCT T2.dba_name FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y-%m', T1.inspection_date) = '2012-05' AND T1.results = 'Pass w/ Conditions'
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)
Out of all the short form complaint inspections done by David Hodges, how many businesses passed?
SELECT COUNT(DISTINCT T2.license_no) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T1.first_name = 'David' AND T1.last_name = 'Hodges' AND T1.employee_id = 153225 AND T2.inspection_type = 'Short Form Complaint' AND T2.results = 'Pass'
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 businesses from ward 42 have at least 5 failed inspection results between 1/1/2010 to 12/31/2015?
SELECT COUNT(DISTINCT T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.inspection_date BETWEEN '2010-01-01' AND '2015-12-31' AND T1.ward = 42 AND T1.license_no IN ( SELECT license_no FROM ( SELECT license_no FROM inspection WHERE results = 'Fail' GROUP BY license_no HAVING COUNT(results) >= 5 ) )
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 much is the salary of the employee who has the highest number of inspections done of all time?
SELECT T1.salary FROM employee AS T1 INNER JOIN ( SELECT employee_id, COUNT(inspection_id) FROM inspection GROUP BY employee_id ORDER BY COUNT(inspection_id) DESC LIMIT 1 ) AS T2 ON T1.employee_id = T2.employee_id
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 assumed name of the business that has the highest total fine in 2014?
SELECT T.dba_name FROM ( SELECT T1.dba_name, SUM(T3.fine) 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', T2.inspection_date) = '2014' GROUP BY T1.dba_name ORDER BY SUM(T3.fine) DESC LIMIT 1 ) AS T
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 precise location of the establishment with the highest number of failed inspections?
SELECT T1.latitude, T1.longitude FROM establishment AS T1 INNER JOIN ( SELECT license_no FROM inspection WHERE results = 'Fail' GROUP BY license_no ORDER BY COUNT(results) DESC LIMIT 1 ) AS T2 ON T1.license_no = T2.license_no
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 are the comments of the inspector during the inspection of Taqueria La Fiesta on 1/25/2010?
SELECT T3.inspector_comment FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id WHERE T2.inspection_date = '2010-01-25' AND T1.dba_name = 'TAQUERIA LA FIESTA'
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 much is the total fine given to Ron of Japan Inc in its inspection done on February 2014?
SELECT SUM(T3.fine) 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) = '2014-02' AND T1.dba_name = 'RON OF JAPAN INC'
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 the full names of the employees who were responsible for inspecting Taqueria La Paz.
SELECT DISTINCT T3.first_name, T3.last_name 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 T1.dba_name = 'TAQUERIA LA PAZ'
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 full name of the employee who gave the highest amount of fine of all time?
SELECT T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, SUM(T3.fine) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id GROUP BY T1.first_name, T1.last_name ORDER BY SUM(T3.fine) DESC LIMIT 1 ) t
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 average number of inspections done by the top 5 employees with the highest salary? List the names of the said employees.
SELECT CAST(COUNT(DISTINCT T2.inspection_id) AS REAL) / 5, T1.first_name, T1.last_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T1.title = 'Sanitarian' ORDER BY T1.salary DESC LIMIT 5
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)
Which business had the highest number of inspections done? Calculate the percentage of passed and failed inspections of the said business.
SELECT T2.dba_name , CAST(SUM(CASE WHEN T1.results = 'Pass' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.inspection_id) AS percentagePassed , CAST(SUM(CASE WHEN T1.results = 'Fail' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.inspection_id) FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no GROUP BY T2.dba_name ORDER BY COUNT(T1.license_no) 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)
What is the employee's last name at 7211 S Hermitage Ave, Chicago, IL?
SELECT last_name FROM employee WHERE address = '7211 S Hermitage Ave' AND city = 'Chicago' AND state = 'IL'
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 and employee involved in the inspection ID 44256 on May 5, 2010?
SELECT T1.dba_name, T3.first_name, T3.last_name 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 T2.inspection_date = '2010-05-05' AND T2.inspection_id = 44256
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)
Give the address of the schools that passed the inspection in March 2010.
SELECT DISTINCT T1.address FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y-%m', T2.inspection_date) = '2010-03' AND T2.results = 'Pass' AND T1.facility_type = 'School'
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 employee's full name involved in the canvass inspection type on March 09, 2010?
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.inspection_date = '2010-03-09' AND T2.inspection_type = 'Canvass'
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 establishment named "PIZZA RUSTICA, INC."
SELECT DISTINCT T2.inspection_id FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.dba_name = 'PIZZA RUSTICA, INC'
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 with the highest risk level still passed the inspection?
SELECT COUNT(DISTINCT T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.risk_level = 3 AND T2.results = 'Pass' 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)
List the names of employees involved in an inspection with the Display of Inspection Report Summary category.
SELECT DISTINCT T1.first_name, T1.last_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id 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 = 'Display of Inspection Report Summary'
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 title of the employee involved in inspection ID 60332?
SELECT T1.title FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_id = 60332
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 restaurants with the lowest risk level failed the complaint inspection type?
SELECT COUNT(DISTINCT T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.risk_level = '1' AND T2.inspection_type = 'Complaint' 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)
Provide the fine paid and the complete address of the establishment with inspection ID 48216.
SELECT DISTINCT T3.fine, T1.state, T1.city, T1.address FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id WHERE T2.inspection_id = 48216
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 of the inspection with critical point level, $500 fine, and inspector comment "CDI ON 5-17-10"?
SELECT T2.inspection_id FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T2.fine = 500 AND T1.point_level = 'Critical' AND T2.inspector_comment = 'CDI ON 5-17-10'
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 are the inspection description and inspector's comments in the inspection ID 164795?
SELECT T1.Description, T2.inspector_comment FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T2.inspection_id = 44247
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 are the inspector's comments and clean operating requirement code for inspection ID 54216 and point ID 34?
SELECT T2.inspector_comment, T1.code FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T2.inspection_id = 54216 AND T2.point_id = 34
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 in the inspection, what is the percentage of establishments with the highest risk level?
SELECT CAST(COUNT(CASE WHEN T1.risk_level = 3 THEN T1.license_no END) AS REAL) * 100 / COUNT(T1.risk_level) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE 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)
Among the employees that receive a salary between $75000 to $85000, what is the difference between the number of employees which undergone an inspection that fined 100 and 500?
SELECT SUM(CASE WHEN T3.fine = 100 THEN 1 ELSE 0 END) - SUM(CASE WHEN T3.fine = 500 THEN 1 ELSE 0 END) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id WHERE T1.salary BETWEEN 75000 AND 80000
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 inspections were done in January 2011?
SELECT COUNT(inspection_id) FROM inspection WHERE strftime('%Y-%m', inspection_date) = '2011-01'
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 inspections failed in 2014?
SELECT COUNT(inspection_id) FROM inspection WHERE strftime('%Y', inspection_date) = '2014' AND 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)
Calculate the percentage of inspections with the fine for a minor food safety problem.
SELECT CAST(COUNT(CASE WHEN fine = 100 THEN inspection_id END) AS REAL) * 100 / COUNT(inspection_id) FROM violation
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 the point IDs and fines of the inspections done on 7th August 2010.
SELECT T2.point_id, T2.fine FROM inspection AS T1 INNER JOIN violation AS T2 ON T1.inspection_id = T2.inspection_id WHERE T1.inspection_date = '2010-08-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)
How many inspections were done under the personnel category?
SELECT COUNT(T1.inspection_id) FROM violation AS T1 INNER JOIN inspection_point AS T2 ON T1.point_id = T2.point_id WHERE T2.category = 'Personnel'
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 names and inspection results of the facilities located in Burnham.
SELECT DISTINCT T1.dba_name, T2.results FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.city = 'BURNHAM'
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)
Compare the number of inspections under toxic items and no-smoking regulations.
SELECT COUNT(CASE WHEN T2.category = 'Toxic Items' THEN T1.inspection_id END) AS Tox_nums , COUNT(CASE WHEN T2.category = 'No Smoking Regulations' THEN T1.inspection_id END) AS NosmoNums FROM violation AS T1 INNER JOIN inspection_point AS T2 ON T1.point_id = T2.point_id
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)
Which facilities were inspected by Sarah Lindsey on 20th November 2012?
SELECT DISTINCT T1.dba_name 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 T2.inspection_date = '2012-11-20' AND T3.first_name = 'Sarah' AND T3.last_name = 'Lindsey'
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 categories and fines for the inspections done by Lisa Tillman in January 2014.
SELECT DISTINCT T4.category, T3.fine FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id INNER JOIN violation AS T3 ON T1.inspection_id = T3.inspection_id INNER JOIN inspection_point AS T4 ON T3.point_id = T4.point_id WHERE T2.first_name = 'Lisa' AND T2.last_name = 'Tillman' AND strftime('%Y-%m', T1.inspection_date) = '2014-01'
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 inspections were done under the display of inspection report summary category?
SELECT COUNT(T2.inspection_id) FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T1.category = 'Display of Inspection Report Summary'
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 the types and results of the inspections done on Riverwalk café.
SELECT T2.inspection_type, T2.results FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.facility_type = 'RIVERWALK CAFE'
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 inspected Jean Samocki and what was the result?
SELECT T3.first_name, T3.last_name, T2.results 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 T1.dba_name = 'JEAN SAMOCKI'
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 much did Hacienda Los Torres from ward 36 fine for failing an inspection?
SELECT SUM(T3.fine) 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.dba_name = 'HACIENDA LOS TORRES' AND T1.ward = 36 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)
Calculate the total amount of fine under the food equipment and utensil category.
SELECT SUM(T2.fine) FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T1.category = 'Food Equipment and Utensil'
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 names and locations of the facilities that failed inspections on 29th July 2013.
SELECT T2.dba_name, T2.longitude, T2.latitude FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no WHERE T1.inspection_date = '2013-07-29' AND T1.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)
Calculate the percentage of inspections with verified quality. Among them, how many businesses were from Chicago?
SELECT CAST(COUNT(CASE WHEN T2.results LIKE '%Pass%' THEN T2.inspection_id END) AS REAL) * 100 / COUNT(T2.inspection_id), COUNT(DISTINCT T2.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.city = 'CHICAGO'
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)
Calculate the average inspections per year done by Jessica Anthony from 2010 to 2017.
SELECT CAST(COUNT(CASE WHEN T1.first_name = 'Jessica' AND T1.last_name = 'Anthony' THEN T2.inspection_id ELSE 0 END) AS REAL) / 8 FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE strftime('%Y', T2.inspection_date) BETWEEN '2010' AND '2017'
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 first name of employee who did inspection ID 48225?
SELECT T1.first_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_id = 48225
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)
Tell the address of employee who did inspection ID 52238?
SELECT T1.address FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_id = 52238
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)
Write down the last name of employee who did inspection ID 52238?
SELECT T1.last_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_id = 52238
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 result for inspection done by Thomas Langley?
SELECT DISTINCT T2.results FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T1.first_name = 'Thomas' AND T1.last_name = 'Langley'
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 address of employees who did inspection dated 11/5/2010.
SELECT DISTINCT T1.address FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_date = '2010-11-05'
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 phone numbers of employees who did Canvass inspection.
SELECT DISTINCT T1.phone FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_type = 'Canvass'
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 job title of employee who did inspection ID 52269?
SELECT T1.title FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_id = 52269
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 are the inspection results for Xando Coffee & Bar / Cosi Sandwich Bar?
SELECT DISTINCT T2.results FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.dba_name = 'XANDO COFFEE & BAR / COSI SANDWICH BAR'
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 at John Schaller?
SELECT DISTINCT T2.inspection_type FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.dba_name = 'JOHN SCHALLER'
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 dba name of restaurants that were inspected due to 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'
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 inspections done in 2010 had serious food safety issue?
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
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)
State the name of dbas with verified quality.
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%'
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)
Calculate the total salary for employees who did inspection from ID 52270 to 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
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)
Calculate the average salary for employees who did inspection on License Re-Inspection.
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'
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)
Did license number 1222441 pass the inspection and what is the zip code number of it?
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
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)
When did restaurant John Schaller has its first inspection in 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'
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 full name of the employee that inspected establishments with license 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
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)
Which establishments did Joshua Rosa inspect?
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'
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 employees have salary greater than 70000 but fail the inspection?
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
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 food businesses that passed the inspection in 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'
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 name of the establishment that Joshua Rosa inspected?
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'
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 taverns failed in July 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-07' AND T2.results = 'Fail' 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)
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'
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)
Which establishments did Bob Benson inspect in 2010 and what was the results?
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'
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 title of the employee that inspected the establishment with license number 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
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 inspection points with serious point level that have no fine?
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
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 percentage of restaurants that paid a fine of 250 among all establishments?
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'
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 percentage of establishments with a risk level of 1 among all of the establishments that passed the inspection?
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'
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)
Where does the employee named "Standard Murray" live?
SELECT address, city, state FROM employee WHERE first_name = 'Standard' AND last_name = 'Murray'
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 facility type of the establishment named "Kinetic Playground"?
SELECT facility_type FROM establishment WHERE dba_name = 'Kinetic Playground'
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 much salary does Jessica Anthony receive?
SELECT salary FROM employee WHERE first_name = 'Jessica' AND last_name = 'Anthony'
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 restaurant's name at "41.9532864854" latitude and "-87.7673790701422" longitude?
SELECT dba_name FROM establishment WHERE latitude = 41.9532864854 AND longitude = -87.7673790701422 AND 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 list of employees, what is the total number of supervisors?
SELECT COUNT(employee_id) FROM employee WHERE title = 'Supervisor'
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)
Where in Chicago does the restaurant named "Old Timers Rest & Lounge" located?
SELECT address FROM establishment WHERE city = 'CHICAGO' AND dba_name = 'OLD TIMERS REST & LOUNGE' AND 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)
How many employees are living in Hoffman Estates, IL?
SELECT COUNT(employee_id) FROM employee WHERE state = 'IL' AND city = 'Hoffman Estates'
bird