problem
stringlengths 121
422
| db_id
stringclasses 69
values | solution
stringlengths 23
804
|
---|---|---|
Write SQL query to solve given problem: What is the average score of the establishments owned by the owner with the highest number of establishments?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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 |
Write SQL query to solve given problem: What is the name of the establishment with the highest number of low risk violations in 2014?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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 |
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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 |
Write SQL query to solve given problem: Which establishment has the highest number of inspections done? Give the name of the establishment and calculate for its average score per inspection.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_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 |
Write SQL query to solve given problem: How many eateries got highest inspection in 2013?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | SELECT COUNT(DISTINCT business_id) FROM inspections WHERE STRFTIME('%Y', `date`) = '2013' AND score = ( SELECT MAX(score) FROM inspections WHERE STRFTIME('%Y', `date`) = '2013' ) |
Write SQL query to solve given problem: List down the eateries' IDs with structural inspection type in February 2016.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | SELECT business_id FROM inspections WHERE type = 'Structural Inspection' AND `date` LIKE '2016-02%' |
Write SQL query to solve given problem: How many eateries had low risk for violation with unpermitted food facility description?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | SELECT COUNT(DISTINCT business_id) FROM violations WHERE risk_category = 'Low Risk' AND description = 'Unpermitted food facility' |
Write SQL query to solve given problem: Provide eateries' IDs, risk categories and descriptions with violation ID of 103101.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | SELECT business_id, risk_category, description FROM violations WHERE violation_type_id = '103101' |
Write SQL query to solve given problem: When did eateries from San Bruno city get highest score in inspection?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_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 |
Write SQL query to solve given problem: Describe the inspection types and violation descriptions under moderate risk category for ART's CAFÉ.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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' |
Write SQL query to solve given problem: Mention the violation type ID and description of high risk category for STARBUCKS.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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' |
Write SQL query to solve given problem: List the inspection dates, scores and inspection types for the eateries with tax code AA.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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' |
Write SQL query to solve given problem: Provide eateries' IDs, names and addresses which were inspected on 30th July, 2016.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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' |
Write SQL query to solve given problem: Describe the violation dates, risk categories, descriptions and names of the eateries under Jade Chocolates LLC.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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' |
Write SQL query to solve given problem: Provide the names, risk categories and descriptions for the eateries with violation type ID of 103111.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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' |
Write SQL query to solve given problem: Among violations on 3rd June, 2014, describe any 5 names, located cities and tax codes of the eateries with high risk category.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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 |
Write SQL query to solve given problem: What was the inspection type when El Aji Peruvian Restaurant got highest inspection score?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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 |
Write SQL query to solve given problem: Who were the owners of eateries which had highest health hazard by improper cooking time or temperatures?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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' |
Write SQL query to solve given problem: List the eateries' names and addresses which had reinspection on 2nd February, 2015.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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' |
Write SQL query to solve given problem: List the names and business certificates of the eateries which got inspection score under 50.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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 |
Write SQL query to solve given problem: How many of the businesses are located at 1825 POST St #223, San Francisco?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | SELECT COUNT(business_id) FROM businesses WHERE address = '1825 POST St #223' AND city = 'SAN FRANCISCO' |
Write SQL query to solve given problem: List down the owner's name with a zip code 94104.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | SELECT DISTINCT owner_name FROM businesses WHERE owner_zip = '94104' |
Write SQL query to solve given problem: What is the total number of businesses with a tax code H25?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | SELECT COUNT(tax_code) FROM businesses WHERE tax_code = 'H25' |
Write SQL query to solve given problem: In the violations in 2014, how many of them have a low risk category?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | SELECT COUNT(risk_category) FROM violations WHERE STRFTIME('%Y', `date`) = '2014' AND risk_category = 'Low Risk' |
Write SQL query to solve given problem: Give the business ID and risk category of the business owned by San Francisco Madeleine, Inc.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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.' |
Write SQL query to solve given problem: List owner's name of businesses with a 100 score.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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 |
Write SQL query to solve given problem: Among the businesses within the postal code 94117, what is total number of businesses with a high risk category?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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' |
Write SQL query to solve given problem: Among the businesses with score that ranges from 70 to 80, list their violation type ID and risk category.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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 |
Write SQL query to solve given problem: List the tax code and inspection type of the business named "Rue Lepic".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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' |
Write SQL query to solve given problem: In businesses that violates 103157 on May 27, 2016 , what is the name of the business that has an unscheduled inspection?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_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' |
Write SQL query to solve given problem: Who is the owner of the business that has a high risk violation of 103109 and described as unclean or unsanitary food contact surfaces?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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' |
Write SQL query to solve given problem: Among the owners from Cameron Park, what is the business name of the business with a score of 100?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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 |
Write SQL query to solve given problem: List the violation type ID of business with business ID from 30 to 50 and located at 747 IRVING St, San Francisco.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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' |
Write SQL query to solve given problem: What is the owner's name of the of the business that violates 103156 on June 12, 2014?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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' |
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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 |
Write SQL query to solve given problem: Among the violations in 2016, how many of them have unscheduled inspections?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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' |
Write SQL query to solve given problem: List the business' name and risk category of businesses with a score greater than the 80% of average score of all businesses.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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 ) |
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | food_inspection | 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 |
Write SQL query to solve given problem: Which distinct state makes beer that has the least amount of bitterness?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | craftbeer | 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 ) |
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | craftbeer | 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 |
Write SQL query to solve given problem: What is the average alcohol content per 12-ounce beer bottle produced by Boston Beer Company?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | craftbeer | 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 |
Write SQL query to solve given problem: Of all the beer styles produced by Stevens Point Brewery, how many percent do they allot for American Adjunct Lager?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | craftbeer | 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' |
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | craftbeer | 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 |
Write SQL query to solve given problem: 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 (%).. Keep the solution inside sql tag ```sql [SQL-Query] ``` | craftbeer | 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' |
Write SQL query to solve given problem: What is the title of the recipe that is most likely to gain weight?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 |
Write SQL query to solve given problem: What is the unsaturated fat content in the recipe "Raspberry Chiffon Pie"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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' |
Write SQL query to solve given problem: Please list the titles of all the recipes that are salt/sodium-free.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.sodium < 5 |
Write SQL query to solve given problem: Please list the titles of all the recipes that may lead to constipation, feeling sick or stomach pain.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.iron > 20 |
Write SQL query to solve given problem: Which recipe is more beneficial in wound healing, "Raspberry Chiffon Pie" or "Fresh Apricot Bavarian"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 |
Write SQL query to solve given problem: Among the recipes that take more than 10 minutes to prepare, what is the title of the one with the most calories?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 |
Write SQL query to solve given problem: How many calories does the recipe "Raspberry Chiffon Pie" contain?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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' |
Write SQL query to solve given problem: Is the ingredient "graham cracker crumbs" optional in the recipe "Raspberry Chiffon Pie"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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' |
Write SQL query to solve given problem: How many ingredients must be rationed in the recipe "Raspberry Chiffon Pie"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 |
Write SQL query to solve given problem: Please list the names of all the ingredients needed for the recipe "Raspberry Chiffon Pie" that do not need preprocessing.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 |
Write SQL query to solve given problem: How many recipes include the ingredient "graham cracker crumbs"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | SELECT COUNT(*) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T1.name = 'graham cracker crumbs' |
Write SQL query to solve given problem: At least how many cups of graham cracker crumbs does the recipe "Raspberry Chiffon Pie" need?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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' |
Write SQL query to solve given problem: How many calories from fat are there in the recipe "Raspberry Chiffon Pie"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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' |
Write SQL query to solve given problem: How many calories on average does a recipe that comes from "Produce for Better Health Foundation and 5 a Day" contain?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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' |
Write SQL query to solve given problem: How many calories does the turkey tenderloin bundles recipe have?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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' |
Write SQL query to solve given problem: How many cups of 1% lowfat milk should be added to no.1436 recipe?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 |
Write SQL query to solve given problem: Which recipe in the database contains the most total fat? Give its title.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 |
Write SQL query to solve given problem: How many times do seedless red grapes appear in the recipes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | SELECT COUNT(*) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T1.name = 'seedless red grapes' |
Write SQL query to solve given problem: State the name of the optional ingredient of no.1397 recipe.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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' |
Write SQL query to solve given problem: Which recipe needs the most frozen raspberries in light syrup? State its title.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 |
Write SQL query to solve given problem: Give the name of the most widely used ingredient.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 |
Write SQL query to solve given problem: What kind of preparation is needed for apple juice to make a raspberry-pear couscous cake?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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' |
Write SQL query to solve given problem: How many cups of almonds do you need for a chicken pocket sandwich?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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)' |
Write SQL query to solve given problem: Name the recipe with the most Vitamin C.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 |
Write SQL query to solve given problem: How much Vitamin A is in Sherry beef?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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' |
Write SQL query to solve given problem: State the title of the recipe with most kinds of ingredients.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 |
Write SQL query to solve given problem: How many times is the sodium content in Lasagne-Spinach Spirals to Beef and Spinach Pita Pockets?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 |
Write SQL query to solve given problem: What is the average calorie count for all recipes using coarsely ground black pepper?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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' |
Write SQL query to solve given problem: What are the names of the recipes that will cause stomach pain?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.iron > 20 |
Write SQL query to solve given problem: How many ingredients are there in Apricot Yogurt Parfaits?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | SELECT COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Apricot Yogurt Parfaits' |
Write SQL query to solve given problem: What are the names of the ingredients that need to be cook in beef broth?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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' |
Write SQL query to solve given problem: How many ingredients are there in the recipe that is best in helping your body's natural defence against illness and infection?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | SELECT COUNT(*) FROM Nutrition AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.vitamin_a > 0 |
Write SQL query to solve given problem: What are the names of the top 5 recipes that are best for wound healing?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 |
Write SQL query to solve given problem: Which ingredient appeared the least in recipes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 |
Write SQL query to solve given problem: How many baking product ingredients are there in the No-Bake Chocolate Cheesecake?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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' |
Write SQL query to solve given problem: List all the ingredients for Strawberry Sorbet.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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' |
Write SQL query to solve given problem: What are the optional ingredients for Warm Chinese Chicken Salad?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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' |
Write SQL query to solve given problem: Among the recipes with alcohol content over 10, which recipe takes the longest to prepare?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 |
Write SQL query to solve given problem: How many servings does the recipe with the highest unsaturated fat have?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 |
Write SQL query to solve given problem: Among the recipes whose source is the National Potato Board, which recipe has the highest calories?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 |
Write SQL query to solve given problem: Which recipe has the highest number of ingredients? Calculate the said recipe's total time of cooking.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 |
Write SQL query to solve given problem: Which ingredient appeared the most in recipes? Calculate its amount of appearance in percentage.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 BY COUNT(T2.ingredient_id) DESC LIMIT 1 |
Write SQL query to solve given problem: Provide the title and total time of the recipe which has the highest possibility of gaining weight.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | SELECT T1.title, T1.prep_min + T1.cook_min + T1.stnd_min FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id ORDER BY T2.total_fat DESC LIMIT 1 |
Write SQL query to solve given problem: Which recipes contain almond extract?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 = 'almond extract' |
Write SQL query to solve given problem: List the ingredients in Tomato-Cucumber Relish.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | 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 = 'Tomato-Cucumber Relish' |
Write SQL query to solve given problem: How many ingredients are needed to prepare Idaho Potato Supreme?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | SELECT COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Idaho Potato Supreme' |
Write SQL query to solve given problem: Provide the ingredients that are rationed in the recipe with the highest carbohydrate content.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | SELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id INNER JOIN Nutrition AS T3 ON T3.recipe_id = T2.recipe_id WHERE T2.max_qty = T2.min_qty ORDER BY T3.carbo DESC LIMIT 1 |
Write SQL query to solve given problem: Name the recipes which can lead to constipation.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.iron > 20 |
Write SQL query to solve given problem: Describe the ingredients in the recipe with the highest vitamin that helps vision in dim light.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | SELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id INNER JOIN Nutrition AS T3 ON T3.recipe_id = T2.recipe_id ORDER BY T3.vitamin_a DESC LIMIT 1 |
Write SQL query to solve given problem: Provide the ingredients and maximum quantities of the recipe which can serve 7 people.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | SELECT T3.name, T2.max_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.servings = 7 |
Write SQL query to solve given problem: Among the recipes from The California Tree Fruit Agreement, calculate the percentage of sodium-free recipes.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | SELECT CAST(SUM(CASE WHEN T2.sodium < 5 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.source = 'The California Tree Fruit Agreement' |
Write SQL query to solve given problem: List the ingredients which measure in slices.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | SELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T2.unit = 'slice(s)' |
Write SQL query to solve given problem: How many recipes can be made with canned dairy?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | SELECT COUNT(*) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T1.category = 'canned dairy' |
Write SQL query to solve given problem: Provide the title and total time of the recipe which can be made with only lima beans.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | SELECT T1.title, 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 INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T3.name = 'lima beans' |
Write SQL query to solve given problem: Among the recipes with sea bass, how many percent of recipes can serve 10 people and above?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | SELECT CAST(SUM(CASE WHEN T1.servings >= 10 THEN 1 ELSE 0 END) AS REAL) * 100 / 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.name = 'sea bass steak' |
Write SQL query to solve given problem: How much fat does the Raspberry Chiffon Pie have?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cookbook | SELECT T2.total_fat FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Raspberry Chiffon Pie' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.