1sf/bird-sql-train-with-schema huggingface dataset:
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 business had the most number of inspections? Give the Id number for that business.
Evidence: the most number of inspections refers to MAX(COUNT(business_id)); Id number for that business refers to business_id;
SQL: SELECT business_id FROM inspections GROUP BY business_id ORDER BY COUNT(business_id) 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: Tell the Id number of the business with the most number of violations.
Evidence: Id number for that business refers to business_id; the most number of violations refers to MAX(COUNT(business_id));
SQL: SELECT business_id FROM violations GROUP BY business_id ORDER BY COUNT(business_id) 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: Give the name of the business which met all the required standards during the unscheduled routine inspection on 2016/9/28.
Evidence: met all the required standards refers to score = 100; unscheduled routine inspection on 2016/9/28 refers to type = 'Routine - Unscheduled' where date = '2016-09-28';
SQL: SELECT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score = 100 AND T1.`date` = '2016-09-28' AND T1.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: Which business had the most number of high risk violations? Give the name of the business.
Evidence: the most number of high risk violations refers to MAX(COUNT(business_id)) where risk_category = 'High';
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: How many kinds of violations did "Stacks Restaurant" have on 2016/10/4?
Evidence: "Stacks Restaurant" is the name of the business; date = '2016-10-04';
SQL: SELECT COUNT(DISTINCT T1.violation_type_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Stacks Restaurant' AND T1.`date` = '2016-10-04'
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: Give the description of the moderate risk violation which "Chez Fayala, Inc." had on 2016/7/1.
Evidence: "Chez Fayala, Inc." is the name of the business; moderate risk violation refers to risk_category = 'Moderate Risk'; date = '2016-07-01';
SQL: SELECT T1.description FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Chez Fayala, Inc.' AND T1.`date` = '2016-07-01' AND T1.risk_category = 'Moderate 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 business had the lowest score for the unscheduled routine inspection on 2016/9/26? Give the name of the business.
Evidence: the lowest score for unscheduled routine inspection refers to type = 'Routine - Unscheduled' where MIN(score); date = '2016-09-26';
SQL: SELECT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE score = ( SELECT MIN(score) FROM inspections WHERE `date` = '2016-09-26' AND type = 'Routine - Unscheduled' ) AND T1.`date` = '2016-09-26' AND T1.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: Provide the name of the business which had the most number of inspections because of complaint.
Evidence: the most number of inspections because of complaint refers to type = 'Complaint' where MAX(business_id);
SQL: SELECT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.type = 'Complaint' GROUP BY T2.name ORDER BY COUNT(T1.business_id) 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: How many unscheduled routine inspections did "Soma Restaurant And Bar" have?
Evidence: "Soma Restaurant And Bar" is the name of the business; unscheduled 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 T2.name = 'Soma Restaurant And Bar' AND T1.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: Give the address of the business with the most number of the low risk violations.
Evidence: the most number of the low risk violations refers to MAX(COUNT(business_id)) where risk_category = 'Low Risk' ;
SQL: SELECT T2.address FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'Low Risk' GROUP BY T2.address ORDER BY COUNT(T1.business_id) 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: Which business was the first one to get a low risk violation because of "Permit license or inspection report not posted"? Give the name of the business.
Evidence: low risk violation because of "Permit license or inspection report not posted" refers to risk_category = 'Low Risk' where description = 'Permit license or inspection report not posted'; business was the first one refers to name where MIN(date);
SQL: SELECT T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.`date` = ( SELECT MIN(`date`) FROM violations WHERE risk_category = 'Low Risk' AND description = 'Permit license or inspection report not posted' ) AND T1.risk_category = 'Low Risk' AND T1.description = 'Permit license or inspection report not posted'
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: For the business which got the most number of violations, how many inspections did it have?
SQL: SELECT COUNT(T2.business_id) FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id GROUP BY T1.business_id ORDER BY COUNT(T1.business_id) 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: For the business whose business certificate number is 304977, how many violations did it have on 2013/10/7?
Evidence: date = '2013-10-07';
SQL: SELECT COUNT(T1.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.business_certificate = '304977' AND T1.`date` = '2013-10-07'
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 score for "Chairman Bao" in all its unscheduled routine inspections?
Evidence: DIVIDE(SUM(score where type = 'Routine - Unscheduled' and name = 'Chairman Bao'), COUNT(type = 'Routine - Unscheduled' where name = 'Chairman Bao'));
SQL: SELECT CAST(SUM(CASE WHEN T2.name = 'Chairman Bao' THEN T1.score ELSE 0 END) AS REAL) / COUNT(CASE WHEN T1.type = 'Routine - Unscheduled' THEN T1.score ELSE 0 END) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id
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 percentage of the violations for "Melody Lounge" are moderate risks?
Evidence: DIVIDE(COUNT(risk_category = 'Moderate Risk' where name = 'Melody Lounge'), COUNT(business_id where name = 'Melody Lounge')) as percentage;
SQL: SELECT CAST(SUM(CASE WHEN T2.risk_category = 'Moderate Risk' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.business_id) FROM businesses AS T1 INNER JOIN violations AS T2 ON T1.business_id = T2.business_id WHERE T1.name = 'Melody Lounge'
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 eateries are located in Hayward?
Evidence: eateries in Hayward refer city = 'HAYWARD';
SQL: SELECT COUNT(business_id) FROM businesses WHERE city = 'HAYWARD'
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 establishments have an inspection score of no more than 50?
Evidence: establishments have the same meaning as businesses; inspection score of no more than 50 refers to score < 50;
SQL: SELECT COUNT(DISTINCT business_id) FROM inspections WHERE score < 50
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 eateries applied in 2012?
Evidence: eateries applied in 2012 refer to business_id where application_date between '2012-01-01' and '2012-12-31';
SQL: SELECT COUNT(business_id) FROM businesses WHERE STRFTIME('%Y', application_date) = '2012'
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 foodborne illness investigations were done in 2014?
Evidence: foodborne illness investigations refer to inspections where type = 'Foodborne Illness Investigation'; investigations in 2014 refers to date between '2014-01-01' and '2014-12-31';
SQL: SELECT COUNT(business_id) FROM inspections WHERE STRFTIME('%Y', `date`) = '2014' AND type = 'Foodborne Illness Investigation'
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 owners have 5 or more establishments?
Evidence: 5 or more establishments COUNT(business_id) > = 5;
SQL: SELECT COUNT(T1.owner_name) FROM ( SELECT owner_name FROM businesses GROUP BY owner_name HAVING COUNT(owner_name) > 5 ) T1
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 are the names of the establishments that met all of the required standards in 2013?
Evidence: establishments have the same meaning as businesses; met all of the required standards refers to score = 100; year(date) = 2013
SQL: SELECT DISTINCT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) = '2013' AND 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: In 2016, which city has the highest number of establishments with the highest health and safety hazards?
Evidence: the highest health and safety hazards refer to risk_category = 'High Risk'; year(date) = 2016; establishments has the same meaning as businesses;
SQL: SELECT T2.city FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) = '2016' AND T1.risk_category = 'High Risk' GROUP BY T2.city ORDER BY COUNT(T2.city) 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 name of the establishment with the lowest inspection score of all time?
Evidence: the lowest inspection score refers to MIN(score);
SQL: SELECT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score = ( SELECT MIN(score) FROM inspections )
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 risks violations did the Tiramisu Kitchen violate?
Evidence: Tiramisu Kitchen is the name of the business; high risks violations refer to risk_category = 'High Risk';
SQL: SELECT COUNT(T1.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Tiramisu Kitchen' 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: How many establishments with the tax code H24 have complaint inspections of 5 or more?
Evidence: establishments with the tax code H24 refer to business_id where tax_code = 'H24'; complaint inspections of 5 or more refer to inspections where type = 'Complaint' and COUNT(business_id) ≥ 5;
SQL: SELECT COUNT(*) FROM ( SELECT T1.business_id FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.tax_code = 'H24' AND T1.type = 'Complaint' GROUP BY T1.business_id HAVING COUNT(T1.business_id) > 5 ) T3
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: In 2013, what are the names of the establishments with contaminated or adulterated food?
Evidence: establishments have the same meaning as businesses; contaminated or adulterated food refers to violations where description = 'Contaminated or adulterated food'; date = '2013';
SQL: SELECT T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) = '2013' AND T1.description = 'Contaminated or adulterated food'
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 establishments with a postal code of 94102, how many establishments have a score of 90 or more in 2015?
Evidence: establishment has the same meaning as business; score of 90 or more refers to score ≥ 90; year(date) = 2015;
SQL: SELECT COUNT(DISTINCT T2.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id INNER JOIN inspections AS T3 ON T2.business_id = T3.business_id WHERE STRFTIME('%Y', T1.`date`) = '2015' AND T2.postal_code = '94102' AND T3.score > 90