id
int64
0
9.43k
db_id
stringclasses
69 values
schema
stringclasses
69 values
question
stringlengths
24
325
output
stringlengths
23
804
evidence
stringlengths
0
673
filtered_schema
listlengths
0
16
6,100
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the title of the book in the order ID 931?
SELECT T1.title FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T2.order_id = 931
[ "book.book_id", "book.title", "order_line.book_id", "order_line.order_id" ]
6,101
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the language of the book titled Zorro?
SELECT T2.language_name FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'Zorro'
"Zorro" is the title of the book; langauge refers to language_name
[ "book.language_id", "book.title", "book_language.language_id", "book_language.language_name" ]
6,102
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Provide the email of the customers that purchased books with a price range of 3 to 5 dollars.
SELECT DISTINCT T3.email FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T1.price BETWEEN 3 AND 5
books with a price range of 3 to 5 dollars refers to price BETWEEN 3 AND 5
[ "cust_order.customer_id", "cust_order.order_id", "customer.customer_id", "customer.email", "order_line.order_id", "order_line.price" ]
6,103
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
List the ISBN of the books that cost 7.5 dollars.
SELECT T1.isbn13 FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T2.price = 7.5
ISBN refers to isbn13; books cost 7.5 dollars refers to price = 7.5
[ "book.book_id", "book.isbn13", "order_line.book_id", "order_line.price" ]
6,104
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Give the publisher's name of the books authored by Alan Lee.
SELECT T4.publisher_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id INNER JOIN publisher AS T4 ON T4.publisher_id = T1.publisher_id WHERE T3.author_name = 'Alan Lee' GROUP BY T4.publisher_name
"Alan Lee" is the author_name; publisher's name refers to publisher_name
[ "author.author_id", "author.author_name", "book.book_id", "book.publisher_id", "book_author.author_id", "book_author.book_id", "publisher.publisher_id", "publisher.publisher_name" ]
6,105
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the sum of the number of pages of the books ordered by Mick Sever?
SELECT SUM(T1.num_pages) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T4.first_name = 'Mick' AND T4.last_name = 'Sever'
sum of the number of pages refers to Sum(num_pages)
[ "book.book_id", "book.num_pages", "cust_order.customer_id", "cust_order.order_id", "customer.customer_id", "customer.first_name", "customer.last_name", "order_line.book_id", "order_line.order_id" ]
6,106
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Write down the author's name of the book most recently published.
SELECT T3.author_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id ORDER BY T1.publication_date DESC LIMIT 1
author's name refers to author_name; book most recently published refers to Max(publication_date)
[ "author.author_id", "author.author_name", "book.book_id", "book.publication_date", "book_author.author_id", "book_author.book_id" ]
6,107
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
In books published by Ace Book, what is the percentage of English books published?
SELECT CAST(SUM(CASE WHEN T1.language_name = 'English' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM book_language AS T1 INNER JOIN book AS T2 ON T1.language_id = T2.language_id INNER JOIN publisher AS T3 ON T3.publisher_id = T2.publisher_id WHERE T3.publisher_name = 'Ace Book'
"Ace Book" is the publisher_name; English book refers to language_name = 'English'; percentage = Divide (Count(book_id where language_name = 'English'), Count(book_id)) * 100
[ "book.language_id", "book.publisher_id", "book_language.language_id", "book_language.language_name", "publisher.publisher_id", "publisher.publisher_name" ]
6,108
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Among the books purchased by less than 1 dollar, what is the difference between the number of books with less than 500 pages and books with greater than 500 pages?
SELECT SUM(CASE WHEN T1.num_pages < 500 THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.num_pages > 500 THEN 1 ELSE 0 END) AS dif FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T2.price < 1
book purchased by less than 1 dollar refers to price < 1; books with less than 500 pages refers to num_pages < 500; greater than 500 pages refers to num_pages > 500; Difference = Subtract (Count(book_id where num_pages < 500), Count(book_id where num_pages > 500))
[ "book.book_id", "book.num_pages", "order_line.book_id", "order_line.price" ]
6,109
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What are the language and title of the ordered books with price less than 20% of the average price of all ordered books?
SELECT DISTINCT T3.language_name, T2.title FROM order_line AS T1 INNER JOIN book AS T2 ON T1.book_id = T2.book_id INNER JOIN book_language AS T3 ON T3.language_id = T2.language_id WHERE T1.price * 100 < ( SELECT AVG(price) FROM order_line ) * 20
language refers to language_name; books with price less than 20% of the average price refers to price < Multiply (AVG(price), 0.2)
[ "book.book_id", "book.language_id", "book.title", "book_language.language_id", "book_language.language_name", "order_line.book_id", "order_line.price" ]
6,110
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
Please list the full names of all the sanitarians under the supervision of Darlisha Jacobs.
SELECT first_name, last_name FROM employee WHERE title = 'Sanitarian' AND supervisor = ( SELECT employee_id FROM employee WHERE first_name = 'Darlisha' AND last_name = 'Jacobs' )
full name refers to first_name, last_name
[ "employee.employee_id", "employee.first_name", "employee.last_name", "employee.supervisor", "employee.title" ]
6,111
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
Please list the full names of the sanitarians who did at least one inspection in May, 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 strftime('%Y-%m', T2.inspection_date) = '2010-05' AND T1.title = 'Sanitarian'
full name refers to first_name, last_name; in May 2010 refers to inspection_date like '2010-05%'; sanitarian refers to title = 'Sanitarian'
[ "employee.employee_id", "employee.first_name", "employee.last_name", "employee.title", "inspection.employee_id", "inspection.inspection_date" ]
6,112
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
How many inspections were sanitarian Joshua Rosa responsible for in 2010?
SELECT COUNT(T2.inspection_id) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE strftime('%Y', T2.inspection_date) = '2010' AND T1.first_name = 'Joshua' AND T1.last_name = 'Rosa'
in 2010 refers to inspection_date like '2010%'
[ "employee.employee_id", "employee.first_name", "employee.last_name", "inspection.employee_id", "inspection.inspection_date", "inspection.inspection_id" ]
6,113
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
Please list the assumed name of all the facilities inspected by Joshua Rosa.
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'
assumed name refers to dba_name
[ "employee.employee_id", "employee.first_name", "employee.last_name", "establishment.dba_name", "establishment.license_no", "inspection.employee_id", "inspection.license_no" ]
6,114
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
Among the facilities that have undergone at least one inspection in 2010, how many of them are restaurants or cafeterias?
SELECT COUNT(DISTINCT T1.license_no) FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y', T1.inspection_date) = '2010' AND T2.facility_type = 'Restaurant'
in 2010 refers to inspection_date like '2010%'; restaurant or cafeteria refers to facility_type = 'Restaurant'
[ "establishment.facility_type", "establishment.license_no", "inspection.inspection_date", "inspection.license_no" ]
6,115
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
Please list the location coordinates of all the facilities that had an inspection on 2010/5/11.
SELECT DISTINCT T2.latitude, T2.longitude FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no WHERE T1.inspection_date = '2010-05-11'
location coordinates refers to latitude, longitude; on 2010/5/11 refers to inspection_date = '2010-05-11'
[ "establishment.latitude", "establishment.license_no", "establishment.longitude", "inspection.inspection_date", "inspection.license_no" ]
6,116
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
Among the facilities that have undergone at least one inspection in 2010, how many of them are in ward no.42?
SELECT COUNT(DISTINCT T1.license_no) FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y', T1.inspection_date) = '2010' AND T2.ward = 42
in 2010 refers to inspection_date like '2010%'; in ward no.42 refers to ward = 42
[ "establishment.license_no", "establishment.ward", "inspection.inspection_date", "inspection.license_no" ]
6,117
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
Please list the full names of all the sanitarians who have inspected the facility Burbank.
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 establishment AS T3 ON T2.license_no = T3.license_no WHERE T3.dba_name = 'Burbank' AND T1.title = 'Sanitarian'
full name refers to first_name, last_name; the facility Burbank refers to dba_name = 'Burbank'
[ "employee.employee_id", "employee.first_name", "employee.last_name", "employee.title", "establishment.dba_name", "establishment.license_no", "inspection.employee_id", "inspection.license_no" ]
6,118
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
Please list the assumed name of all the facilities that failed an inspection in 2010.
SELECT DISTINCT T2.dba_name FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no WHERE T1.results = 'Fail' AND strftime('%Y', T1.inspection_date) = '2010'
assumed name refers to dba_name; failed an inspection refers to results = 'Fail'; in 2010 refers to inspection_date like '2010%'
[ "establishment.dba_name", "establishment.license_no", "inspection.inspection_date", "inspection.license_no", "inspection.results" ]
6,119
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
What is the full name of the sanitarian who inspected Amundsen High School on 2010/5/11?
SELECT T1.first_name, T1.last_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 T2.inspection_date = '2010-05-11' AND T3.dba_name = 'AMUNDSEN HIGH SCHOOL' AND T1.title = 'Sanitarian'
full name refers to first_name, last_name;  Amundsen High School refers to dba_name = 'AMUNDSEN HIGH SCHOOL'; on 2010/5/11 refers to inspection_date = '2010-05-11'
[ "employee.employee_id", "employee.first_name", "employee.last_name", "employee.title", "establishment.dba_name", "establishment.license_no", "inspection.employee_id", "inspection.inspection_date", "inspection.license_no" ]
6,120
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
Among the inspections done by sanitarian Joshua Rosa, how many of them have the result of "pass"?
SELECT COUNT(T2.inspection_id) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.results = 'Pass' AND T1.first_name = 'Joshua' AND T1.last_name = 'Rosa'
have the result of "pass" refers to results = 'Pass'
[ "employee.employee_id", "employee.first_name", "employee.last_name", "inspection.employee_id", "inspection.inspection_id", "inspection.results" ]
6,121
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
After Azha Restaurant Inc. passed the inspection on 2010/1/21, when was the follow-up inspection done?
SELECT T1.followup_to FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no WHERE T2.dba_name = 'Azha Restaurant Inc.' AND T1.results = 'Pass' AND T1.inspection_date = '2010-01-21'
Azha Restaurant Inc. refers to dba_name = 'Azha Restaurant Inc.'; on 2010/1/21 refers to inspection_date = '2010-01-21'; follow-up inspection date refers to followup_to
[ "establishment.dba_name", "establishment.license_no", "inspection.followup_to", "inspection.inspection_date", "inspection.license_no", "inspection.results" ]
6,122
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
Among the facilities that had undergone at least one inspection in 2010, how many of them have the most serious food safety issues?
SELECT COUNT(DISTINCT T2.license_no) FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y', T1.inspection_date) = '2010' AND T2.risk_level = 3
in 2010 refers to inspection_date like '2010%'; the most serious food safety issues refers to risk_level = 3
[ "establishment.license_no", "establishment.risk_level", "inspection.inspection_date", "inspection.license_no" ]
6,123
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
What is the average number of inspections carried out in the year 2010 by a sanitarian whose salary is over 70000?
SELECT CAST(SUM(CASE WHEN T2.inspection_date LIKE '2010%' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.salary > 70000 THEN 1 ELSE 0 END) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id
in the year 2010 refers to inspection_date like '2010%'; salary is over 70000 refers to salary > 70000; average number = divide(sum(inspection where inspection_date like '2010%'), sum(employee_id where salary > 70000))
[ "employee.employee_id", "employee.salary", "inspection.employee_id", "inspection.inspection_date" ]
6,124
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
What is the point level of "Refrigeration and metal stem thermometers provided and conspicuous"?
SELECT point_level FROM inspection_point WHERE Description = 'Refrigeration and metal stem thermometers provided and conspicuous '
"Refrigeration and metal stem thermometers provided and conspicuous" refers to Description = 'Refrigeration and metal stem thermometers provided and conspicuous '
[ "inspection_point.Description", "inspection_point.point_level" ]
6,125
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
Which employee was responsible for inspection no.48224? Give the full name.
SELECT T2.first_name, T2.last_name FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T1.inspection_id = 48224
inspection no.48224 refers to inspection_id = '48224'; full name refers to first_name, last_name;
[ "employee.employee_id", "employee.first_name", "employee.last_name", "inspection.employee_id", "inspection.inspection_id" ]
6,126
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
All Style Buffet refers to dba_name = 'All Style Buffet'; Restaurant refers to facility_type = 'Restaurant'
[ "establishment.dba_name", "establishment.facility_type", "establishment.license_no", "inspection.inspection_id", "inspection.license_no" ]
6,127
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
Wing Hung Chop Suey Restaurant refers to aka_name = 'WING HUNG CHOP SUEY RESTAURANT'; first inspection refers to min(inspection_date)
[ "establishment.aka_name", "establishment.license_no", "inspection.inspection_date", "inspection.license_no" ]
6,128
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
restaurant refers to facility_type = 'Restaurant'; on 2015/5/8 refers to inspection_date = '2015-05-08'
[ "establishment.facility_type", "establishment.license_no", "inspection.inspection_date", "inspection.license_no" ]
6,129
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
"food maintenance" related refers to category = 'Food Maintenance'; inspection no.1454071 refers to inspection_id = '1454071'
[ "inspection_point.category", "inspection_point.point_id", "violation.inspection_id", "violation.point_id" ]
6,130
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
Royal Thai Cuisine refers to dba_name = 'ROYAL THAI CUISINE'; 2015/5/8 refers to inspection_date = '2015-05-08'
[ "establishment.dba_name", "establishment.license_no", "inspection.inspection_date", "inspection.inspection_id", "inspection.license_no", "violation.inspection_id", "violation.point_id" ]
6,131
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
grocery store refers to facility_type = 'Grocery Store'; "3635 W DIVERSEY AVE" refers to address = '3635 W DIVERSEY AVE'
[ "establishment.address", "establishment.facility_type", "establishment.license_no", "inspection.inspection_id", "inspection.license_no" ]
6,132
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
full name refers to first_name, last_name; most of the inspections refers to max(count(employee_id))
[ "T.first_name", "T.last_name", "employee.employee_id", "employee.first_name", "employee.last_name", "inspection.employee_id", "inspection.inspection_id" ]
6,133
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
the result of "Out of Business" refers to results = 'Out of Business'
[ "employee.employee_id", "employee.first_name", "employee.last_name", "inspection.employee_id", "inspection.inspection_id", "inspection.results" ]
6,134
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
sanitarian refers to title = 'Sanitarian'; 5000 N Wolcott Ave refers to address = '5000 N Wolcott Ave'; in May 2011 refers to inspection_date between '2011-04-30' and '2011-06-01'
[ "employee.address", "employee.employee_id", "employee.title", "inspection.employee_id", "inspection.inspection_date", "inspection.inspection_id" ]
6,135
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
phone number refers to phone; sanitarian refers to title = 'Sanitarian'; inspection no.634597 refers to inspection_id = '634597'
[ "employee.employee_id", "employee.phone", "employee.title", "inspection.employee_id", "inspection.inspection_id" ]
6,136
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
the most inspections refers to max(count(employee_id))
[ "T2.employee_id", "employee.employee_id", "employee.salary", "inspection.employee_id", "inspection.inspection_id" ]
6,137
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
risk level 3 refers to risk_level = '3'; tavern refers to facility_type = 'TAVERN'; average number = divide(count(inspection_id), sum(license_no)) where risk_level = '3' and facility_type = 'TAVERN'
[ "establishment.facility_type", "establishment.license_no", "establishment.risk_level", "inspection.inspection_id", "inspection.license_no" ]
6,138
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
Pockets refers to dba_name = 'POCKETS'; Restaurant refers to facility_type = 'Restaurant'; pass refers to results = 'Pass'; the inspection pass rate = divide(sum(inspection_id where results = 'Pass'), count(license_no)) where dba_name = 'POCKETS' and facility_type = 'Restaurant'
[ "establishment.dba_name", "establishment.facility_type", "establishment.license_no", "inspection.inspection_id", "inspection.license_no", "inspection.results" ]
6,139
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
How many sanitarian employees in Chicago are from the zip code 60617?
SELECT COUNT(employee_id) FROM employee WHERE zip = '60617'
sanitarian refers to title = 'Sanitarian'; in Chicago refers to city = 'Chicago'; zip code 60617 refers to zip = 60617
[ "employee.employee_id", "employee.zip" ]
6,140
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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 '
assumed name refers to dba_name; 2903 W Irving Park Rd refers to address = '2903 W IRVING PARK RD '
[ "establishment.address", "establishment.dba_name" ]
6,141
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
full name refers to first_name, last_name; the lowest salary refers to min(salary)
[ "employee.first_name", "employee.last_name", "employee.salary" ]
6,142
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
Homemade Pizza refers to dba_name = 'HOMEMADE PIZZA'; a risk level of 2 refers to risk_level = 2
[ "establishment.dba_name", "establishment.license_no", "establishment.risk_level" ]
6,143
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
critical food safety problems refers to fine = 500; point_id = 3
[ "violation.fine", "violation.inspection_id", "violation.point_id" ]
6,144
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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' )
[ "employee.employee_id", "employee.first_name", "employee.last_name", "employee.supervisor" ]
6,145
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
Renaldi's Pizza refers to dba_name = 'RENALDI''S PIZZA'; first inspection refers to min(inspection_date)
[ "establishment.dba_name", "establishment.license_no", "inspection.inspection_date", "inspection.license_no" ]
6,146
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
full name refers to first_name, last_name; the most inspection refers to max(count(employee_id)); in March 2016 refers to inspection_date like '2016-03%'
[ "T2.employee_id", "employee.employee_id", "employee.first_name", "employee.last_name", "inspection.employee_id", "inspection.inspection_date", "inspection.inspection_id" ]
6,147
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
name of business refers to dba_name; passed with conditions refers to results = 'Pass w/ Conditions'; in May 2012 refers to inspection_date like '2012-05%'
[ "establishment.dba_name", "establishment.license_no", "inspection.inspection_date", "inspection.license_no", "inspection.results" ]
6,148
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
short form complaint inspection refers to inspection_type = 'Short Form Complaint'; pass refers to results = 'Pass'
[ "employee.employee_id", "employee.first_name", "employee.last_name", "inspection.employee_id", "inspection.inspection_type", "inspection.license_no", "inspection.results" ]
6,149
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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 lic...
ward 42 refers to ward = 42; at least 5 failed inspection results refers to count(results = 'Fail') > = 5; between 1/1/2010 to 12/31/2015 refers to inspection_date between '2010-01-01' and '2015-12-31'
[ "establishment.license_no", "establishment.ward", "inspection.inspection_date", "inspection.license_no", "inspection.results" ]
6,150
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
the highest number of inspections done refers to max(count(employee_id))
[ "T2.employee_id", "employee.employee_id", "employee.salary", "inspection.employee_id", "inspection.inspection_id" ]
6,151
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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...
assumed name of business refers to dba_name; the highest total fine refers to max(sum(fine)); in 2014 refers to inspection_date like '2014%'
[ "T.dba_name", "establishment.dba_name", "establishment.license_no", "inspection.inspection_date", "inspection.inspection_id", "inspection.license_no", "violation.fine", "violation.inspection_id" ]
6,152
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
precise location refers to latitude, longitude; the highest number of failed inspections refers to max(count(results where results = 'Fail'))
[ "T2.license_no", "establishment.latitude", "establishment.license_no", "establishment.longitude", "inspection.license_no", "inspection.results" ]
6,153
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
comment of the inspector refers to inspector_comment; Taqueria La Fiesta refers to dba_name = 'TAQUERIA LA FIESTA'; on 1/25/2010 refers to inspection_date = '2010-01-25'
[ "establishment.dba_name", "establishment.license_no", "inspection.inspection_date", "inspection.inspection_id", "inspection.license_no", "violation.inspection_id", "violation.inspector_comment" ]
6,154
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
total fine = sum(fine); Ron of Japan Inc refers to dba_name = 'RON OF JAPAN INC'; on February 2014 refers to inspection_date like '2014-02%'
[ "establishment.dba_name", "establishment.license_no", "inspection.inspection_date", "inspection.inspection_id", "inspection.license_no", "violation.fine", "violation.inspection_id" ]
6,155
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
full name refers to first_name, last_name; Taqueria La Paz refers to dba_name = 'TAQUERIA LA PAZ'
[ "employee.employee_id", "employee.first_name", "employee.last_name", "establishment.dba_name", "establishment.license_no", "inspection.employee_id", "inspection.license_no" ]
6,156
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
full name refers to first_name, last_name; the highest amount of fine refers to max(sum(fine))
[ "T.first_name", "T.last_name", "employee.employee_id", "employee.first_name", "employee.last_name", "inspection.employee_id", "inspection.inspection_id", "violation.fine", "violation.inspection_id" ]
6,157
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
the highest salary refers to max(salary); sanitarian refers to title = 'Sanitarian'; name refers to first_name, last_name; average number = divide(sum(inspection_id), 5)
[ "employee.employee_id", "employee.first_name", "employee.last_name", "employee.salary", "employee.title", "inspection.employee_id", "inspection.inspection_id" ]
6,158
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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.lice...
business name refers to dba_name; the highest number of inspections done max(count(inspection_id)); percentage of passed inspections = divide(sum(inspection_id where results = 'Pass'), total(inspection_id)) * 100%; percentage of failed inspections = divide(sum(inspection_id where results = 'Fail'), total(inspection_id)...
[ "establishment.dba_name", "establishment.license_no", "inspection.inspection_id", "inspection.license_no", "inspection.results" ]
6,159
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
7211 S Hermitage Ave refers to address = '7211 S Hermitage Ave'; Chicago refers to city = 'Chicago'; IL refers to state = 'IL'
[ "employee.address", "employee.city", "employee.last_name", "employee.state" ]
6,160
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
establishment's name refers to dba_name; employee name refers to first_name, last_name; inspection ID 44256 refers to inspection_id = 44256; on May 5, 2010 refers to inspection_date = '2010-05-05'
[ "employee.employee_id", "employee.first_name", "employee.last_name", "establishment.dba_name", "establishment.license_no", "inspection.employee_id", "inspection.inspection_date", "inspection.inspection_id", "inspection.license_no" ]
6,161
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
school refers to facility_type = 'School'; pass refers to results = 'Pass'; in March 2010 refers to inspection_date like '2010-03%'
[ "establishment.address", "establishment.facility_type", "establishment.license_no", "inspection.inspection_date", "inspection.license_no", "inspection.results" ]
6,162
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
full name refers to first_name, last_name; canvass inspection type refers to inspection_type = 'Canvass'; on March 09, 2010 refers to inspection_date = '2010-03-09'
[ "employee.employee_id", "employee.first_name", "employee.last_name", "inspection.employee_id", "inspection.inspection_date", "inspection.inspection_type" ]
6,163
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
"PIZZA RUSTICA, INC." refers to dba_name = 'PIZZA RUSTICA, INC'
[ "establishment.dba_name", "establishment.license_no", "inspection.inspection_id", "inspection.license_no" ]
6,164
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
restaurant refers to facility_type = 'Restaurant'; the highest risk level refers to max(risk_level); pass the inspection refers to results = 'Pass'
[ "establishment.facility_type", "establishment.license_no", "establishment.risk_level", "inspection.license_no", "inspection.results" ]
6,165
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
name refers to first_name, last_name; Display of Inspection Report Summary category refers to category = 'Display of Inspection Report Summary'
[ "employee.employee_id", "employee.first_name", "employee.last_name", "inspection.employee_id", "inspection.inspection_id", "inspection_point.category", "inspection_point.point_id", "violation.inspection_id", "violation.point_id" ]
6,166
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
[ "employee.employee_id", "employee.title", "inspection.employee_id", "inspection.inspection_id" ]
6,167
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
restaurant refers to facility_type = 'Restaurant'; the lowest risk level refers to min(risk_level); failed refers to results = 'Fail'; the complaint inspection type refers to inspection_type = 'Complaint'
[ "establishment.facility_type", "establishment.license_no", "establishment.risk_level", "inspection.inspection_type", "inspection.license_no", "inspection.results" ]
6,168
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
complete address refers to state, city, address
[ "establishment.address", "establishment.city", "establishment.license_no", "establishment.state", "inspection.inspection_id", "inspection.license_no", "violation.fine", "violation.inspection_id" ]
6,169
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
critical point level refers to point_level = 'Critical'; $500 fine refers to fine = 500; inspector comment "CDI ON 5-17-10" refers to inspector_comment = 'CDI ON 5-17-10'
[ "inspection_point.point_id", "inspection_point.point_level", "violation.fine", "violation.inspection_id", "violation.inspector_comment", "violation.point_id" ]
6,170
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
inspection description refers to Description; inspector's comment refers to inspector_comment
[ "inspection_point.Description", "inspection_point.point_id", "violation.inspection_id", "violation.inspector_comment", "violation.point_id" ]
6,171
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
inspector's comment refers to inspector_comment; clean operating requirement code refers to code
[ "inspection_point.code", "inspection_point.point_id", "violation.inspection_id", "violation.inspector_comment", "violation.point_id" ]
6,172
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
failed in inspection refers to results = 'Fail'; the highest risk level refers to max(risk_level); percentage = divide(count(license_no where risk_level = max(risk_level)), count(license_no)) * 100% where results = 'Fail'
[ "establishment.license_no", "establishment.risk_level", "inspection.license_no", "inspection.results" ]
6,173
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
salary between $75000 and $85000 refers to 75000 < = salary < = 80000; difference = subtract(count(inspection_id where fine = 100), count(inspection_id where fine = 500)) where 75000 < = salary < = 80000
[ "employee.employee_id", "employee.salary", "inspection.employee_id", "inspection.inspection_id", "violation.fine", "violation.inspection_id" ]
6,174
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
How many inspections were done in January 2011?
SELECT COUNT(inspection_id) FROM inspection WHERE strftime('%Y-%m', inspection_date) = '2011-01'
in January 2011 refers to inspection_date like '2011-01%'
[ "inspection.inspection_date", "inspection.inspection_id" ]
6,175
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
How many inspections failed in 2014?
SELECT COUNT(inspection_id) FROM inspection WHERE strftime('%Y', inspection_date) = '2014' AND results = 'Fail'
failed refers to results = 'Fail'; in 2014 refers to inspection_date like '2014%'
[ "inspection.inspection_date", "inspection.inspection_id", "inspection.results" ]
6,176
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
fine for a minor food safety problem refers to fine = 100; percentage = divide(count(inspection_id where fine = 100), sum(inspection_id)) * 100%
[ "violation.fine", "violation.inspection_id" ]
6,177
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
on 7th August 2010 refers to inspection_date = '2010-08-07'
[ "inspection.inspection_date", "inspection.inspection_id", "violation.fine", "violation.inspection_id", "violation.point_id" ]
6,178
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
under the personnel category refers to category = 'Personnel'
[ "inspection_point.category", "inspection_point.point_id", "violation.inspection_id", "violation.point_id" ]
6,179
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
names refers to dba_name; inspection result refers to results; in Burnham refers to city = 'BURNHAM'
[ "establishment.city", "establishment.dba_name", "establishment.license_no", "inspection.license_no", "inspection.results" ]
6,180
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
under toxic items refers to category = 'Toxic Items'; no-smoking regulations refers to category = 'No Smoking Regulations'
[ "inspection_point.category", "inspection_point.point_id", "violation.inspection_id", "violation.point_id" ]
6,181
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
facility name refers to dba_name; on 20th November 2012 refers to inspection_date = '2012-11-20'
[ "employee.employee_id", "employee.first_name", "employee.last_name", "establishment.dba_name", "establishment.license_no", "inspection.employee_id", "inspection.inspection_date", "inspection.license_no" ]
6,182
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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(...
in January 2014 refers to inspection_date like '2014-01%'
[ "employee.employee_id", "employee.first_name", "employee.last_name", "inspection.employee_id", "inspection.inspection_date", "inspection.inspection_id", "inspection_point.category", "inspection_point.point_id", "violation.fine", "violation.inspection_id", "violation.point_id" ]
6,183
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
under the display of inspection report summary category refers to category = 'Display of Inspection Report Summary'
[ "inspection_point.category", "inspection_point.point_id", "violation.inspection_id", "violation.point_id" ]
6,184
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
type refers to inspection_type; Riverwalk café refers to facility_type = 'RIVERWALK CAFE'
[ "establishment.facility_type", "establishment.license_no", "inspection.inspection_type", "inspection.license_no", "inspection.results" ]
6,185
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
employee's name refers to first_name, last_name; Jean Samocki refers to dba_name = 'JEAN SAMOCKI'
[ "employee.employee_id", "employee.first_name", "employee.last_name", "establishment.dba_name", "establishment.license_no", "inspection.employee_id", "inspection.license_no", "inspection.results" ]
6,186
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
Hacienda Los Torres refers to dba_name = 'HACIENDA LOS TORRES'; ward 36 refers to ward = 36; failing an inspection refers to results = 'Fail';
[ "establishment.dba_name", "establishment.license_no", "establishment.ward", "inspection.inspection_id", "inspection.license_no", "inspection.results", "violation.fine", "violation.inspection_id" ]
6,187
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
under the food equipment and utensil category refers to category = 'Food Equipment and Utensil'
[ "inspection_point.category", "inspection_point.point_id", "violation.fine", "violation.point_id" ]
6,188
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
name refers to dba_name; location refers to latitude, longitude; failed inspections refers to results = 'Fail'; on 29th July 2013 refers to inspection_date = '2013-07-29'
[ "establishment.dba_name", "establishment.latitude", "establishment.license_no", "establishment.longitude", "inspection.inspection_date", "inspection.license_no", "inspection.results" ]
6,189
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
verified quality refers to results like 'Pass%'; from Chicago refers to city = 'CHICAGO'; percentage = divide(count(inspection_id where results like 'Pass%'), sum(inspection_id)) * 100%
[ "establishment.city", "establishment.license_no", "inspection.inspection_id", "inspection.license_no", "inspection.results" ]
6,190
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
from 2010 to 2017 refers to inspection_date > '2010-01-01' AND T2.inspection_id < '2017-12-31'; average inspections per year = divide(count(inspection_id where inspection_date > '2010-01-01' AND T2.inspection_id < '2017-12-31'), 8)
[ "employee.employee_id", "employee.first_name", "employee.last_name", "inspection.employee_id", "inspection.inspection_date", "inspection.inspection_id" ]
6,191
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
[ "employee.employee_id", "employee.first_name", "inspection.employee_id", "inspection.inspection_id" ]
6,192
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
[ "employee.address", "employee.employee_id", "inspection.employee_id", "inspection.inspection_id" ]
6,193
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
[ "employee.employee_id", "employee.last_name", "inspection.employee_id", "inspection.inspection_id" ]
6,194
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
inspection result refers to results
[ "employee.employee_id", "employee.first_name", "employee.last_name", "inspection.employee_id", "inspection.results" ]
6,195
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
dated 11/5/2010 refers to inspection_date = '2010-11-05'
[ "employee.address", "employee.employee_id", "inspection.employee_id", "inspection.inspection_date" ]
6,196
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
phone number refers to phone; Canvass inspection refers to inspection_type = 'Canvass'
[ "employee.employee_id", "employee.phone", "inspection.employee_id", "inspection.inspection_type" ]
6,197
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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
job title refers to title
[ "employee.employee_id", "employee.title", "inspection.employee_id", "inspection.inspection_id" ]
6,198
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
Xando Coffee & Bar / Cosi Sandwich Bar refers to dba_name = 'XANDO COFFEE & BAR / COSI SANDWICH BAR'
[ "establishment.dba_name", "establishment.license_no", "inspection.license_no", "inspection.results" ]
6,199
food_inspection_2
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
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'
type of inspection refers to inspection_type; John Schaller refers to dba_name = 'JOHN SCHALLER'
[ "establishment.dba_name", "establishment.license_no", "inspection.inspection_type", "inspection.license_no" ]