1sf/bird-sql-train-with-schema huggingface dataset:
Database: chicago_crime
Tables: Community_Area, District, FBI_Code, IUCR, Neighborhood, Ward, Crime
Columns (table index, column name): -1, *, 0, community_area_no, 0, community_area_name, 0, side, 0, population, 1, district_no, 1, district_name, 1, address, 1, zip_code, 1, commander, 1, email, 1, phone, 1, fax, 1, tty, 1, twitter, 2, fbi_code_no, 2, title, 2, description, 2, crime_against, 3, iucr_no, 3, primary_description, 3, secondary_description, 3, index_code, 4, neighborhood_name, 4, community_area_no, 5, ward_no, 5, alderman_first_name, 5, alderman_last_name, 5, alderman_name_suffix, 5, ward_office_address, 5, ward_office_zip, 5, ward_email, 5, ward_office_phone, 5, ward_office_fax, 5, city_hall_office_room, 5, city_hall_office_phone, 5, city_hall_office_fax, 5, Population, 6, report_no, 6, case_number, 6, date, 6, block, 6, iucr_no, 6, location_description, 6, arrest, 6, domestic, 6, beat, 6, district_no, 6, ward_no, 6, community_area_no, 6, fbi_code_no, 6, latitude, 6, longitude
Question: Please list the case numbers of all the crimes whose short description of the kind of crime is "Homicide 1st & 2nd Degree" in the FBI classification.
Evidence: "Homicide 1st & 2nd Degree" is the title
SQL: SELECT T2.case_number FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T1.title = 'Homicide 1st & 2nd Degree'
Database: chicago_crime
Tables: Community_Area, District, FBI_Code, IUCR, Neighborhood, Ward, Crime
Columns (table index, column name): -1, *, 0, community_area_no, 0, community_area_name, 0, side, 0, population, 1, district_no, 1, district_name, 1, address, 1, zip_code, 1, commander, 1, email, 1, phone, 1, fax, 1, tty, 1, twitter, 2, fbi_code_no, 2, title, 2, description, 2, crime_against, 3, iucr_no, 3, primary_description, 3, secondary_description, 3, index_code, 4, neighborhood_name, 4, community_area_no, 5, ward_no, 5, alderman_first_name, 5, alderman_last_name, 5, alderman_name_suffix, 5, ward_office_address, 5, ward_office_zip, 5, ward_email, 5, ward_office_phone, 5, ward_office_fax, 5, city_hall_office_room, 5, city_hall_office_phone, 5, city_hall_office_fax, 5, Population, 6, report_no, 6, case_number, 6, date, 6, block, 6, iucr_no, 6, location_description, 6, arrest, 6, domestic, 6, beat, 6, district_no, 6, ward_no, 6, community_area_no, 6, fbi_code_no, 6, latitude, 6, longitude
Question: Among the incidents in January, 2018, how many of them were stated "against Property" in the FBI classification?
Evidence: in January 2018 refers to Substr(date, 1, 1) = '1' AND Substr(date, 5, 4) = '2018'; against property refers to crime_against = 'Property'
SQL: SELECT SUM(CASE WHEN SUBSTR(T2.date, 5, 4) = '2018' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T1.crime_against = 'Property' AND SUBSTR(T2.date, 1, 1) = '1'
Database: chicago_crime
Tables: Community_Area, District, FBI_Code, IUCR, Neighborhood, Ward, Crime
Columns (table index, column name): -1, *, 0, community_area_no, 0, community_area_name, 0, side, 0, population, 1, district_no, 1, district_name, 1, address, 1, zip_code, 1, commander, 1, email, 1, phone, 1, fax, 1, tty, 1, twitter, 2, fbi_code_no, 2, title, 2, description, 2, crime_against, 3, iucr_no, 3, primary_description, 3, secondary_description, 3, index_code, 4, neighborhood_name, 4, community_area_no, 5, ward_no, 5, alderman_first_name, 5, alderman_last_name, 5, alderman_name_suffix, 5, ward_office_address, 5, ward_office_zip, 5, ward_email, 5, ward_office_phone, 5, ward_office_fax, 5, city_hall_office_room, 5, city_hall_office_phone, 5, city_hall_office_fax, 5, Population, 6, report_no, 6, case_number, 6, date, 6, block, 6, iucr_no, 6, location_description, 6, arrest, 6, domestic, 6, beat, 6, district_no, 6, ward_no, 6, community_area_no, 6, fbi_code_no, 6, latitude, 6, longitude
Question: District commander Robert A. Rubio was responsible for how many incidents in January, 2018?
Evidence: in January 2018 refers to Substr(date, 1, 1) = '1' AND Substr(date, 5, 4) = '2018'
SQL: SELECT SUM(CASE WHEN SUBSTR(T2.date, 5, 4) = '2018' THEN 1 ELSE 0 END) FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T1.commander = 'Robert A. Rubio' AND SUBSTR(T2.date, 1, 1) = '1'
Database: chicago_crime
Tables: Community_Area, District, FBI_Code, IUCR, Neighborhood, Ward, Crime
Columns (table index, column name): -1, *, 0, community_area_no, 0, community_area_name, 0, side, 0, population, 1, district_no, 1, district_name, 1, address, 1, zip_code, 1, commander, 1, email, 1, phone, 1, fax, 1, tty, 1, twitter, 2, fbi_code_no, 2, title, 2, description, 2, crime_against, 3, iucr_no, 3, primary_description, 3, secondary_description, 3, index_code, 4, neighborhood_name, 4, community_area_no, 5, ward_no, 5, alderman_first_name, 5, alderman_last_name, 5, alderman_name_suffix, 5, ward_office_address, 5, ward_office_zip, 5, ward_email, 5, ward_office_phone, 5, ward_office_fax, 5, city_hall_office_room, 5, city_hall_office_phone, 5, city_hall_office_fax, 5, Population, 6, report_no, 6, case_number, 6, date, 6, block, 6, iucr_no, 6, location_description, 6, arrest, 6, domestic, 6, beat, 6, district_no, 6, ward_no, 6, community_area_no, 6, fbi_code_no, 6, latitude, 6, longitude
Question: Which district commander was responsible for more incidents in January, 2018, Robert A. Rubio or Glenn White?
Evidence: in January 2018 refers to Substr(date, 1, 1) = '1' AND Substr(date, 5, 4) = '2018'; 'Robert A. Rubio' and 'Glenn White' are both commander; responsible for more incident refers to Max(count(ward_no))
SQL: SELECT T1.commander FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T1.commander IN ('Robert A. Rubio', 'Glenn White') AND SUBSTR(T2.date, 1, 1) = '1' AND SUBSTR(T2.date, 5, 4) = '2018' GROUP BY T1.commander
Database: chicago_crime
Tables: Community_Area, District, FBI_Code, IUCR, Neighborhood, Ward, Crime
Columns (table index, column name): -1, *, 0, community_area_no, 0, community_area_name, 0, side, 0, population, 1, district_no, 1, district_name, 1, address, 1, zip_code, 1, commander, 1, email, 1, phone, 1, fax, 1, tty, 1, twitter, 2, fbi_code_no, 2, title, 2, description, 2, crime_against, 3, iucr_no, 3, primary_description, 3, secondary_description, 3, index_code, 4, neighborhood_name, 4, community_area_no, 5, ward_no, 5, alderman_first_name, 5, alderman_last_name, 5, alderman_name_suffix, 5, ward_office_address, 5, ward_office_zip, 5, ward_email, 5, ward_office_phone, 5, ward_office_fax, 5, city_hall_office_room, 5, city_hall_office_phone, 5, city_hall_office_fax, 5, Population, 6, report_no, 6, case_number, 6, date, 6, block, 6, iucr_no, 6, location_description, 6, arrest, 6, domestic, 6, beat, 6, district_no, 6, ward_no, 6, community_area_no, 6, fbi_code_no, 6, latitude, 6, longitude
Question: Please list the blocks where all the incidents in the district commanded by Robert A. Rubio took place.
Evidence: "Robert A. Rubio" is the commander
SQL: SELECT T2.block FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T1.commander = 'Robert A. Rubio'
Database: chicago_crime
Tables: Community_Area, District, FBI_Code, IUCR, Neighborhood, Ward, Crime
Columns (table index, column name): -1, *, 0, community_area_no, 0, community_area_name, 0, side, 0, population, 1, district_no, 1, district_name, 1, address, 1, zip_code, 1, commander, 1, email, 1, phone, 1, fax, 1, tty, 1, twitter, 2, fbi_code_no, 2, title, 2, description, 2, crime_against, 3, iucr_no, 3, primary_description, 3, secondary_description, 3, index_code, 4, neighborhood_name, 4, community_area_no, 5, ward_no, 5, alderman_first_name, 5, alderman_last_name, 5, alderman_name_suffix, 5, ward_office_address, 5, ward_office_zip, 5, ward_email, 5, ward_office_phone, 5, ward_office_fax, 5, city_hall_office_room, 5, city_hall_office_phone, 5, city_hall_office_fax, 5, Population, 6, report_no, 6, case_number, 6, date, 6, block, 6, iucr_no, 6, location_description, 6, arrest, 6, domestic, 6, beat, 6, district_no, 6, ward_no, 6, community_area_no, 6, fbi_code_no, 6, latitude, 6, longitude
Question: What is the average number of incidents per month in 2018 in the ward with the most population?
Evidence: in 2018 refers to date like '%2018%'; ward with most population refers to Max(Population); average number of incident per month refers to Divide(Count(ward_no), 12)
SQL: SELECT COUNT(T1.ward_no) / 12 AS average FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.date LIKE '%2018%' AND T1.Population = ( SELECT MAX(T1.Population) FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.date LIKE '%2018%' )
Database: chicago_crime
Tables: Community_Area, District, FBI_Code, IUCR, Neighborhood, Ward, Crime
Columns (table index, column name): -1, *, 0, community_area_no, 0, community_area_name, 0, side, 0, population, 1, district_no, 1, district_name, 1, address, 1, zip_code, 1, commander, 1, email, 1, phone, 1, fax, 1, tty, 1, twitter, 2, fbi_code_no, 2, title, 2, description, 2, crime_against, 3, iucr_no, 3, primary_description, 3, secondary_description, 3, index_code, 4, neighborhood_name, 4, community_area_no, 5, ward_no, 5, alderman_first_name, 5, alderman_last_name, 5, alderman_name_suffix, 5, ward_office_address, 5, ward_office_zip, 5, ward_email, 5, ward_office_phone, 5, ward_office_fax, 5, city_hall_office_room, 5, city_hall_office_phone, 5, city_hall_office_fax, 5, Population, 6, report_no, 6, case_number, 6, date, 6, block, 6, iucr_no, 6, location_description, 6, arrest, 6, domestic, 6, beat, 6, district_no, 6, ward_no, 6, community_area_no, 6, fbi_code_no, 6, latitude, 6, longitude
Question: Among all the incidents with no arrest made, what is the percentage of them having a generic description of "BATTERY" in the IUCR classification?
Evidence: incident with no arrest made refers to arrest = 'FALSE'; general description refers to primary_description; "BATTERY" is the primary_description; percentage = Divide (Count(iucr_no where primary_description = 'BATTERY'), Count(iucr_no)) * 100
SQL: SELECT CAST(SUM(CASE WHEN T1.primary_description = 'BATTERY' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*)FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T2.arrest = 'FALSE'
Database: food_inspection
Tables: businesses, inspections, violations
Columns (table index, column name): -1, *, 0, business_id, 0, name, 0, address, 0, city, 0, postal_code, 0, latitude, 0, longitude, 0, phone_number, 0, tax_code, 0, business_certificate, 0, application_date, 0, owner_name, 0, owner_address, 0, owner_city, 0, owner_state, 0, owner_zip, 1, business_id, 1, score, 1, date, 1, type, 2, business_id, 2, date, 2, violation_type_id, 2, risk_category, 2, description
Question: How many restaurants' owners are in California?
Evidence: restaurants' owners in California refer to owner_state = 'CA';
SQL: SELECT COUNT(owner_state) FROM businesses WHERE owner_state = 'CA'
Database: food_inspection
Tables: businesses, inspections, violations
Columns (table index, column name): -1, *, 0, business_id, 0, name, 0, address, 0, city, 0, postal_code, 0, latitude, 0, longitude, 0, phone_number, 0, tax_code, 0, business_certificate, 0, application_date, 0, owner_name, 0, owner_address, 0, owner_city, 0, owner_state, 0, owner_zip, 1, business_id, 1, score, 1, date, 1, type, 2, business_id, 2, date, 2, violation_type_id, 2, risk_category, 2, description
Question: How many restaurants have met all requirements in the inspection?
Evidence: met all requirements in the inspection refers to score = 100;
SQL: SELECT COUNT(score) FROM inspections WHERE score = 100
Database: food_inspection
Tables: businesses, inspections, violations
Columns (table index, column name): -1, *, 0, business_id, 0, name, 0, address, 0, city, 0, postal_code, 0, latitude, 0, longitude, 0, phone_number, 0, tax_code, 0, business_certificate, 0, application_date, 0, owner_name, 0, owner_address, 0, owner_city, 0, owner_state, 0, owner_zip, 1, business_id, 1, score, 1, date, 1, type, 2, business_id, 2, date, 2, violation_type_id, 2, risk_category, 2, description
Question: Among the inspections carried out in 2016, how many of them are routine?
Evidence: inspections carried out in 2016 refer to YEAR(date) = 2016; routine inspections refer to type = 'Routine - Unscheduled';
SQL: SELECT COUNT(`date`) FROM inspections WHERE STRFTIME('%Y', `date`) = '2016' AND type = 'Routine - Unscheduled'
Database: food_inspection
Tables: businesses, inspections, violations
Columns (table index, column name): -1, *, 0, business_id, 0, name, 0, address, 0, city, 0, postal_code, 0, latitude, 0, longitude, 0, phone_number, 0, tax_code, 0, business_certificate, 0, application_date, 0, owner_name, 0, owner_address, 0, owner_city, 0, owner_state, 0, owner_zip, 1, business_id, 1, score, 1, date, 1, type, 2, business_id, 2, date, 2, violation_type_id, 2, risk_category, 2, description
Question: Please list the names of all the restaurants that have met all requirements in one inspection.
Evidence: met all requirements refers to inspections where score = 100;
SQL: SELECT DISTINCT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score = 100
Database: food_inspection
Tables: businesses, inspections, violations
Columns (table index, column name): -1, *, 0, business_id, 0, name, 0, address, 0, city, 0, postal_code, 0, latitude, 0, longitude, 0, phone_number, 0, tax_code, 0, business_certificate, 0, application_date, 0, owner_name, 0, owner_address, 0, owner_city, 0, owner_state, 0, owner_zip, 1, business_id, 1, score, 1, date, 1, type, 2, business_id, 2, date, 2, violation_type_id, 2, risk_category, 2, description
Question: Among the restaurants being inspected in 2016, how many of them are in San Francisco?
Evidence: inspected in 2016 refers to YEAR(date) = 2016; San Francisco refers to city in ('San Francisco', 'SF' ,'S.F.', 'SAN FRANCISCO');
SQL: SELECT COUNT(DISTINCT T2.business_id) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) = '2016' AND T2.city IN ('San Francisco', 'SAN FRANCISCO', 'SF', 'S.F.')
Database: food_inspection
Tables: businesses, inspections, violations
Columns (table index, column name): -1, *, 0, business_id, 0, name, 0, address, 0, city, 0, postal_code, 0, latitude, 0, longitude, 0, phone_number, 0, tax_code, 0, business_certificate, 0, application_date, 0, owner_name, 0, owner_address, 0, owner_city, 0, owner_state, 0, owner_zip, 1, business_id, 1, score, 1, date, 1, type, 2, business_id, 2, date, 2, violation_type_id, 2, risk_category, 2, description
Question: What was the type of inspection Tiramisu Kitchen had on 2014/1/14?
Evidence: Tiramisu Kitchen is the name of the business; inspection on 2014/1/14 refers to date = '2014-01-14';
SQL: SELECT T1.type FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.`date` = '2014-01-14' AND T2.name = 'Tiramisu Kitchen'
Database: food_inspection
Tables: businesses, inspections, violations
Columns (table index, column name): -1, *, 0, business_id, 0, name, 0, address, 0, city, 0, postal_code, 0, latitude, 0, longitude, 0, phone_number, 0, tax_code, 0, business_certificate, 0, application_date, 0, owner_name, 0, owner_address, 0, owner_city, 0, owner_state, 0, owner_zip, 1, business_id, 1, score, 1, date, 1, type, 2, business_id, 2, date, 2, violation_type_id, 2, risk_category, 2, description
Question: How many low risk violations were found in the inspection on 2014/1/14 for Tiramisu Kitchen?
Evidence: Tiramisu Kitchen is the name of the business; inspection on 2014/1/14 refers to date = '2014-01-14'; low risk violations refer to risk_category = 'Low Risk';
SQL: SELECT COUNT(T1.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.`date` = '2014-01-14' AND T2.name = 'Tiramisu Kitchen' AND T1.risk_category = 'Low Risk'
Database: food_inspection
Tables: businesses, inspections, violations
Columns (table index, column name): -1, *, 0, business_id, 0, name, 0, address, 0, city, 0, postal_code, 0, latitude, 0, longitude, 0, phone_number, 0, tax_code, 0, business_certificate, 0, application_date, 0, owner_name, 0, owner_address, 0, owner_city, 0, owner_state, 0, owner_zip, 1, business_id, 1, score, 1, date, 1, type, 2, business_id, 2, date, 2, violation_type_id, 2, risk_category, 2, description
Question: Please list the names of the restaurants that had a low risk violation in inspections in 2014.
Evidence: inspection in 2014 refers to year(date) = 2014; low risk violations refer to risk_category = 'Low Risk';
SQL: SELECT DISTINCT T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) = '2014' AND T1.risk_category = 'Low Risk'
Database: food_inspection
Tables: businesses, inspections, violations
Columns (table index, column name): -1, *, 0, business_id, 0, name, 0, address, 0, city, 0, postal_code, 0, latitude, 0, longitude, 0, phone_number, 0, tax_code, 0, business_certificate, 0, application_date, 0, owner_name, 0, owner_address, 0, owner_city, 0, owner_state, 0, owner_zip, 1, business_id, 1, score, 1, date, 1, type, 2, business_id, 2, date, 2, violation_type_id, 2, risk_category, 2, description
Question: What is the description of the low risk violation of Tiramisu Kitchen on 2014/1/14?
Evidence: Tiramisu Kitchen is the name of the business; 2014/1/14 refers to date = '2014-01-14'; low risk violations refer to risk_category = 'Low Risk';
SQL: SELECT T1.description FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.`date` = '2014-01-14' AND T2.name = 'Tiramisu Kitchen' AND T1.risk_category = 'Low Risk'
Database: food_inspection
Tables: businesses, inspections, violations
Columns (table index, column name): -1, *, 0, business_id, 0, name, 0, address, 0, city, 0, postal_code, 0, latitude, 0, longitude, 0, phone_number, 0, tax_code, 0, business_certificate, 0, application_date, 0, owner_name, 0, owner_address, 0, owner_city, 0, owner_state, 0, owner_zip, 1, business_id, 1, score, 1, date, 1, type, 2, business_id, 2, date, 2, violation_type_id, 2, risk_category, 2, description
Question: Please list the descriptions of all the high risk violations of Tiramisu Kitchen.
Evidence: Tiramisu Kitchen is the name of the business; high risk violations refer to risk_category = 'High Risk';
SQL: SELECT DISTINCT T1.description FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' AND T2.name = 'Tiramisu Kitchen'
Database: food_inspection
Tables: businesses, inspections, violations
Columns (table index, column name): -1, *, 0, business_id, 0, name, 0, address, 0, city, 0, postal_code, 0, latitude, 0, longitude, 0, phone_number, 0, tax_code, 0, business_certificate, 0, application_date, 0, owner_name, 0, owner_address, 0, owner_city, 0, owner_state, 0, owner_zip, 1, business_id, 1, score, 1, date, 1, type, 2, business_id, 2, date, 2, violation_type_id, 2, risk_category, 2, description
Question: How many routine inspections did Tiramisu Kitchen have?
Evidence: Tiramisu Kitchen is the name of the business; routine inspections refer to type = 'Routine - Unscheduled';
SQL: SELECT COUNT(T1.business_id) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.type = 'Routine - Unscheduled' AND T2.name = 'Tiramisu Kitchen'
Database: food_inspection
Tables: businesses, inspections, violations
Columns (table index, column name): -1, *, 0, business_id, 0, name, 0, address, 0, city, 0, postal_code, 0, latitude, 0, longitude, 0, phone_number, 0, tax_code, 0, business_certificate, 0, application_date, 0, owner_name, 0, owner_address, 0, owner_city, 0, owner_state, 0, owner_zip, 1, business_id, 1, score, 1, date, 1, type, 2, business_id, 2, date, 2, violation_type_id, 2, risk_category, 2, description
Question: Among the routine inspections of Tiramisu Kitchen, how many of them have a score of over 70?
Evidence: Tiramisu Kitchen is the name of the business; routine inspections refer to type = 'Routine - Unscheduled'; score of over 70 refers to score > 70;
SQL: SELECT COUNT(T2.business_id) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Tiramisu Kitchen' AND T1.type = 'Routine - Unscheduled' AND T1.score > 70
Database: food_inspection
Tables: businesses, inspections, violations
Columns (table index, column name): -1, *, 0, business_id, 0, name, 0, address, 0, city, 0, postal_code, 0, latitude, 0, longitude, 0, phone_number, 0, tax_code, 0, business_certificate, 0, application_date, 0, owner_name, 0, owner_address, 0, owner_city, 0, owner_state, 0, owner_zip, 1, business_id, 1, score, 1, date, 1, type, 2, business_id, 2, date, 2, violation_type_id, 2, risk_category, 2, description
Question: Which restaurant had more low risk violation in inspections, Tiramisu Kitchen or OMNI S.F. Hotel - 2nd Floor Pantry?
Evidence: Tiramisu Kitchen and OMNI S.F. Hotel - 2nd Floor Pantry are names of the business; more low risk violations refer to MAX(COUNT(risk_category = 'Low Risk'));
SQL: SELECT CASE WHEN SUM(CASE WHEN T2.name = 'OMNI S.F. Hotel - 2nd Floor Pantry' THEN 1 ELSE 0 END) > SUM(CASE WHEN T2.name = 'Tiramisu Kitchen' THEN 1 ELSE 0 END) THEN 'OMNI S.F. Hotel - 2nd Floor Pantry' ELSE 'Tiramisu Kitchen' END AS result FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'Low Risk'
Database: food_inspection
Tables: businesses, inspections, violations
Columns (table index, column name): -1, *, 0, business_id, 0, name, 0, address, 0, city, 0, postal_code, 0, latitude, 0, longitude, 0, phone_number, 0, tax_code, 0, business_certificate, 0, application_date, 0, owner_name, 0, owner_address, 0, owner_city, 0, owner_state, 0, owner_zip, 1, business_id, 1, score, 1, date, 1, type, 2, business_id, 2, date, 2, violation_type_id, 2, risk_category, 2, description
Question: How many high risk violations do the restaurants in San Francisco have in total?
Evidence: restaurants in San Francisco refer to business_id where city in ('San Francisco', 'SF', 'S.F.', 'SAN FRANCISCO'); high risk violations refer to risk_category = 'High Risk';
SQL: SELECT COUNT(T2.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.city IN ('San Francisco', 'SF', 'S.F.', 'SAN FRANCISCO') AND T1.risk_category = 'High Risk'
Database: food_inspection
Tables: businesses, inspections, violations
Columns (table index, column name): -1, *, 0, business_id, 0, name, 0, address, 0, city, 0, postal_code, 0, latitude, 0, longitude, 0, phone_number, 0, tax_code, 0, business_certificate, 0, application_date, 0, owner_name, 0, owner_address, 0, owner_city, 0, owner_state, 0, owner_zip, 1, business_id, 1, score, 1, date, 1, type, 2, business_id, 2, date, 2, violation_type_id, 2, risk_category, 2, description
Question: Which restaurant has the highest total number of high risk violations?
Evidence: the highest total number of high risk violations refer to MAX(COUNT(risk_category = 'High Risk'));
SQL: SELECT T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' GROUP BY T2.name ORDER BY COUNT(T2.name) DESC LIMIT 1
Database: food_inspection
Tables: businesses, inspections, violations
Columns (table index, column name): -1, *, 0, business_id, 0, name, 0, address, 0, city, 0, postal_code, 0, latitude, 0, longitude, 0, phone_number, 0, tax_code, 0, business_certificate, 0, application_date, 0, owner_name, 0, owner_address, 0, owner_city, 0, owner_state, 0, owner_zip, 1, business_id, 1, score, 1, date, 1, type, 2, business_id, 2, date, 2, violation_type_id, 2, risk_category, 2, description
Question: What is the average scores of Tiramisu Kitchen in all inspections?
Evidence: avg(score);
SQL: SELECT AVG(T1.score) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Tiramisu Kitchen'