Chinastark/bird_dataset huggingface dataset:
Database: cookbook
Note: most likely to gain weight refers to MAX(total_fat);
Question: What is the title of the recipe that is most likely to gain weight?
SQL: SELECT recipe.title FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id ORDER BY nutrition.total_fat DESC LIMIT 1
Database: cookbook
Note: Raspberry Chiffon Pie refers to title; unsaturated fat refers to SUBTRACT(total_fat, sat_fat);
Question: What is the unsaturated fat content in the recipe "Raspberry Chiffon Pie"?
SQL: SELECT nutrition.total_fat - nutrition.sat_fat FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id WHERE recipe.title = 'Raspberry Chiffon Pie'
Database: cookbook
Note: salt/sodium-free refers to sodium < 5;
Question: Please list the titles of all the recipes that are salt/sodium-free.
SQL: SELECT recipe.title FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id WHERE nutrition.sodium < 5
Database: cookbook
Note: may lead to constipation, feeling sick or stomach pain refers to iron > 20;
Question: Please list the titles of all the recipes that may lead to constipation, feeling sick or stomach pain.
SQL: SELECT recipe.title FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id WHERE nutrition.iron > 20
Database: cookbook
Note: Raspberry Chiffon Pie and Fresh Apricot Bavarian are title; vitamin_c is higher refers to MAX(vitamin_c);
Question: Which recipe is more beneficial in wound healing, "Raspberry Chiffon Pie" or "Fresh Apricot Bavarian"?
SQL: SELECT DISTINCT CASE WHEN CASE WHEN recipe.title = 'Raspberry Chiffon Pie' THEN nutrition.vitamin_c END > CASE WHEN recipe.title = 'Fresh Apricot Bavarian' THEN nutrition.vitamin_c END THEN 'Raspberry Chiffon Pie' ELSE 'Fresh Apricot Bavarian' END AS "vitamin_c is higher" FROM nutrition nutrition INNER JOIN recipe recipe ON recipe.recipe_id = nutrition.recipe_id
Database: cookbook
Note: more than 10 minutes to prepare refers to prep_min > 10; the most calories refers to MAX(calories);
Question: Among the recipes that take more than 10 minutes to prepare, what is the title of the one with the most calories?
SQL: SELECT recipe.title FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id WHERE recipe.prep_min > 10 ORDER BY nutrition.calories DESC LIMIT 1
Database: cookbook
Note: Raspberry Chiffon Pie refers to title;
Question: How many calories does the recipe "Raspberry Chiffon Pie" contain?
SQL: SELECT nutrition.calories FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id WHERE recipe.title = 'Raspberry Chiffon Pie'
Database: cookbook
Note: 'graham cracker crumbs' is a name of an ingredient; 'Raspberry Chiffon Pie' refers to title;
Question: Is the ingredient "graham cracker crumbs" optional in the recipe "Raspberry Chiffon Pie"?
SQL: SELECT quantity.optional FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id INNER JOIN ingredient ON ingredient.ingredient_id = quantity.ingredient_id WHERE recipe.title = 'Raspberry Chiffon Pie' AND ingredient.name = 'graham cracker crumbs'
Database: cookbook
Note: Raspberry Chiffon Pie refers to title; ingredient must be rationed refers to max_qty = min_qty;
Question: How many ingredients must be rationed in the recipe "Raspberry Chiffon Pie"?
SQL: SELECT count(*) FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id WHERE recipe.title = 'Raspberry Chiffon Pie' AND quantity.max_qty = quantity.min_qty
Database: cookbook
Note: Raspberry Chiffon Pie refers to title; do not need preprocessing refers to preparation IS NULL;
Question: Please list the names of all the ingredients needed for the recipe "Raspberry Chiffon Pie" that do not need preprocessing.
SQL: SELECT ingredient.name FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id INNER JOIN ingredient ON ingredient.ingredient_id = quantity.ingredient_id WHERE recipe.title = 'Raspberry Chiffon Pie' AND quantity.preparation IS NULL
Database: cookbook
Note: 'graham cracker crumbs' is a name of an ingredient;
Question: How many recipes include the ingredient "graham cracker crumbs"?
SQL: SELECT count(*) FROM ingredient INNER JOIN quantity ON ingredient.ingredient_id = quantity.ingredient_id WHERE ingredient.name = 'graham cracker crumbs'
Database: cookbook
Note: 'graham cracker crumbs' is a name of an ingredient; 'Raspberry Chiffon Pie' refers to title;
Question: At least how many cups of graham cracker crumbs does the recipe "Raspberry Chiffon Pie" need?
SQL: SELECT quantity.min_qty FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id INNER JOIN ingredient ON ingredient.ingredient_id = quantity.ingredient_id WHERE recipe.title = 'Raspberry Chiffon Pie' AND ingredient.name = 'graham cracker crumbs'
Database: cookbook
Note: calories from fat refers to MULTIPLY(calories, pcnt_cal_fat)||'%; Raspberry Chiffon Pie refers to title;
Question: How many calories from fat are there in the recipe "Raspberry Chiffon Pie"?
SQL: SELECT nutrition.calories * nutrition.pcnt_cal_fat FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id WHERE recipe.title = 'Raspberry Chiffon Pie'
Database: cookbook
Note: Produce for Better Health Foundation and 5 a Day is a source of recipe; calculation = DIVIDE(SUM(calories), COUNT(recipe_id));
Question: How many calories on average does a recipe that comes from "Produce for Better Health Foundation and 5 a Day" contain?
SQL: SELECT avg(nutrition.calories) FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id WHERE recipe.source = 'Produce for Better Health Foundation and 5 a Day'
Database: cookbook
Note: turkey tenderloin refers to title;
Question: How many calories does the turkey tenderloin bundles recipe have?
SQL: SELECT nutrition.calories FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id WHERE recipe.title = 'Turkey Tenderloin Bundles'
Database: cookbook
Note: 1% lowfat milk is a name of an ingredient; no.1436 recipe refers to recipe_id = 1436; max_qty = min_qty;
Question: How many cups of 1% lowfat milk should be added to no.1436 recipe?
SQL: SELECT count(*) FROM ingredient INNER JOIN quantity ON ingredient.ingredient_id = quantity.ingredient_id WHERE ingredient.name = '1% lowfat milk' AND quantity.unit = 'cup(s)' AND quantity.recipe_id = 1436
Database: cookbook
Note: the most total fat refers to MAX(total_fat);
Question: Which recipe in the database contains the most total fat? Give its title.
SQL: SELECT recipe.title FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id ORDER BY nutrition.total_fat DESC LIMIT 1
Database: cookbook
Note: seedless red grapes is a name of an ingredient;
Question: How many times do seedless red grapes appear in the recipes?
SQL: SELECT count(*) FROM ingredient INNER JOIN quantity ON ingredient.ingredient_id = quantity.ingredient_id WHERE ingredient.name = 'seedless red grapes'
Database: cookbook
Note: no.1397 recipe refers to recipe_id = 1397; optional ingredient refers to optional = 'TRUE';
Question: State the name of the optional ingredient of no.1397 recipe.
SQL: SELECT ingredient.name FROM ingredient INNER JOIN quantity ON ingredient.ingredient_id = quantity.ingredient_id WHERE quantity.recipe_id = 1397 AND quantity.optional = 'TRUE'
Database: cookbook
Note: frozen raspberries in light syrup is a name of an ingredient; max_qty = min_qty;
Question: Which recipe needs the most frozen raspberries in light syrup? State its title.
SQL: SELECT recipe.title FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id INNER JOIN ingredient ON ingredient.ingredient_id = quantity.ingredient_id WHERE ingredient.name = 'frozen raspberries in light syrup' AND quantity.max_qty = quantity.min_qty
Database: cookbook
Note: the most widely used ingredient refers to MAX(COUNT(ingredient_id));
Question: Give the name of the most widely used ingredient.
SQL: SELECT ingredient.name FROM ingredient INNER JOIN quantity ON ingredient.ingredient_id = quantity.ingredient_id GROUP BY ingredient.name ORDER BY count(ingredient.name) DESC LIMIT 1
Database: cookbook
Note: apple juice is a name of an ingredient; raspberry-pear couscous cake refers to title;
Question: What kind of preparation is needed for apple juice to make a raspberry-pear couscous cake?
SQL: SELECT quantity.preparation FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id INNER JOIN ingredient ON ingredient.ingredient_id = quantity.ingredient_id WHERE recipe.title = 'Raspberry-Pear Couscous Cake' AND ingredient.name = 'apple juice'
Database: cookbook
Note: cups is a unit; almonds is a name of an ingredient; chicken pocket sandwich refers to title;
Question: How many cups of almonds do you need for a chicken pocket sandwich?
SQL: SELECT count(*) FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id INNER JOIN ingredient ON ingredient.ingredient_id = quantity.ingredient_id WHERE recipe.title = 'Chicken Pocket Sandwich' AND ingredient.name = 'almonds' AND quantity.unit = 'cup(s)'
Database: cookbook
Note: the most Vitamin C refers to MAX(vitamin_c);
Question: Name the recipe with the most Vitamin C.
SQL: SELECT recipe.title FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id ORDER BY nutrition.vitamin_c DESC LIMIT 1
Database: cookbook
Note: Sherry beef refers to title = 'Sherried Beef';
Question: How much Vitamin A is in Sherry beef?
SQL: SELECT nutrition.vitamin_a FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id WHERE recipe.title = 'Sherried Beef'
Database: cookbook
Note: the most kinds of ingredients refers to MAX(COUNT(recipe_id));
Question: State the title of the recipe with most kinds of ingredients.
SQL: SELECT recipe.title FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id GROUP BY recipe.title ORDER BY count(title) DESC LIMIT 1
Database: cookbook
Note: 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));
Question: How many times is the sodium content in Lasagne-Spinach Spirals to Beef and Spinach Pita Pockets?
SQL: SELECT cast(sum(CASE WHEN recipe.title = 'Lasagne-Spinach Spirals' THEN nutrition.sodium ELSE 0 END) AS REAL) * 100 / sum(CASE WHEN recipe.title = 'Beef and Spinach Pita Pockets' THEN nutrition.sodium ELSE 0 END) FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id
Database: cookbook
Note: coarsely ground black pepper is a name of an ingredient; calculation = AVG(calories);
Question: What is the average calorie count for all recipes using coarsely ground black pepper?
SQL: SELECT avg(nutrition.calories) FROM ingredient INNER JOIN quantity ON quantity.ingredient_id = ingredient.ingredient_id INNER JOIN nutrition ON nutrition.recipe_id = quantity.recipe_id WHERE ingredient.name = 'coarsely ground black pepper'
Database: cookbook
Note: cause stomach pain refers to iron > 20;
Question: What are the names of the recipes that will cause stomach pain?
SQL: SELECT recipe.title FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id WHERE nutrition.iron > 20
Database: cookbook
Note: Apricot Yogurt Parfaits refers to title;
Question: How many ingredients are there in Apricot Yogurt Parfaits?
SQL: SELECT count(*) FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id WHERE recipe.title = 'Apricot Yogurt Parfaits'
Database: cookbook
Note: 'cook in beef broth' refers to a preparation;
Question: What are the names of the ingredients that need to be cook in beef broth?
SQL: SELECT ingredient.name FROM ingredient INNER JOIN quantity ON ingredient.ingredient_id = quantity.ingredient_id WHERE quantity.preparation = 'cooked in beef broth'
Database: cookbook
Note: best in helping your body's natural defence against illness and infection refers to MAX(vitamin_a);
Question: How many ingredients are there in the recipe that is best in helping your body's natural defence against illness and infection?
SQL: SELECT count(*) FROM nutrition INNER JOIN quantity ON nutrition.recipe_id = quantity.recipe_id WHERE nutrition.vitamin_a > 0
Database: cookbook
Note: names of the recipes refers to title; best for wound healing refers to MAX(vitamin_c);
Question: What are the names of the top 5 recipes that are best for wound healing?
SQL: SELECT recipe.title FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id ORDER BY nutrition.vitamin_c DESC LIMIT 5
Database: cookbook
Note: ingredient appeared the least in recipes refers to MIN(ingredient_id);
Question: Which ingredient appeared the least in recipes?
SQL: SELECT ingredient.name FROM ingredient INNER JOIN quantity ON ingredient.ingredient_id = quantity.ingredient_id GROUP BY quantity.ingredient_id ORDER BY count(quantity.ingredient_id) ASC LIMIT 1
Database: cookbook
Note: baking product is a category; No-Bake Chocolate Cheesecake refers to title;
Question: How many baking product ingredients are there in the No-Bake Chocolate Cheesecake?
SQL: SELECT count(*) FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id INNER JOIN ingredient ON ingredient.ingredient_id = quantity.ingredient_id WHERE ingredient.category = 'baking products' AND recipe.title = 'No-Bake Chocolate Cheesecake'
Database: cookbook
Note: Strawberry Sorbet refers to title;
Question: List all the ingredients for Strawberry Sorbet.
SQL: SELECT ingredient.name FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id INNER JOIN ingredient ON ingredient.ingredient_id = quantity.ingredient_id WHERE recipe.title = 'Strawberry Sorbet'
Database: cookbook
Note: optional refers to optional = 'TRUE'; Warm Chinese Chicken Salad refers to title;
Question: What are the optional ingredients for Warm Chinese Chicken Salad?
SQL: SELECT ingredient.name FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id INNER JOIN ingredient ON ingredient.ingredient_id = quantity.ingredient_id WHERE recipe.title = 'Warm Chinese Chicken Salad' AND quantity.optional = 'TRUE'
Database: cookbook
Note: with alcohol content over 10 refers to alcohol > 10; takes the longest to prepare refers to MAX(prep_min);
Question: Among the recipes with alcohol content over 10, which recipe takes the longest to prepare?
SQL: SELECT recipe.title FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id WHERE nutrition.alcohol > 10 ORDER BY recipe.prep_min DESC LIMIT 1
Database: cookbook
Note: with the highest unsaturated fat refers MAX(SUBTRACT(total_fat, sat_fat));
Question: How many servings does the recipe with the highest unsaturated fat have?
SQL: SELECT count(recipe.title) FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id ORDER BY nutrition.total_fat - nutrition.sat_fat DESC LIMIT 1
Database: cookbook
Note: the National Potato Board is a source; the highest calories refers to MAX(calories);
Question: Among the recipes whose source is the National Potato Board, which recipe has the highest calories?
SQL: SELECT recipe.title FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id WHERE recipe.source = 'National Potato Board' ORDER BY nutrition.calories DESC LIMIT 1
Database: cookbook
Note: the highest number of ingredients refers to MAX(ingredient_id); total time refers to recipe_id, total time of cooking refers to TOTAL(prep_min, cook_min, stnd_min);
Question: Which recipe has the highest number of ingredients? Calculate the said recipe's total time of cooking.
SQL: SELECT quantity.recipe_id, recipe.prep_min + recipe.cook_min + recipe.stnd_min FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id GROUP BY quantity.recipe_id ORDER BY count(quantity.ingredient_id) DESC LIMIT 1
Database: cookbook
Note: ingredient appeared the most in recipes refers to MAX(COUNT(ingredient_id)); calculation = MULTIPLY(DIVIDE(COUNT(MAX(ingredient_id)), COUNT(ingredient_id)), 100);
Question: Which ingredient appeared the most in recipes? Calculate its amount of appearance in percentage.
SQL: SELECT ingredient.name, cast(count(quantity.ingredient_id) AS FLOAT) * 100 / ( SELECT count(quantity.ingredient_id) FROM ingredient INNER JOIN quantity ON quantity.ingredient_id = ingredient.ingredient_id ) AS "percentage" FROM ingredient INNER JOIN quantity ON quantity.ingredient_id = ingredient.ingredient_id GROUP BY quantity.ingredient_id ORDER BY count(quantity.ingredient_id) DESC LIMIT 1
Database: cookbook
Note: the highest possibility of gaining weight refers to MAX(total_fat); total time refers to recipe_id, total time refers to TOTAL(prep_min, cook_min, stnd_min);
Question: Provide the title and total time of the recipe which has the highest possibility of gaining weight.
SQL: SELECT recipe.title, recipe.prep_min + recipe.cook_min + recipe.stnd_min FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id ORDER BY nutrition.total_fat DESC LIMIT 1
Database: cookbook
Note: almond extract is a name of an ingredient;
Question: Which recipes contain almond extract?
SQL: SELECT recipe.title FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id INNER JOIN ingredient ON ingredient.ingredient_id = quantity.ingredient_id WHERE ingredient.name = 'almond extract'
Database: cookbook
Note: Tomato-Cucumber Relish refers to title;
Question: List the ingredients in Tomato-Cucumber Relish.
SQL: SELECT ingredient.name FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id INNER JOIN ingredient ON ingredient.ingredient_id = quantity.ingredient_id WHERE recipe.title = 'Tomato-Cucumber Relish'
Database: cookbook
Note: Idaho Potato Supreme refers to title;
Question: How many ingredients are needed to prepare Idaho Potato Supreme?
SQL: SELECT count(*) FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id WHERE recipe.title = 'Idaho Potato Supreme'
Database: cookbook
Note: the highest carbohydrate content refers to MAX(carbo);
Question: Provide the ingredients that are rationed in the recipe with the highest carbohydrate content.
SQL: SELECT ingredient.name FROM ingredient INNER JOIN quantity ON ingredient.ingredient_id = quantity.ingredient_id INNER JOIN nutrition ON nutrition.recipe_id = quantity.recipe_id WHERE quantity.max_qty = quantity.min_qty ORDER BY nutrition.carbo DESC LIMIT 1
Database: cookbook
Note: can lead to constipation refers to iron > 20;
Question: Name the recipes which can lead to constipation.
SQL: SELECT recipe.title FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id WHERE nutrition.iron > 20
Database: cookbook
Note: the highest vitamin that helps vision in dim light refers to MAX(vitamin_a);
Question: Describe the ingredients in the recipe with the highest vitamin that helps vision in dim light.
SQL: SELECT ingredient.name FROM ingredient INNER JOIN quantity ON ingredient.ingredient_id = quantity.ingredient_id INNER JOIN nutrition ON nutrition.recipe_id = quantity.recipe_id ORDER BY nutrition.vitamin_a DESC LIMIT 1
Database: cookbook
Note: can serve 7 people refers to servings = 7;
Question: Provide the ingredients and maximum quantities of the recipe which can serve 7 people.
SQL: SELECT ingredient.name, quantity.max_qty FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id INNER JOIN ingredient ON ingredient.ingredient_id = quantity.ingredient_id WHERE recipe.servings = 7
Database: cookbook
Note: The California Tree Fruit Agreement is a source; calculation = MULTIPLY(DIVIDE(COUNT(sodium BETWEEN 0 AND 5 THEN recipe_id), COUNT(recipe_id)), 100);
Question: Among the recipes from The California Tree Fruit Agreement, calculate the percentage of sodium-free recipes.
SQL: SELECT cast(sum(CASE WHEN nutrition.sodium < 5 THEN 1 ELSE 0 END) AS REAL) * 100 / count(*) FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id WHERE recipe.source = 'The California Tree Fruit Agreement'
Database: cookbook
Note: slices refers to unit = 'slice(s)';
Question: List the ingredients which measure in slices.
SQL: SELECT ingredient.name FROM ingredient INNER JOIN quantity ON ingredient.ingredient_id = quantity.ingredient_id WHERE quantity.unit = 'slice(s)'
Database: cookbook
Note: canned dairy is a category;
Question: How many recipes can be made with canned dairy?
SQL: SELECT count(*) FROM ingredient INNER JOIN quantity ON ingredient.ingredient_id = quantity.ingredient_id WHERE ingredient.category = 'canned dairy'
Database: cookbook
Note: total time refers to total time refers to TOTAL(prep_min, cook_min, stnd_min); lima beans is a name of an ingredient;
Question: Provide the title and total time of the recipe which can be made with only lima beans.
SQL: SELECT recipe.title, recipe.prep_min + recipe.cook_min + recipe.stnd_min FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id INNER JOIN ingredient ON ingredient.ingredient_id = quantity.ingredient_id WHERE ingredient.name = 'lima beans'
Database: cookbook
Note: sea bass is a name of an ingredient; can serve 10 people and above refers to servings >= 10; calculation = MULTIPLY(DIVIDE(COUNT(servings >= 10 THEN recipe_id)), COUNT(recipe_id), 100);
Question: Among the recipes with sea bass, how many percent of recipes can serve 10 people and above?
SQL: SELECT cast(sum(CASE WHEN recipe.servings >= 10 THEN 1 ELSE 0 END) AS REAL) * 100 / count(*) FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id INNER JOIN ingredient ON ingredient.ingredient_id = quantity.ingredient_id WHERE ingredient.name = 'sea bass steak'
Database: cookbook
Note: Raspberry Chiffon Pie refers to title;
Question: How much fat does the Raspberry Chiffon Pie have?
SQL: SELECT nutrition.total_fat FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id WHERE recipe.title = 'Raspberry Chiffon Pie'
Database: cookbook
Note: Raspberry Chiffon Pie refers title; percentage calories protein refers to pcnt_cal_prot;
Question: What is the percentage calories protein of Raspberry Chiffon Pie?
SQL: SELECT pcnt_cal_prot FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id WHERE recipe.title = 'Raspberry Chiffon Pie'
Database: cookbook
Note: Raspberry Chiffon Pie refer to title;
Question: How many ingredients are required to make the Raspberry Chiffon Pie?
SQL: SELECT count(*) FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id INNER JOIN ingredient ON ingredient.ingredient_id = quantity.ingredient_id WHERE recipe.title = 'Raspberry Chiffon Pie'
Database: cookbook
Note: alcohol free refers to alcohol = 0;
Question: List the names of alcohol free recipes.
SQL: SELECT recipe.title FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id WHERE nutrition.alcohol = 0
Database: cookbook
Note: average vitamin C refers to AVG(vitamin_c); all cakes refers to title LIKE '%cake%';
Question: What is the average vitamin C amount of all cakes?
SQL: SELECT avg(nutrition.vitamin_c) FROM nutrition INNER JOIN recipe ON recipe.recipe_id = nutrition.recipe_id WHERE recipe.title LIKE '%cake%'
Database: cookbook
Note: dairy recipes refers to category = 'dairy'; serve more than 10 people refers to servings > 10;
Question: How many dairy recipes can serve more than 10 people?
SQL: SELECT count(*) FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id INNER JOIN ingredient ON ingredient.ingredient_id = quantity.ingredient_id WHERE ingredient.category = 'dairy' AND recipe.servings > 10
Database: cookbook
Note: lead to constipation refers to iron > 20;
Question: List the names of recipes that can lead to constipation.
SQL: SELECT recipe.title FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id WHERE nutrition.iron > 20
Database: cookbook
Note: the highest calories refers to MAX(calories);
Question: Which recipe has the highest calories?
SQL: SELECT recipe.title FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id ORDER BY nutrition.calories DESC LIMIT 1
Database: cookbook
Note: non-dairy refers to category NOT LIKE '%dairy";
Question: How many recipes are non-dairy?
SQL: SELECT count(quantity.recipe_id) FROM ingredient INNER JOIN quantity ON quantity.ingredient_id = ingredient.ingredient_id INNER JOIN nutrition ON nutrition.recipe_id = quantity.recipe_id WHERE ingredient.category NOT LIKE '%dairy%'