db_id
stringclasses
69 values
question
stringlengths
24
325
evidence
stringlengths
0
673
SQL
stringlengths
23
804
question_id
int64
0
9.43k
difficulty
stringclasses
1 value
food_inspection
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
8,800
food_inspection
For the business whose business certificate number is 304977, how many violations did it have on 2013/10/7?
date = '2013-10-07';
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'
8,801
food_inspection
What is the average score for "Chairman Bao" in all its unscheduled routine inspections?
DIVIDE(SUM(score where type = 'Routine - Unscheduled' and name = 'Chairman Bao'), COUNT(type = 'Routine - Unscheduled' where name = 'Chairman Bao'));
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
8,802
food_inspection
What percentage of the violations for "Melody Lounge" are moderate risks?
DIVIDE(COUNT(risk_category = 'Moderate Risk' where name = 'Melody Lounge'), COUNT(business_id where name = 'Melody Lounge')) as percentage;
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'
8,803
food_inspection
How many eateries are located in Hayward?
eateries in Hayward refer city = 'HAYWARD';
SELECT COUNT(business_id) FROM businesses WHERE city = 'HAYWARD'
8,804
food_inspection
How many establishments have an inspection score of no more than 50?
establishments have the same meaning as businesses; inspection score of no more than 50 refers to score < 50;
SELECT COUNT(DISTINCT business_id) FROM inspections WHERE score < 50
8,805
food_inspection
How many eateries applied in 2012?
eateries applied in 2012 refer to business_id where application_date between '2012-01-01' and '2012-12-31';
SELECT COUNT(business_id) FROM businesses WHERE STRFTIME('%Y', application_date) = '2012'
8,806
food_inspection
How many foodborne illness investigations were done in 2014?
foodborne illness investigations refer to inspections where type = 'Foodborne Illness Investigation'; investigations in 2014 refers to date between '2014-01-01' and '2014-12-31';
SELECT COUNT(business_id) FROM inspections WHERE STRFTIME('%Y', `date`) = '2014' AND type = 'Foodborne Illness Investigation'
8,807
food_inspection
How many owners have 5 or more establishments?
5 or more establishments COUNT(business_id) > = 5;
SELECT COUNT(T1.owner_name) FROM ( SELECT owner_name FROM businesses GROUP BY owner_name HAVING COUNT(owner_name) > 5 ) T1
8,808
food_inspection
What are the names of the establishments that met all of the required standards in 2013?
establishments have the same meaning as businesses; met all of the required standards refers to score = 100; year(date) = 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
8,809
food_inspection
In 2016, which city has the highest number of establishments with the highest health and safety hazards?
the highest health and safety hazards refer to risk_category = 'High Risk'; year(date) = 2016; establishments has the same meaning as businesses;
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
8,810
food_inspection
What is the name of the establishment with the lowest inspection score of all time?
the lowest inspection score refers to MIN(score);
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 )
8,811
food_inspection
How many high risks violations did the Tiramisu Kitchen violate?
Tiramisu Kitchen is the name of the business; high risks violations refer to risk_category = 'High Risk';
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'
8,812
food_inspection
How many establishments with the tax code H24 have complaint inspections of 5 or more?
establishments with the tax code H24 refer to business_id where tax_code = 'H24'; complaint inspections of 5 or more refer to inspections where type = 'Complaint' and COUNT(business_id) ≥ 5;
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
8,813
food_inspection
In 2013, what are the names of the establishments with contaminated or adulterated food?
establishments have the same meaning as businesses; contaminated or adulterated food refers to violations where description = 'Contaminated or adulterated food'; date = '2013';
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'
8,814
food_inspection
Among the establishments with a postal code of 94102, how many establishments have a score of 90 or more in 2015?
establishment has the same meaning as business; score of 90 or more refers to score ≥ 90; year(date) = 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
8,815
food_inspection
What are the names of the establishments that met all the required standards for 4 consecutive years?
establishment has the same meaning as business; score of 90 or more refers to score ≥ 90; year(date) = 2015; ; met all required standards for 4 consecutive years refers to COUNT(year(date)) = 4 where score = 100;
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
8,816
food_inspection
Between 2014 to 2016, what is the average inpsection score of the establishment owned by Yiu Tim Chan in 808 Pacific Ave, San Francisco?
average inspection score refers to avg(score); establishment owned by Yiu Tim Chan refers to business_id where owner_name = 'Yiu Tim Chan'; Between 2014 to 2016 refers to year(date) between 2014 and 2016; address = '808 Pacific Ave'; city = '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'
8,817
food_inspection
What is the average score of the establishments owned by the owner with the highest number of establishments?
average score refers avg(score); owner with the highest number of establishments refers to owner_name where MAX(COUNT(business_id));
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
8,818
food_inspection
What is the name of the establishment with the highest number of low risk violations in 2014?
establishment with the highest number of low risk violations refers to business_id where MAX(COUNT(risk_category = 'Low Risk')); year(date) = 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
8,819
food_inspection
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.
5 owners with highest number of establishments refer to owner_name where MAX(COUNT(business_id)) LIMIT 5; the highest number of high risk violations refers to MAX(COUNT(risk_category = 'High Risk'));
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
8,820
food_inspection
Which establishment has the highest number of inspections done? Give the name of the establishment and calculate for its average score per inspection.
establishment refers to business_id; the highest number of inspections refers to MAX(COUNT(business_id)); avg(score);
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
8,821
food_inspection
How many eateries got highest inspection in 2013?
eateries got highest inspection score in 2013 refer to business_id from inspections where score = 100 and year(date) = 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' )
8,822
food_inspection
List down the eateries' IDs with structural inspection type in February 2016.
eateries' IDs refer to business_id; structural inspection type refers to inspections WHERE type = 'Structural Inspection'; in February 2016 refers to year(date) = 2016 and month(date) = 2;
SELECT business_id FROM inspections WHERE type = 'Structural Inspection' AND `date` LIKE '2016-02%'
8,823
food_inspection
How many eateries had low risk for violation with unpermitted food facility description?
eateries represent business; low risk for violation refers to risk_category = 'Low Risk';
SELECT COUNT(DISTINCT business_id) FROM violations WHERE risk_category = 'Low Risk' AND description = 'Unpermitted food facility'
8,824
food_inspection
Provide eateries' IDs, risk categories and descriptions with violation ID of 103101.
eateries' IDs refer to business_id; violation ID of 103101 refers to violation_type_id = '103101';
SELECT business_id, risk_category, description FROM violations WHERE violation_type_id = '103101'
8,825
food_inspection
When did eateries from San Bruno city get highest score in inspection?
eateries represent business; highest score in inspection refers to score = 100;
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
8,826
food_inspection
Describe the inspection types and violation descriptions under moderate risk category for ART's CAFÉ.
ART's CAFÉ is the name of the business; moderate risk category refers to risk_category = 'Moderate Risk';
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'
8,827
food_inspection
Mention the violation type ID and description of high risk category for STARBUCKS.
STARBUCKS is the name of the business; high risk category refers to risk_category = 'High Risk';
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'
8,828
food_inspection
List the inspection dates, scores and inspection types for the eateries with tax code AA.
eateries with tax code AA refer to business_id where 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'
8,829
food_inspection
Provide eateries' IDs, names and addresses which were inspected on 30th July, 2016.
eateries' IDs inspected on 30th July, 2016 refer to business_id where business_id is not null and date = '2016-07-30';
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'
8,830
food_inspection
Describe the violation dates, risk categories, descriptions and names of the eateries under Jade Chocolates LLC.
eateries under Jade Chocolates LLC refer to business_id where owner_name = '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'
8,831
food_inspection
Provide the names, risk categories and descriptions for the eateries with violation type ID of 103111.
eateries refer to business_id;
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'
8,832
food_inspection
Among violations on 3rd June, 2014, describe any 5 names, located cities and tax codes of the eateries with high risk category.
eateries with high risk category refer to business_id where risk_category = 'High Risk'; 3rd June, 2014 refers to date = '2014-06-03';
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
8,833
food_inspection
What was the inspection type when El Aji Peruvian Restaurant got highest inspection score?
El Aji Peruvian Restaurant is the name of the business; highest inspection score refers to MAX(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
8,834
food_inspection
Who were the owners of eateries which had highest health hazard by improper cooking time or temperatures?
owners of eateries refer to owner_name; highest health hazard by improper cooking time or temperatures refers to risk_category = 'High Risk' and description = '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'
8,835
food_inspection
List the eateries' names and addresses which had reinspection on 2nd February, 2015.
eateries which had reinspection on 2nd February, 2015 refer to business_id where date = '2015-02-02' and type = 'Reinspection/Followup';
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'
8,836
food_inspection
List the names and business certificates of the eateries which got inspection score under 50.
eateries which got inspection score under 50 refer to business_id where score < 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
8,837
food_inspection
How many of the businesses are located at 1825 POST St #223, San Francisco?
1825 POST St #223 refers to address = '1825 POST St #223', San Francisco is the name of the city;
SELECT COUNT(business_id) FROM businesses WHERE address = '1825 POST St #223' AND city = 'SAN FRANCISCO'
8,838
food_inspection
List down the owner's name with a zip code 94104.
zip code 94104 refers to owner_zip = '94104';
SELECT DISTINCT owner_name FROM businesses WHERE owner_zip = '94104'
8,839
food_inspection
What is the total number of businesses with a tax code H25?
SELECT COUNT(tax_code) FROM businesses WHERE tax_code = 'H25'
8,840
food_inspection
In the violations in 2014, how many of them have a low risk category?
in 2014 refers to year(date) = 2014; risk_category = 'Low Risk';
SELECT COUNT(risk_category) FROM violations WHERE STRFTIME('%Y', `date`) = '2014' AND risk_category = 'Low Risk'
8,841
food_inspection
Give the business ID and risk category of the business owned by San Francisco Madeleine, Inc.
business owned by San Francisco Madeleine, Inc. refers to business_id where owner_name = '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.'
8,842
food_inspection
List owner's name of businesses with a 100 score.
owner's name of businesses refers to owner_name;
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
8,843
food_inspection
Among the businesses within the postal code 94117, what is total number of businesses with a high risk category?
businesses with a high risk category refer to business_id where risk_category = 'High Risk';
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'
8,844
food_inspection
Among the businesses with score that ranges from 70 to 80, list their violation type ID and risk category.
businesses with score that ranges from 70 to 80 refer to business_id where score between 80 and 90;
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
8,845
food_inspection
List the tax code and inspection type of the business named "Rue Lepic".
"Rue Lepic" is the name of the business;
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'
8,846
food_inspection
In businesses that violates 103157 on May 27, 2016 , what is the name of the business that has an unscheduled inspection?
businesses that violates 103157 refer to business_id where violation_type_id = 103157; date = '2016-05-27'; unscheduled inspection refers to type = 'Routine - Unscheduled';
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'
8,847
food_inspection
Who is the owner of the business that has a high risk violation of 103109 and described as unclean or unsanitary food contact surfaces?
owner refers to owner_name; high risk violation of 103109 and described as unclean or unsanitary food contact surfaces refers to risk_category = 'High Risk' where violation_type_id = 103109 and description = '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'
8,848
food_inspection
Among the owners from Cameron Park, what is the business name of the business with a score of 100?
Cameron Park is a name of city;
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
8,849
food_inspection
List the violation type ID of business with business ID from 30 to 50 and located at 747 IRVING St, San Francisco.
business ID from 30 to 50 refers to business_id between 30 and 50; address = '747 IRVING St'; city = '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'
8,850
food_inspection
What is the owner's name of the of the business that violates 103156 on June 12, 2014?
business that violates 103156 on June 12, 2014 refers to business_id where violation_type_id = 103156 and date = '2014-06-12';
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'
8,851
food_inspection
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.
the highest score MAX(score); Silicon Valley is located in 'SAN FRANCISCO';
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
8,852
food_inspection
Among the violations in 2016, how many of them have unscheduled inspections?
unscheduled inspections refer to type = 'Routine - Unschedule'; year(date) = 2016;
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'
8,853
food_inspection
List the business' name and risk category of businesses with a score greater than the 80% of average score of all businesses.
score greater than the 80% of average score of all businesses refers to score > MULTIPLY(0.8, avg(score) from inspections);
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 )
8,854
food_inspection
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?
DIVIDE(COUNT(business_id where risk_category = 'Low Risk', score < 95 and postal_code = 94110), COUNT(business_id where score < 95 and postal_code = 94110)) as percentage;
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
8,855
craftbeer
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 )
8,856
craftbeer
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.
The more IBU, the more bitter the beer is, bitterest means highest IBU.
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
8,857
craftbeer
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
8,858
craftbeer
Of all the beer styles produced by Stevens Point Brewery, how many percent do they allot for American Adjunct Lager?
Percent allotted = count(American Adjunct Lager beer styles) / count(styles) * 100%
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'
8,859
craftbeer
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.
The more IBU, the more bitter the beer is, most bitter means highest IBU; The less IBU, the less bitter the beer is, least bitter means lowest IBU
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
8,860
craftbeer
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 (%).
Percentage of the state of Wisconsin produces American Blonde Ale could be computed by count(breweries in Wisconsin producing American Blonde Ale) / count(all breweries)
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'
8,861
cookbook
What is the title of the recipe that is most likely to gain weight?
most likely to gain weight refers to MAX(total_fat)
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
8,862
cookbook
What is the unsaturated fat content in the recipe "Raspberry Chiffon Pie"?
Raspberry Chiffon Pie refers to title; unsaturated fat refers to SUBTRACT(total_fat, sat_fat)
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'
8,863
cookbook
Please list the titles of all the recipes that are salt/sodium-free.
salt/sodium-free refers to sodium < 5
SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.sodium < 5
8,864
cookbook
Please list the titles of all the recipes that may lead to constipation, feeling sick or stomach pain.
may lead to constipation, feeling sick or stomach pain refers to iron > 20
SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.iron > 20
8,865
cookbook
Which recipe is more beneficial in wound healing, "Raspberry Chiffon Pie" or "Fresh Apricot Bavarian"?
Raspberry Chiffon Pie and Fresh Apricot Bavarian are title; vitamin_c is higher refers to MAX(vitamin_c)
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
8,866
cookbook
Among the recipes that take more than 10 minutes to prepare, what is the title of the one with the most calories?
more than 10 minutes to prepare refers to prep_min > 10; the most calories refers to MAX(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
8,867
cookbook
How many calories does the recipe "Raspberry Chiffon Pie" contain?
Raspberry Chiffon Pie refers to title
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'
8,868
cookbook
Is the ingredient "graham cracker crumbs" optional in the recipe "Raspberry Chiffon Pie"?
'graham cracker crumbs' is a name of an ingredient; 'Raspberry Chiffon Pie' refers to title
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'
8,869
cookbook
How many ingredients must be rationed in the recipe "Raspberry Chiffon Pie"?
Raspberry Chiffon Pie refers to title; ingredient must be rationed refers to max_qty = min_qty
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
8,870
cookbook
Please list the names of all the ingredients needed for the recipe "Raspberry Chiffon Pie" that do not need preprocessing.
Raspberry Chiffon Pie refers to title; do not need preprocessing refers to preparation IS NULL
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
8,871
cookbook
How many recipes include the ingredient "graham cracker crumbs"?
'graham cracker crumbs' is a name of an ingredient
SELECT COUNT(*) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T1.name = 'graham cracker crumbs'
8,872
cookbook
At least how many cups of graham cracker crumbs does the recipe "Raspberry Chiffon Pie" need?
'graham cracker crumbs' is a name of an ingredient; 'Raspberry Chiffon Pie' refers to title
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'
8,873
cookbook
How many calories from fat are there in the recipe "Raspberry Chiffon Pie"?
calories from fat refers to MULTIPLY(calories, pcnt_cal_fat)||'%; Raspberry Chiffon Pie refers to title
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'
8,874
cookbook
How many calories on average does a recipe that comes from "Produce for Better Health Foundation and 5 a Day" contain?
Produce for Better Health Foundation and 5 a Day is a source of recipe; calculation = DIVIDE(SUM(calories), COUNT(recipe_id))
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'
8,875
cookbook
How many calories does the turkey tenderloin bundles recipe have?
turkey tenderloin refers to title
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'
8,876
cookbook
How many cups of 1% lowfat milk should be added to no.1436 recipe?
1% lowfat milk is a name of an ingredient; no.1436 recipe refers to recipe_id = 1436; max_qty = min_qty
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
8,877
cookbook
Which recipe in the database contains the most total fat? Give its title.
the most total fat refers to MAX(total_fat)
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
8,878
cookbook
How many times do seedless red grapes appear in the recipes?
seedless red grapes is a name of an ingredient
SELECT COUNT(*) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T1.name = 'seedless red grapes'
8,879
cookbook
State the name of the optional ingredient of no.1397 recipe.
no.1397 recipe refers to recipe_id = 1397; optional ingredient refers to optional = 'TRUE'
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'
8,880
cookbook
Which recipe needs the most frozen raspberries in light syrup? State its title.
frozen raspberries in light syrup is a name of an ingredient; max_qty = min_qty
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
8,881
cookbook
Give the name of the most widely used ingredient.
the most widely used ingredient refers to MAX(COUNT(ingredient_id))
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
8,882
cookbook
What kind of preparation is needed for apple juice to make a raspberry-pear couscous cake?
apple juice is a name of an ingredient; raspberry-pear couscous cake refers to title
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'
8,883
cookbook
How many cups of almonds do you need for a chicken pocket sandwich?
cups is a unit; almonds is a name of an ingredient; chicken pocket sandwich refers to title
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)'
8,884
cookbook
Name the recipe with the most Vitamin C.
the most Vitamin C refers to MAX(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
8,885
cookbook
How much Vitamin A is in Sherry beef?
Sherry beef refers to title = 'Sherried 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'
8,886
cookbook
State the title of the recipe with most kinds of ingredients.
the most kinds of ingredients refers to MAX(COUNT(recipe_id))
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
8,887
cookbook
How many times is the sodium content in Lasagne-Spinach Spirals to Beef and Spinach Pita Pockets?
sodium is a name of an ingredient; calculation = DIVIDE(SUM(title = 'Lasagne-Spinach Spirals' THEN sodium), SUM(title = 'Beef and Spinach Pita Pockets' THEN sodium))
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
8,888
cookbook
What is the average calorie count for all recipes using coarsely ground black pepper?
coarsely ground black pepper is a name of an ingredient; calculation = AVG(calories)
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'
8,889
cookbook
What are the names of the recipes that will cause stomach pain?
cause stomach pain refers to iron > 20
SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.iron > 20
8,890
cookbook
How many ingredients are there in Apricot Yogurt Parfaits?
Apricot Yogurt Parfaits refers to title
SELECT COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Apricot Yogurt Parfaits'
8,891
cookbook
What are the names of the ingredients that need to be cook in beef broth?
'cook in beef broth' refers to a preparation
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'
8,892
cookbook
How many ingredients are there in the recipe that is best in helping your body's natural defence against illness and infection?
best in helping your body's natural defence against illness and infection refers to MAX(vitamin_a);
SELECT COUNT(*) FROM Nutrition AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.vitamin_a > 0
8,893
cookbook
What are the names of the top 5 recipes that are best for wound healing?
names of the recipes refers to title; best for wound healing refers to MAX(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 5
8,894
cookbook
Which ingredient appeared the least in recipes?
ingredient appeared the least in recipes refers to MIN(ingredient_id)
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
8,895
cookbook
How many baking product ingredients are there in the No-Bake Chocolate Cheesecake?
baking product is a category; No-Bake Chocolate Cheesecake refers to title;
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'
8,896
cookbook
List all the ingredients for Strawberry Sorbet.
Strawberry Sorbet refers to title
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'
8,897
cookbook
What are the optional ingredients for Warm Chinese Chicken Salad?
optional refers to optional = 'TRUE'; Warm Chinese Chicken Salad refers to title
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'
8,898
cookbook
Among the recipes with alcohol content over 10, which recipe takes the longest to prepare?
with alcohol content over 10 refers to alcohol > 10; takes the longest to prepare refers to MAX(prep_min)
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
8,899