db_id
stringclasses
68 values
question
stringlengths
24
325
evidence
stringlengths
0
580
SQL
stringlengths
23
728
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
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'
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
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
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
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
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'
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'
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
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
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'
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'
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'
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'
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'
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
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
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'
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'
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
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
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'
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)'
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
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'
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
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
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'
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
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'
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'
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
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
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'
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'
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'
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
cookbook
Among the recipes whose source is the National Potato Board, which recipe has the highest calories?
the National Potato Board is a source; the highest 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.source = 'National Potato Board' ORDER BY T2.calories DESC LIMIT 1
cookbook
Provide the title and total time of the recipe which has the highest possibility of gaining weight.
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)
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
cookbook
Which recipes contain almond extract?
almond extract is a name of an ingredient
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'
cookbook
List the ingredients in Tomato-Cucumber Relish.
Tomato-Cucumber Relish 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 = 'Tomato-Cucumber Relish'
cookbook
How many ingredients are needed to prepare Idaho Potato Supreme?
Idaho Potato Supreme refers to title
SELECT COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Idaho Potato Supreme'
cookbook
Provide the ingredients that are rationed in the recipe with the highest carbohydrate content.
the highest carbohydrate content refers to MAX(carbo)
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
cookbook
Name the recipes which can lead to constipation.
can lead to constipation 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
cookbook
Describe the ingredients in the recipe with the highest vitamin that helps vision in dim light.
the highest vitamin that helps vision in dim light refers to MAX(vitamin_a)
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
cookbook
Provide the ingredients and maximum quantities of the recipe which can serve 7 people.
can serve 7 people refers to servings = 7
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
cookbook
Among the recipes from The California Tree Fruit Agreement, calculate the percentage of sodium-free recipes.
The California Tree Fruit Agreement is a source; calculation = MULTIPLY(DIVIDE(COUNT(sodium BETWEEN 0 AND 5 THEN recipe_id), COUNT(recipe_id)), 100)
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'
cookbook
List the ingredients which measure in slices.
slices refers to unit = 'slice(s)'
SELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T2.unit = 'slice(s)'
cookbook
How many recipes can be made with canned dairy?
canned dairy is a category
SELECT COUNT(*) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T1.category = 'canned dairy'
cookbook
Provide the title and total time of the recipe which can be made with only lima beans.
total time refers to total time refers to TOTAL(prep_min, cook_min, stnd_min); lima beans is a name of an ingredient
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'
cookbook
Among the recipes with sea bass, how many percent of recipes can serve 10 people and above?
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)
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'
cookbook
How much fat does the Raspberry Chiffon Pie have?
Raspberry Chiffon Pie refers to title
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'
cookbook
What is the percentage calories protein of Raspberry Chiffon Pie?
Raspberry Chiffon Pie refers title; percentage calories protein refers to pcnt_cal_prot
SELECT pcnt_cal_prot FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Raspberry Chiffon Pie'
cookbook
How many ingredients are required to make the Raspberry Chiffon Pie?
Raspberry Chiffon Pie refer 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 = 'Raspberry Chiffon Pie'
cookbook
List the names of alcohol free recipes.
alcohol free refers to alcohol = 0
SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.alcohol = 0
cookbook
What is the average vitamin C amount of all cakes?
average vitamin C refers to AVG(vitamin_c); all cakes refers to title LIKE '%cake%'
SELECT AVG(T1.vitamin_c) FROM Nutrition AS T1 INNER JOIN Recipe AS T2 ON T2.recipe_id = T1.recipe_id WHERE T2.title LIKE '%cake%'
cookbook
How many dairy recipes can serve more than 10 people?
dairy recipes refers to category = 'dairy'; serve more than 10 people refers to servings > 10
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 = 'dairy' AND T1.servings > 10
cookbook
List the names of recipes that can lead to constipation.
lead to constipation 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
cookbook
Which recipe has the highest calories?
the highest calories refers to MAX(calories)
SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id ORDER BY T2.calories DESC LIMIT 1
cookbook
How many recipes are non-dairy?
non-dairy refers to category NOT LIKE '%dairy"
SELECT COUNT(T2.recipe_id) 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.category NOT LIKE '%dairy%'
cookbook
List all the ingredients of Apricot Yogurt Parfaits.
Apricot Yogurt Parfaits refers to title
SELECT T3.name, T3.category 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 = 'Apricot Yogurt Parfaits'
cookbook
Identify recipes with different maximum and minimum quantities.
maximum quantities refers to max_qty; minimum quantities refers to max_qty <> min_qty
SELECT T1.title FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.max_qty <> T2.min_qty
cookbook
What ingredients does the longest cooking time recipe have?
the longest cooking time refers to MAX(cook_min)
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 ORDER BY T1.cook_min DESC LIMIT 1
cookbook
Calculate the percentage of recipes with no cholesterol included and have a cooking time less than 20 minutes among all recipes.
no cholesterol refers to cholestrl = 0; cooking time less than 20 minutes refers to cook_min < 20; calculation = MULTIPLY(DIVIDE(COUNT(cholestrl = 0 THEN recipe_id), COUNT(recipe_id)), 100)
SELECT CAST(SUM(CASE WHEN T1.cook_min < 20 AND T2.cholestrl = 0 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
cookbook
Among all recipes containing cheese, what is the percentage of recipes with calories greater than 200?
cheese is a category; calories greater than 200 refers to calories > 200; calculation = MULTIPLY(DIVIDE(COUNT(calories > 200 THEN recipe_id), COUNT(recipe_id)), 100)
SELECT CAST(SUM(CASE WHEN T4.calories > 200 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 INNER JOIN Nutrition AS T4 ON T4.recipe_id = T1.recipe_id WHERE T3.category = 'cheese'
human_resources
Which employee has the highest salary? Please give his or her full name.
the highest salary refers to MAX(salary); full name = firstname, lastname
SELECT firstname, lastname FROM employee ORDER BY salary DESC LIMIT 1
human_resources
How many emplyees have a good job performance?
good job performance refers to performance = 'Good'
SELECT COUNT(*) FROM employee WHERE performance = 'Good'
human_resources
Please list the social security numbers of the male employees with a salary of over $70,000 a year.
social security numbers refers to ssn; male employees refers to gender = 'M'; salary of over $70,000 a year refers to salary > '70000'
SELECT ssn FROM employee WHERE gender = 'M' AND CAST(REPLACE(SUBSTR(salary, 4), ',', '') AS REAL) > 70000
human_resources
What is the required education for the position of regional manager?
required education refers to educationrequired; position of regional manager refers to  positiontitle = 'Regional Manager'
SELECT educationrequired FROM position WHERE positiontitle = 'Regional Manager'
human_resources
Which position has a lower minimum salary, Account Representative or Trainee?
position of Account Representative refers to positiontitle = 'Account Representative'; position of Trainee refers to positiontitle = 'Trainee'; lower minimum salary refers to MIN(minsalary)
SELECT positiontitle FROM position WHERE positiontitle = 'Account Representative' OR positiontitle = 'Trainee' ORDER BY minsalary ASC LIMIT 1
human_resources
In which city's office does Sandy Adams work at?
Sandy Adams is the fullname of an employee; full name = firstname, lastname; city refers to locationcity
SELECT T2.locationcity FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T1.lastname = 'Adams' AND T1.firstname = 'Sandy'
human_resources
Among the employees working at the office in New York, how many of them have a good job performance?
Sandy Adams is the fullname of an employee; full name = firstname, lastname; New York refers to state = 'NY'; good job performance refers to performance = 'Good';
SELECT COUNT(*) FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T2.state = 'NY' AND T1.performance = 'Good'
human_resources
What is the office phone number of the location at which Sandy Adams works?
Sandy Adams is the fullname of an employee; full name = firstname, lastname;
SELECT T2.officephone FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T1.lastname = 'Adams' AND T1.firstname = 'Sandy'
human_resources
How many male employees work at the address 450 Peachtree Rd?
male employees refers to gender = 'M'
SELECT COUNT(*) FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T2.address = '450 Peachtree Rd' AND T1.gender = 'M'
human_resources
How many employees work as an Account Representative?
work as an Account Representative refers to positiontitle = 'Account Representative'
SELECT COUNT(*) FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Account Representative'
human_resources
How much higher is James Johnson's salary from the minimum salary of his title?
James Johnson is the fullname of an employee; full name = firstname, lastname; minimum salary refers to minsalary; calculation = SUBTRACT(salary, minsalary)
SELECT CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL) - CAST(REPLACE(SUBSTR(T2.minsalary, 4), ',', '') AS REAL) AS diff FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.lastname = 'Johnson' AND T1.firstname = 'James'
human_resources
Among the employees who are Trainees, how many of them work in New York?
Trainees is a position title; California refers to state = 'NY'
SELECT COUNT(*) FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T3.positiontitle = 'Trainee' AND T2.state = 'NY'
human_resources
Please list the full names of the employees who are working as a Trainee.
full name = firstname, lastname; trainees is a position title
SELECT T1.firstname, T1.lastname FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Trainee'
human_resources
Which employee's job position requires a higher education level, Jose Rodriguez or Sandy Adams?
Jose Rodriguez AND Sandy Adams are the fullname of employee; full name = firstname, lastname; higher education level refers to MAX(educationrequired)
SELECT T1.firstname, T1.lastname FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE (T1.lastname = 'Adams' AND T1.firstname = 'Sandy') OR (T1.lastname = 'Rodriguez' AND T1.firstname = 'Jose') ORDER BY T2.educationrequired DESC LIMIT 1
human_resources
Please list the zip codes of the offices where all the male employees with a good job performance work at.
male employees refers to gender = 'M'; good job performance refers to performance = 'Good'
SELECT T2.zipcode FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T1.gender = 'M' AND T1.performance = 'Good'
human_resources
Among the employees who work as a Trainee, how many of them have a salary of over &20,000 a year?
Trainee is a position title; salary of over 20,000 refers to salary > '20000'
SELECT COUNT(*) FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL) > 20000 AND T2.positiontitle = 'Trainee'
human_resources
What is the average salary of the employees who work as a Trainee?
average = DIVIDE( SUM(salary), COUNT(positiontitle) where positiontitle = 'Trainee'; Trainee is a position title
SELECT AVG(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) AS avg FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Trainee'
human_resources
Give the number of female employees.
number of female employees means COUNT(gender = 'F')
SELECT COUNT(*) FROM employee WHERE gender = 'F'
human_resources
State the name of the city where Jose Rodriguez works.
Jose Rodriguez is the fullname of an employee; full name = firstname, lastname; name of city refers to locationcity
SELECT T2.locationcity FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T1.firstname = 'Jose' AND T1.lastname = 'Rodriguez'
human_resources
In which state does Emily Wood work?
Emily Wood is the full name of an employee; full name = firstname, lastname;
SELECT T2.state FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T1.firstname = 'Emily' AND T1.lastname = 'Wood'
human_resources
What is the education required for David Whitehead to reach his current position?
David Whitehead is the full name of an employee; full name = firstname, lastname
SELECT T2.educationrequired FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.firstname = 'David' AND T1.lastname = 'Whitehead' AND T1.gender = 'M'
human_resources
How many employees are there in the "Miami" office?
Miami office refers to locationcity = 'Miami'
SELECT COUNT(*) FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T2.locationcity = 'Miami'
human_resources
Who is the highest paid employee in "Boston"? Give the full name.
Boston refers to locationcity = 'Boston'; the highest paid employee refers to MAX(salary); full name = firstname, lastname
SELECT T1.firstname, T1.lastname FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T2.locationcity = 'Boston' ORDER BY T1.salary DESC LIMIT 1
human_resources
Who is the employee in “New York City” with a good performance? Give the social security number of the employee.
New York City refers to locationcity = 'New York City'; good performance refers to performance = 'Good'; social security number refers to ssn
SELECT T1.firstname, T1.lastname, T1.ssn FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T2.locationcity = 'New York City' AND T1.performance = 'Good'
human_resources
How many "account representatives" are there in Chicago with a good performance?
account representatives is a position title; Chicago refers to locationcity = 'Chicago'; good performance refers to performance = 'Good'
SELECT COUNT(*) FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T3.positiontitle = 'Account Representative' AND T2.locationcity = 'Chicago' AND T1.performance = 'Good'
human_resources
What is Kenneth Charles's position title?
Kenneth Charles is the full name of an employee; full name = firstname, lastname
SELECT T2.positiontitle FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.firstname = 'Kenneth' AND T1.lastname = 'Charles'
human_resources
Give the full address of the office of the highest paid manager.
the highest paid refers to MAX(salary); manager is a position title
SELECT T2.address FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T3.positiontitle = 'Manager' ORDER BY T1.salary DESC LIMIT 1
human_resources
What is the max salary for 'Tracy Coulter' if he/she stays on his/her position?
Tracy Coulter is the full name of an employee; full name = firstname, lastname
SELECT T2.maxsalary FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.firstname = 'Tracy' AND T1.lastname = 'Coulter'
human_resources
If Jose Rodriguez tried his best, how many percentage can his salary raise without changing his position?
Jose Rodriguez is the full name of an employee; full name = firstname, lastname; calculation = DIVIDE(SUBTRACT(maxsalary, salary), salary) * 100
SELECT 100 * (CAST(REPLACE(SUBSTR(T2.maxsalary, 4), ',', '') AS REAL) - CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) / CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL) AS per FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.firstname = 'Jose' AND T1.lastname = 'Rodriguez'
human_resources
How many employees whose performance is poor have a salary of over $50,000 per year?
performance is poor refers to performance = 'Poor'; salary of over $50,000 refers to salary > '50000'
SELECT COUNT(*) FROM employee WHERE performance = 'Poor' AND CAST(REPLACE(SUBSTR(salary, 4), ',', '') AS REAL) > 50000
human_resources
Who is the employee with the highest salary? Specify his/her full name.
the highest salary refers to MAX(salary); full name = firstname, lastname
SELECT firstname, lastname FROM employee WHERE CAST(REPLACE(SUBSTR(salary, 4), ',', '') AS REAL) = ( SELECT MAX(CAST(REPLACE(SUBSTR(salary, 4), ',', '') AS REAL)) FROM employee )
human_resources
How many positions have a maximum salary of no more than US$1000,000?
maximum salary of no more than US$1000,000 refers to maxsalary < '100000';
SELECT COUNT(*) FROM position WHERE CAST(REPLACE(SUBSTR(maxsalary, 4), ',', '') AS REAL) < 100000
human_resources
How much is the salary of the first ever employee that was hired?
first-ever employee that was hired refers to MIN(hiredate)
SELECT salary FROM employee ORDER BY hiredate ASC LIMIT 1
human_resources
How much is the minimum salary given to the position with the most complex work?
most complex work refers to MAX(educationrequired); minimum salary refers to minsalary
SELECT minsalary FROM position ORDER BY educationrequired DESC LIMIT 1
human_resources
What is the full office location address where most of the employees work at?
full office location address = address, locationcity, state, zipcode; location where most employees work at refers to MAX(locationID)
SELECT T2.address, T2.locationcity, T2.state, T2.zipcode FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID GROUP BY T2.address, T2.locationcity, T2.state, T2.zipcode ORDER BY COUNT(*) DESC LIMIT 1