input stringlengths 201 2.7k | output stringlengths 24 744 |
|---|---|
[INST] Here is a 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_addres... | SELECT COUNT(owner_state) FROM businesses WHERE owner_state = 'CA'; |
[INST] Here is a database schema:
inspections :
business_id [ INTEGER ] inspections.business_id = businesses.business_id
score [ INTEGER ]
date [ DATE ]
type [ TEXT ]
Please write me a SQL statement that answers the following question: How many restaurants have met all requirements in the inspection? [/INST] [/INST] | SELECT COUNT(score) FROM inspections WHERE score = 100; |
[INST] Here is a 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_addres... | SELECT DISTINCT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score = 100; |
[INST] Here is a 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_addres... | SELECT DISTINCT T1.description FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' AND T2.name = 'Tiramisu Kitchen'; |
[INST] Here is a 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_addres... | SELECT COUNT(T1.business_id) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.type = 'Routine - Unscheduled' AND T2.name = 'Tiramisu Kitchen'; |
[INST] Here is a 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_addres... | SELECT COUNT(T2.business_id) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Tiramisu Kitchen' AND T1.type = 'Routine - Unscheduled' AND T1.score > 70; |
[INST] Here is a 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_addres... | SELECT CASE WHEN SUM(CASE WHEN T2.name = 'OMNI S.F. Hotel - 2nd Floor Pantry' THEN 1 ELSE 0 END) > SUM(CASE WHEN T2.name = 'Tiramisu Kitchen' THEN 1 ELSE 0 END) THEN 'OMNI S.F. Hotel - 2nd Floor Pantry' ELSE 'Tiramisu Kitchen' END AS result FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.busine... |
[INST] Here is a 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_addres... | SELECT COUNT(T2.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.city IN ('San Francisco', 'SF', 'S.F.', 'SAN FRANCISCO') AND T1.risk_category = 'High Risk'; |
[INST] Here is a 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_addres... | SELECT T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' GROUP BY T2.name ORDER BY COUNT(T2.name) DESC LIMIT 1; |
[INST] Here is a 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_addres... | SELECT AVG(T1.score) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Tiramisu Kitchen'; |
[INST] Here is a database schema:
inspections :
business_id [ INTEGER ] inspections.business_id = businesses.business_id
score [ INTEGER ]
date [ DATE ]
type [ TEXT ]
Please write me a SQL statement that answers the following question: Which business had the most number of inspections? Give the Id number for that busi... | SELECT business_id FROM inspections GROUP BY business_id ORDER BY COUNT(business_id) DESC LIMIT 1; |
[INST] Here is a database schema:
violations :
business_id [ INTEGER ] violations.business_id = businesses.business_id
date [ DATE ]
violation_type_id [ TEXT ]
risk_category [ TEXT ]
description [ TEXT ]
Please write me a SQL statement that answers the following question: Tell the Id number of the business with the mo... | SELECT business_id FROM violations GROUP BY business_id ORDER BY COUNT(business_id) DESC LIMIT 1; |
[INST] Here is a 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_addres... | SELECT T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' GROUP BY T2.name ORDER BY COUNT(T2.name) DESC LIMIT 1; |
[INST] Here is a 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_addres... | SELECT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.type = 'Complaint' GROUP BY T2.name ORDER BY COUNT(T1.business_id) DESC LIMIT 1; |
[INST] Here is a 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_addres... | SELECT COUNT(T1.business_id) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Soma Restaurant And Bar' AND T1.type = 'Routine - Unscheduled'; |
[INST] Here is a 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_addres... | SELECT T2.address FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'Low Risk' GROUP BY T2.address ORDER BY COUNT(T1.business_id) DESC LIMIT 1; |
[INST] Here is a database schema:
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 ]
desc... | 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; |
[INST] Here is a 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_addres... | 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; |
[INST] Here is a 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_addres... | 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'; |
[INST] Here is a 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_addres... | SELECT COUNT(business_id) FROM businesses WHERE city = 'HAYWARD'; |
[INST] Here is a database schema:
inspections :
business_id [ INTEGER ] inspections.business_id = businesses.business_id
score [ INTEGER ]
date [ DATE ]
type [ TEXT ]
Please write me a SQL statement that answers the following question: How many establishments have an inspection score of no more than 50? [/INST] [/INST... | SELECT COUNT(DISTINCT business_id) FROM inspections WHERE score < 50; |
[INST] Here is a 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_addres... | SELECT COUNT(business_id) FROM businesses WHERE STRFTIME('%Y', application_date) = '2012'; |
[INST] Here is a 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_addres... | SELECT COUNT(T1.owner_name) FROM ( SELECT owner_name FROM businesses GROUP BY owner_name HAVING COUNT(owner_name) > 5 ) T1; |
[INST] Here is a 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_addres... | 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 ); |
[INST] Here is a 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_addres... | 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'; |
[INST] Here is a 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_addres... | 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; |
[INST] Here is a 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_addres... | 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; |
[INST] Here is a 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_addres... | 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 = T... |
[INST] Here is a 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_addres... | 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; |
[INST] Here is a database schema:
violations :
business_id [ INTEGER ] violations.business_id = businesses.business_id
date [ DATE ]
violation_type_id [ TEXT ]
risk_category [ TEXT ]
description [ TEXT ]
Please write me a SQL statement that answers the following question: How many eateries had low risk for violation w... | SELECT COUNT(DISTINCT business_id) FROM violations WHERE risk_category = 'Low Risk' AND description = 'Unpermitted food facility'; |
[INST] Here is a database schema:
violations :
business_id [ INTEGER ] violations.business_id = businesses.business_id
date [ DATE ]
violation_type_id [ TEXT ]
risk_category [ TEXT ]
description [ TEXT ]
Please write me a SQL statement that answers the following question: Provide eateries' IDs, risk categories and des... | SELECT business_id, risk_category, description FROM violations WHERE violation_type_id = '103101'; |
[INST] Here is a 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_addres... | 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'; |
[INST] Here is a 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_addres... | 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'; |
[INST] Here is a 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_addres... | 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'; |
[INST] Here is a 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_addres... | 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'; |
[INST] Here is a 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_addres... | 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; |
[INST] Here is a 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_addres... | 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'; |
[INST] Here is a 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_addres... | 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; |
[INST] Here is a 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_addres... | SELECT COUNT(business_id) FROM businesses WHERE address = '1825 POST St #223' AND city = 'SAN FRANCISCO'; |
[INST] Here is a 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_addres... | SELECT DISTINCT owner_name FROM businesses WHERE owner_zip = '94104'; |
[INST] Here is a 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_addres... | SELECT COUNT(tax_code) FROM businesses WHERE tax_code = 'H25'; |
[INST] Here is a 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_addres... | 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.'; |
[INST] Here is a 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_addres... | 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; |
[INST] Here is a 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_addres... | 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'; |
[INST] Here is a 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_addres... | 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; |
[INST] Here is a 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_addres... | 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'; |
[INST] Here is a 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_addres... | 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'; |
[INST] Here is a 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_addres... | 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; |
[INST] Here is a 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_addres... | 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'; |
[INST] Here is a 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_addres... | 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; |
[INST] Here is a 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_addres... | 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 ); |
[INST] Here is a 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_addres... | 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; |
[INST] Here is a 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 ]
Please write me a SQL statement that answers the following question: Which... | 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 ); |
[INST] Here is a 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 ]
Please write me a SQL statement that answers the following question: Where... | 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; |
[INST] Here is a 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 ]
Please write me a SQL statement that answers the following question: What ... | 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; |
[INST] Here is a 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 ]
Please write me a SQL statement that answers the following question: Of al... | 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'; |
[INST] Here is a 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 ]
Please write me a SQL statement that answers the following question: Which... | 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; |
[INST] Here is a 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 ]
Please write me a SQL statement that answers the following question: When ... | 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'; |
[INST] Here is a database schema:
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... | 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; |
[INST] Here is a database schema:
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... | 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'; |
[INST] Here is a database schema:
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... | SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.sodium < 5; |
[INST] Here is a database schema:
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... | SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.iron > 20; |
[INST] Here is a database schema:
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... | 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... |
[INST] Here is a database schema:
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... | 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; |
[INST] Here is a database schema:
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... | 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'; |
[INST] Here is a 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 ... | 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'; |
[INST] Here is a database schema:
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 ]
Quantity :
quantity_id [ INTEGER ] primary_key
recipe_i... | 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; |
[INST] Here is a 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 ... | 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; |
[INST] Here is a database schema:
Ingredient :
ingredient_id [ INTEGER ] primary_key
category [ TEXT ]
name [ TEXT ]
plural [ TEXT ]
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_... | SELECT COUNT(*) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T1.name = 'graham cracker crumbs'; |
[INST] Here is a 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 ... | 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'; |
[INST] Here is a database schema:
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... | 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'; |
[INST] Here is a database schema:
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... | 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'; |
[INST] Here is a database schema:
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... | 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'; |
[INST] Here is a database schema:
Ingredient :
ingredient_id [ INTEGER ] primary_key
category [ TEXT ]
name [ TEXT ]
plural [ TEXT ]
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_... | 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; |
[INST] Here is a database schema:
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... | 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; |
[INST] Here is a database schema:
Ingredient :
ingredient_id [ INTEGER ] primary_key
category [ TEXT ]
name [ TEXT ]
plural [ TEXT ]
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_... | SELECT COUNT(*) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T1.name = 'seedless red grapes'; |
[INST] Here is a database schema:
Ingredient :
ingredient_id [ INTEGER ] primary_key
category [ TEXT ]
name [ TEXT ]
plural [ TEXT ]
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_... | 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'; |
[INST] Here is a 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 ... | 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; |
[INST] Here is a database schema:
Ingredient :
ingredient_id [ INTEGER ] primary_key
category [ TEXT ]
name [ TEXT ]
plural [ TEXT ]
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_... | 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; |
[INST] Here is a 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 ... | 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'; |
[INST] Here is a 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 ... | 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)'; |
[INST] Here is a database schema:
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... | 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; |
[INST] Here is a database schema:
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... | 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'; |
[INST] Here is a database schema:
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 ]
Quantity :
quantity_id [ INTEGER ] primary_key
recipe_i... | 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; |
[INST] Here is a database schema:
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... | 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; |
[INST] Here is a database schema:
Ingredient :
ingredient_id [ INTEGER ] primary_key
category [ TEXT ]
name [ TEXT ]
plural [ 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 ... | 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'; |
[INST] Here is a database schema:
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... | SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.iron > 20; |
[INST] Here is a database schema:
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 ]
Quantity :
quantity_id [ INTEGER ] primary_key
recipe_i... | SELECT COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Apricot Yogurt Parfaits'; |
[INST] Here is a database schema:
Ingredient :
ingredient_id [ INTEGER ] primary_key
category [ TEXT ]
name [ TEXT ]
plural [ TEXT ]
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_... | 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'; |
[INST] Here is a database schema:
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 ... | SELECT COUNT(*) FROM Nutrition AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.vitamin_a > 0; |
[INST] Here is a database schema:
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... | 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; |
[INST] Here is a database schema:
Ingredient :
ingredient_id [ INTEGER ] primary_key
category [ TEXT ]
name [ TEXT ]
plural [ TEXT ]
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_... | 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; |
[INST] Here is a 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 ... | 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'; |
[INST] Here is a 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 ... | 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'; |
[INST] Here is a 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 ... | 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'; |
[INST] Here is a database schema:
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... | 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; |
[INST] Here is a database schema:
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... | SELECT COUNT(T1.title) FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id ORDER BY T2.total_fat - T2.sat_fat DESC LIMIT 1; |
[INST] Here is a database schema:
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... | SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.source = 'National Potato Board' ORDER BY T2.calories DESC LIMIT 1; |
[INST] Here is a database schema:
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 ]
Quantity :
quantity_id [ INTEGER ] primary_key
recipe_i... | SELECT T2.recipe_id, T1.prep_min + T1.cook_min + T1.stnd_min FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id GROUP BY T2.recipe_id ORDER BY COUNT(T2.ingredient_id) DESC LIMIT 1; |
[INST] Here is a database schema:
Ingredient :
ingredient_id [ INTEGER ] primary_key
category [ TEXT ]
name [ TEXT ]
plural [ TEXT ]
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_... | SELECT T1.name, CAST(COUNT(T2.ingredient_id) AS FLOAT) * 100 / ( SELECT COUNT(T2.ingredient_id) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T2.ingredient_id = T1.ingredient_id ) AS "percentage" FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T2.ingredient_id = T1.ingredient_id GROUP BY T2.ingredient_id ORDER ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.