input
stringlengths
236
16.9k
output
stringlengths
19
805
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- For the business which got the most number of violations, how many inspections did it have?
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 schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- For the business whose business certificate number is 304977, how many violations did it have on 2013/10/7?
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 schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- What is the average score for "Chairman Bao" in all its unscheduled routine inspections?
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 schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- What percentage of the violations for "Melody Lounge" are moderate risks?
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 schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- How many eateries are located in Hayward?
SELECT COUNT(business_id) FROM businesses WHERE city = 'HAYWARD';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- How many establishments have an inspection score of no more than 50?
SELECT COUNT(DISTINCT business_id) FROM inspections WHERE score < 50;
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- How many eateries applied in 2012?
SELECT COUNT(business_id) FROM businesses WHERE STRFTIME('%Y', application_date) = '2012';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- How many foodborne illness investigations were done in 2014?
SELECT COUNT(business_id) FROM inspections WHERE STRFTIME('%Y', `date`) = '2014' AND type = 'Foodborne Illness Investigation';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- How many owners have 5 or more establishments?
SELECT COUNT(T1.owner_name) FROM ( SELECT owner_name FROM businesses GROUP BY owner_name HAVING COUNT(owner_name) > 5 ) T1;
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- What are the names of the establishments that met all of the required standards in 2013?
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 schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- In 2016, which city has the highest number of establishments with the highest health and safety hazards?
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 schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- What is the name of the establishment with the lowest inspection score of all time?
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 schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- How many high risks violations did the Tiramisu Kitchen violate?
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 schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- How many establishments with the tax code H24 have complaint inspections of 5 or more?
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 schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- In 2013, what are the names of the establishments with contaminated or adulterated food?
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 schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- Among the establishments with a postal code of 94102, how many establishments have a score of 90 or more in 2015?
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;
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- What are the names of the establishments that met all the required standards for 4 consecutive years?
SELECT DISTINCT T4.name FROM ( SELECT T3.name, T3.years, row_number() OVER (PARTITION BY T3.name ORDER BY T3.years) AS rowNumber FROM ( SELECT DISTINCT name, STRFTIME('%Y', `date`) AS years FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score = 100 ) AS T3 ) AS T4 GROUP BY T4.name, date(T4.years || '-01-01', '-' || (T4.rowNumber - 1) || ' years') HAVING COUNT(T4.years) = 4;
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- Between 2014 to 2016, what is the average inpsection score of the establishment owned by Yiu Tim Chan in 808 Pacific Ave, San Francisco?
SELECT AVG(T1.score) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) BETWEEN '2014' AND '2016' AND T2.owner_name = 'Yiu Tim Chan' AND T2.address = '808 Pacific Ave' AND T2.city = 'San Francisco';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- What is the average score of the establishments owned by the owner with the highest number of establishments?
SELECT AVG(T1.score) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id GROUP BY T2.owner_name ORDER BY COUNT(T2.business_id) DESC LIMIT 1;
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- What is the name of the establishment with the highest number of low risk violations in 2014?
SELECT 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' GROUP BY T2.name ORDER BY COUNT(T2.business_id) DESC LIMIT 1;
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- Among the top 5 owners with highest number of establishments, which owner has the highest number of high risk violations? Give the name of the owner.
SELECT T4.owner_name FROM violations AS T3 INNER JOIN businesses AS T4 ON T3.business_id = T4.business_id INNER JOIN ( SELECT T2.owner_name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id GROUP BY T2.owner_name ORDER BY COUNT(T1.business_id) DESC LIMIT 5 ) AS T5 ON T4.owner_name = T5.owner_name WHERE T3.risk_category = 'High Risk' GROUP BY T4.owner_name ORDER BY COUNT(T3.risk_category) DESC LIMIT 1;
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- Which establishment has the highest number of inspections done? Give the name of the establishment and calculate for its average score per inspection.
SELECT T2.name, AVG(T1.score) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id GROUP BY T2.name ORDER BY COUNT(T2.business_id) DESC LIMIT 1;
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- How many eateries got highest inspection in 2013?
SELECT COUNT(DISTINCT business_id) FROM inspections WHERE STRFTIME('%Y', `date`) = '2013' AND score = ( SELECT MAX(score) FROM inspections WHERE STRFTIME('%Y', `date`) = '2013' );
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- List down the eateries' IDs with structural inspection type in February 2016.
SELECT business_id FROM inspections WHERE type = 'Structural Inspection' AND `date` LIKE '2016-02%';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- How many eateries had low risk for violation with unpermitted food facility description?
SELECT COUNT(DISTINCT business_id) FROM violations WHERE risk_category = 'Low Risk' AND description = 'Unpermitted food facility';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- Provide eateries' IDs, risk categories and descriptions with violation ID of 103101.
SELECT business_id, risk_category, description FROM violations WHERE violation_type_id = '103101';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- When did eateries from San Bruno city get highest score in inspection?
SELECT T1.`date` FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.city = 'SAN BRUNO' ORDER BY T1.score DESC LIMIT 1;
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- Describe the inspection types and violation descriptions under moderate risk category for ART's CAFÉ.
SELECT DISTINCT T2.type, T1.description FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id INNER JOIN businesses AS T3 ON T2.business_id = T3.business_id WHERE T3.name = 'ART''S CAFÉ' AND T1.risk_category = 'Moderate Risk';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- Mention the violation type ID and description of high risk category for STARBUCKS.
SELECT DISTINCT T1.violation_type_id, T1.description FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'STARBUCKS' AND T1.risk_category = 'High Risk';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- List the inspection dates, scores and inspection types for the eateries with tax code AA.
SELECT T1.`date`, T1.score, T1.type FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.tax_code = 'AA';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- Provide eateries' IDs, names and addresses which were inspected on 30th July, 2016.
SELECT DISTINCT T2.business_id, T2.name, T2.address FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.date = '2016-07-30';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- Describe the violation dates, risk categories, descriptions and names of the eateries under Jade Chocolates LLC.
SELECT T1.`date`, T1.risk_category, T1.description, T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.owner_name = 'Jade Chocolates LLC';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- Provide the names, risk categories and descriptions for the eateries with violation type ID of 103111.
SELECT T2.name, T1.risk_category, T1.description FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.violation_type_id = '103111';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- Among violations on 3rd June, 2014, describe any 5 names, located cities and tax codes of the eateries with high risk category.
SELECT DISTINCT T2.name, T2.city, T2.tax_code FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' AND T1.`date` = '2014-06-03' LIMIT 5;
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- What was the inspection type when El Aji Peruvian Restaurant got highest inspection score?
SELECT T1.type FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'El Aji Peruvian Restaurant' ORDER BY T1.score DESC LIMIT 1;
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- Who were the owners of eateries which had highest health hazard by improper cooking time or temperatures?
SELECT T2.owner_name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' AND T1.description = 'Improper cooking time or temperatures';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- List the eateries' names and addresses which had reinspection on 2nd February, 2015.
SELECT T2.name, T2.address FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.`date` = '2015-02-02' AND T1.type = 'Reinspection/Followup';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- List the names and business certificates of the eateries which got inspection score under 50.
SELECT T2.name, T2.business_id FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score < 50;
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- How many of the businesses are located at 1825 POST St #223, San Francisco?
SELECT COUNT(business_id) FROM businesses WHERE address = '1825 POST St #223' AND city = 'SAN FRANCISCO';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- List down the owner's name with a zip code 94104.
SELECT DISTINCT owner_name FROM businesses WHERE owner_zip = '94104';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- What is the total number of businesses with a tax code H25?
SELECT COUNT(tax_code) FROM businesses WHERE tax_code = 'H25';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- In the violations in 2014, how many of them have a low risk category?
SELECT COUNT(risk_category) FROM violations WHERE STRFTIME('%Y', `date`) = '2014' AND risk_category = 'Low Risk';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- Give the business ID and risk category of the business owned by San Francisco Madeleine, Inc.
SELECT DISTINCT T2.business_id, T1.risk_category FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.owner_name = 'San Francisco Madeleine, Inc.';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- List owner's name of businesses with a 100 score.
SELECT DISTINCT T2.owner_name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score = 100;
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- Among the businesses within the postal code 94117, what is total number of businesses with a high risk category?
SELECT COUNT(DISTINCT T2.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.postal_code = 94117 AND T1.risk_category = 'High Risk';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- Among the businesses with score that ranges from 70 to 80, list their violation type ID and risk category.
SELECT DISTINCT T1.violation_type_id, T1.risk_category 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 T3.score BETWEEN 70 AND 80;
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- List the tax code and inspection type of the business named "Rue Lepic".
SELECT DISTINCT T3.tax_code, T2.type FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id INNER JOIN businesses AS T3 ON T2.business_id = T3.business_id WHERE T3.name = 'Rue Lepic';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- In businesses that violates 103157 on May 27, 2016 , what is the name of the business that has an unscheduled inspection?
SELECT DISTINCT T3.name FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id INNER JOIN businesses AS T3 ON T2.business_id = T3.business_id WHERE T1.`date` = '2016-05-27' AND T1.violation_type_id = 103157 AND T2.type = 'Routine - Unscheduled';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- Who is the owner of the business that has a high risk violation of 103109 and described as unclean or unsanitary food contact surfaces?
SELECT DISTINCT T2.owner_name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' AND T1.violation_type_id = 103109 AND T1.description = 'Unclean or unsanitary food contact surfaces';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- Among the owners from Cameron Park, what is the business name of the business with a score of 100?
SELECT DISTINCT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.owner_city = 'Cameron Park' AND T1.score = 100;
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- List the violation type ID of business with business ID from 30 to 50 and located at 747 IRVING St, San Francisco.
SELECT DISTINCT T1.violation_type_id FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.business_id BETWEEN 30 AND 50 AND T2.address = '747 IRVING St' AND T2.city = 'San Francisco';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- What is the owner's name of the of the business that violates 103156 on June 12, 2014?
SELECT DISTINCT T2.owner_name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.violation_type_id = 103156 AND T1.`date` = '2014-06-12';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- In businesses with an owner address 500 California St, 2nd Floor of Silicon Valley, list the type of inspection of the business with the highest score.
SELECT T1.type FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.owner_address = '500 California St, 2nd Floor' AND T2.owner_city = 'SAN FRANCISCO' ORDER BY T1.score DESC LIMIT 1;
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- Among the violations in 2016, how many of them have unscheduled inspections?
SELECT COUNT(T2.business_id) FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) = '2016' AND T2.type = 'Routine - Unscheduled';
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- List the business' name and risk category of businesses with a score greater than the 80% of average score of all businesses.
SELECT DISTINCT T1.name, T3.risk_category FROM businesses AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id INNER JOIN violations AS T3 ON T1.business_id = T3.business_id WHERE T2.score > 0.8 * ( SELECT AVG(score) FROM inspections );
-- Database schema | businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] | -- -- In businesses with a score lower than 95 and located around the postal code of 94110, what is the percentage of businesses with a risk category of low risk?
SELECT CAST(SUM(CASE WHEN T1.risk_category = 'Low Risk' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.risk_category) FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id INNER JOIN businesses AS T3 ON T2.business_id = T3.business_id WHERE T2.score < 95 AND T3.postal_code = 94110;
-- Database schema | breweries : id [ INTEGER ] primary_key , name [ TEXT ] , city [ TEXT ] , state [ TEXT ] | beers : id [ INTEGER ] primary_key , brewery_id [ INTEGER ] , abv [ REAL ] , ibu [ REAL ] , name [ TEXT ] , style [ TEXT ] , ounces [ REAL ] | -- -- Which distinct state makes beer that has the least amount of bitterness?
SELECT DISTINCT T2.state, T1.ibu FROM beers AS T1 INNER JOIN breweries AS T2 ON T1.brewery_id = T2.id WHERE T1.ibu IS NOT NULL AND T1.ibu = ( SELECT MIN(ibu) FROM beers );
-- Database schema | breweries : id [ INTEGER ] primary_key , name [ TEXT ] , city [ TEXT ] , state [ TEXT ] | beers : id [ INTEGER ] primary_key , brewery_id [ INTEGER ] , abv [ REAL ] , ibu [ REAL ] , name [ TEXT ] , style [ TEXT ] , ounces [ REAL ] | -- -- Where in New York can you locate the brewery that makes the bitterest beer? List both the brewery's name and the name of the city.
SELECT T2.name, T2.city FROM beers AS T1 INNER JOIN breweries AS T2 ON T1.brewery_id = T2.id WHERE T2.state = 'NY' ORDER BY T1.ibu DESC LIMIT 1;
-- Database schema | breweries : id [ INTEGER ] primary_key , name [ TEXT ] , city [ TEXT ] , state [ TEXT ] | beers : id [ INTEGER ] primary_key , brewery_id [ INTEGER ] , abv [ REAL ] , ibu [ REAL ] , name [ TEXT ] , style [ TEXT ] , ounces [ REAL ] | -- -- What is the average alcohol content per 12-ounce beer bottle produced by Boston Beer Company?
SELECT AVG(T1.abv) FROM beers AS T1 INNER JOIN breweries AS T2 ON T1.brewery_id = T2.id WHERE T2.name = 'Boston Beer Company' AND T1.ounces = 12;
-- Database schema | breweries : id [ INTEGER ] primary_key , name [ TEXT ] , city [ TEXT ] , state [ TEXT ] | beers : id [ INTEGER ] primary_key , brewery_id [ INTEGER ] , abv [ REAL ] , ibu [ REAL ] , name [ TEXT ] , style [ TEXT ] , ounces [ REAL ] | -- -- Of all the beer styles produced by Stevens Point Brewery, how many percent do they allot for American Adjunct Lager?
SELECT CAST(SUM(IIF(T1.style = 'American Adjunct Lager', 1, 0)) AS REAL) * 100 / COUNT(T1.brewery_id) FROM beers AS T1 INNER JOIN breweries AS T2 ON T1.brewery_id = T2.id WHERE T2.name = 'Stevens Point Brewery';
-- Database schema | breweries : id [ INTEGER ] primary_key , name [ TEXT ] , city [ TEXT ] , state [ TEXT ] | beers : id [ INTEGER ] primary_key , brewery_id [ INTEGER ] , abv [ REAL ] , ibu [ REAL ] , name [ TEXT ] , style [ TEXT ] , ounces [ REAL ] | -- -- Which city and state produces the most and least bitter beer, and what is the difference in bitterness between the two? List also the names of the beer.
SELECT T1.state, T1.city, T2.name, T2.ibu FROM breweries AS T1 INNER JOIN beers AS T2 ON T1.id = T2.brewery_id GROUP BY T1.state, T1.city, T2.name, T2.ibu HAVING MAX(ibu) AND MIN(ibu) LIMIT 2;
-- Database schema | breweries : id [ INTEGER ] primary_key , name [ TEXT ] , city [ TEXT ] , state [ TEXT ] | beers : id [ INTEGER ] primary_key , brewery_id [ INTEGER ] , abv [ REAL ] , ibu [ REAL ] , name [ TEXT ] , style [ TEXT ] , ounces [ REAL ] | -- -- When compared to the total number of breweries in the US producing American Blonde Ale, how many in the state of Wisconsin produces American Blonde Ale? Indicate your answer in percentage (%).
SELECT CAST(SUM(IIF(T2.state = 'WI', 1, 0)) AS REAL) * 100 / COUNT(T1.id) FROM beers AS T1 INNER JOIN breweries AS T2 ON T1.brewery_id = T2.id WHERE T1.style = 'American Blonde Ale';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- What is the title of the recipe that is most likely to gain weight?
SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id ORDER BY T2.total_fat DESC LIMIT 1;
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- What is the unsaturated fat content in the recipe "Raspberry Chiffon Pie"?
SELECT T2.total_fat - T2.sat_fat FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Raspberry Chiffon Pie';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- Please list the titles of all the recipes that are salt/sodium-free.
SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.sodium < 5;
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- Please list the titles of all the recipes that may lead to constipation, feeling sick or stomach pain.
SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.iron > 20;
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- Which recipe is more beneficial in wound healing, "Raspberry Chiffon Pie" or "Fresh Apricot Bavarian"?
SELECT DISTINCT CASE WHEN CASE WHEN T2.title = 'Raspberry Chiffon Pie' THEN T1.vitamin_c END > CASE WHEN T2.title = 'Fresh Apricot Bavarian' THEN T1.vitamin_c END THEN 'Raspberry Chiffon Pie' ELSE 'Fresh Apricot Bavarian' END AS "vitamin_c is higher" FROM Nutrition T1 INNER JOIN Recipe T2 ON T2.recipe_id = T1.recipe_id;
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- Among the recipes that take more than 10 minutes to prepare, what is the title of the one with the most calories?
SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.prep_min > 10 ORDER BY T2.calories DESC LIMIT 1;
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- How many calories does the recipe "Raspberry Chiffon Pie" contain?
SELECT T2.calories FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Raspberry Chiffon Pie';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- Is the ingredient "graham cracker crumbs" optional in the recipe "Raspberry Chiffon Pie"?
SELECT T2.optional FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Raspberry Chiffon Pie' AND T3.name = 'graham cracker crumbs';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- How many ingredients must be rationed in the recipe "Raspberry Chiffon Pie"?
SELECT COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Raspberry Chiffon Pie' AND T2.max_qty = T2.min_qty;
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- Please list the names of all the ingredients needed for the recipe "Raspberry Chiffon Pie" that do not need preprocessing.
SELECT T3.name FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Raspberry Chiffon Pie' AND T2.preparation IS NULL;
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- How many recipes include the ingredient "graham cracker crumbs"?
SELECT COUNT(*) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T1.name = 'graham cracker crumbs';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- At least how many cups of graham cracker crumbs does the recipe "Raspberry Chiffon Pie" need?
SELECT T2.min_qty FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Raspberry Chiffon Pie' AND T3.name = 'graham cracker crumbs';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- How many calories from fat are there in the recipe "Raspberry Chiffon Pie"?
SELECT T2.calories * T2.pcnt_cal_fat FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Raspberry Chiffon Pie';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- How many calories on average does a recipe that comes from "Produce for Better Health Foundation and 5 a Day" contain?
SELECT AVG(T2.calories) FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.source = 'Produce for Better Health Foundation and 5 a Day';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- How many calories does the turkey tenderloin bundles recipe have?
SELECT T2.calories FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Turkey Tenderloin Bundles';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- How many cups of 1% lowfat milk should be added to no.1436 recipe?
SELECT COUNT(*) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T1.name = '1% lowfat milk' AND T2.unit = 'cup(s)' AND T2.recipe_id = 1436;
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- Which recipe in the database contains the most total fat? Give its title.
SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id ORDER BY T2.total_fat DESC LIMIT 1;
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- How many times do seedless red grapes appear in the recipes?
SELECT COUNT(*) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T1.name = 'seedless red grapes';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- State the name of the optional ingredient of no.1397 recipe.
SELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T2.recipe_id = 1397 AND T2.optional = 'TRUE';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- Which recipe needs the most frozen raspberries in light syrup? State its title.
SELECT T1.title FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T3.name = 'frozen raspberries in light syrup' AND T2.max_qty = T2.min_qty;
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- Give the name of the most widely used ingredient.
SELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id GROUP BY T1.name ORDER BY COUNT(T1.name) DESC LIMIT 1;
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- What kind of preparation is needed for apple juice to make a raspberry-pear couscous cake?
SELECT T2.preparation FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Raspberry-Pear Couscous Cake' AND T3.name = 'apple juice';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- How many cups of almonds do you need for a chicken pocket sandwich?
SELECT COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Chicken Pocket Sandwich' AND T3.name = 'almonds' AND T2.unit = 'cup(s)';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- Name the recipe with the most Vitamin C.
SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id ORDER BY T2.vitamin_c DESC LIMIT 1;
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- How much Vitamin A is in Sherry beef?
SELECT T2.vitamin_a FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Sherried Beef';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- State the title of the recipe with most kinds of ingredients.
SELECT T1.title FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id GROUP BY T1.title ORDER BY COUNT(title) DESC LIMIT 1;
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- How many times is the sodium content in Lasagne-Spinach Spirals to Beef and Spinach Pita Pockets?
SELECT CAST(SUM(CASE WHEN T1.title = 'Lasagne-Spinach Spirals' THEN T2.sodium ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T1.title = 'Beef and Spinach Pita Pockets' THEN T2.sodium ELSE 0 END) FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id;
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- What is the average calorie count for all recipes using coarsely ground black pepper?
SELECT AVG(T3.calories) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T2.ingredient_id = T1.ingredient_id INNER JOIN Nutrition AS T3 ON T3.recipe_id = T2.recipe_id WHERE T1.name = 'coarsely ground black pepper';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- What are the names of the recipes that will cause stomach pain?
SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.iron > 20;
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- How many ingredients are there in Apricot Yogurt Parfaits?
SELECT COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Apricot Yogurt Parfaits';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- What are the names of the ingredients that need to be cook in beef broth?
SELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T2.preparation = 'cooked in beef broth';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- How many ingredients are there in the recipe that is best in helping your body's natural defence against illness and infection?
SELECT COUNT(*) FROM Nutrition AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.vitamin_a > 0;
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- What are the names of the top 5 recipes that are best for wound healing?
SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id ORDER BY T2.vitamin_c DESC LIMIT 5;
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- Which ingredient appeared the least in recipes?
SELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id GROUP BY T2.ingredient_id ORDER BY COUNT(T2.ingredient_id) ASC LIMIT 1;
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- How many baking product ingredients are there in the No-Bake Chocolate Cheesecake?
SELECT COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T3.category = 'baking products' AND T1.title = 'No-Bake Chocolate Cheesecake';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- List all the ingredients for Strawberry Sorbet.
SELECT T3.name FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Strawberry Sorbet';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- What are the optional ingredients for Warm Chinese Chicken Salad?
SELECT T3.name FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Warm Chinese Chicken Salad' AND T2.optional = 'TRUE';
-- Database schema | Ingredient : ingredient_id [ INTEGER ] primary_key , category [ TEXT ] , name [ TEXT ] , plural [ TEXT ] | Recipe : recipe_id [ INTEGER ] primary_key , title [ TEXT ] , subtitle [ TEXT ] , servings [ INTEGER ] , yield_unit [ TEXT ] , prep_min [ INTEGER ] , cook_min [ INTEGER ] , stnd_min [ INTEGER ] , source [ TEXT ] , intro [ TEXT ] , directions [ TEXT ] | Nutrition : recipe_id [ INTEGER ] primary_key Nutrition.recipe_id = Recipe.recipe_id , protein [ REAL ] , carbo [ REAL ] , alcohol [ REAL ] , total_fat [ REAL ] , sat_fat [ REAL ] , cholestrl [ REAL ] , sodium [ REAL ] , iron [ REAL ] , vitamin_c [ REAL ] , vitamin_a [ REAL ] , fiber [ REAL ] , pcnt_cal_carb [ REAL ] , pcnt_cal_fat [ REAL ] , pcnt_cal_prot [ REAL ] , calories [ REAL ] | Quantity : quantity_id [ INTEGER ] primary_key , recipe_id [ INTEGER ] Quantity.recipe_id = Recipe.recipe_id , ingredient_id [ INTEGER ] Quantity.ingredient_id = Ingredient.ingredient_id , max_qty [ REAL ] , min_qty [ REAL ] , unit [ TEXT ] , preparation [ TEXT ] , optional [ TEXT ] | -- -- Among the recipes with alcohol content over 10, which recipe takes the longest to prepare?
SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.alcohol > 10 ORDER BY T1.prep_min DESC LIMIT 1;