1sf/bird-sql-train-with-schema huggingface dataset:
Database: cookbook
Tables: Ingredient, Recipe, Nutrition, Quantity
Columns (table index, column name): -1, *, 0, ingredient_id, 0, category, 0, name, 0, plural, 1, recipe_id, 1, title, 1, subtitle, 1, servings, 1, yield_unit, 1, prep_min, 1, cook_min, 1, stnd_min, 1, source, 1, intro, 1, directions, 2, recipe_id, 2, protein, 2, carbo, 2, alcohol, 2, total_fat, 2, sat_fat, 2, cholestrl, 2, sodium, 2, iron, 2, vitamin_c, 2, vitamin_a, 2, fiber, 2, pcnt_cal_carb, 2, pcnt_cal_fat, 2, pcnt_cal_prot, 2, calories, 3, quantity_id, 3, recipe_id, 3, ingredient_id, 3, max_qty, 3, min_qty, 3, unit, 3, preparation, 3, optional
Question: How many ingredients are required to make the Raspberry Chiffon Pie?
Evidence: Raspberry Chiffon Pie refer to title
SQL: 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'
Database: cookbook
Tables: Ingredient, Recipe, Nutrition, Quantity
Columns (table index, column name): -1, *, 0, ingredient_id, 0, category, 0, name, 0, plural, 1, recipe_id, 1, title, 1, subtitle, 1, servings, 1, yield_unit, 1, prep_min, 1, cook_min, 1, stnd_min, 1, source, 1, intro, 1, directions, 2, recipe_id, 2, protein, 2, carbo, 2, alcohol, 2, total_fat, 2, sat_fat, 2, cholestrl, 2, sodium, 2, iron, 2, vitamin_c, 2, vitamin_a, 2, fiber, 2, pcnt_cal_carb, 2, pcnt_cal_fat, 2, pcnt_cal_prot, 2, calories, 3, quantity_id, 3, recipe_id, 3, ingredient_id, 3, max_qty, 3, min_qty, 3, unit, 3, preparation, 3, optional
Question: List the names of alcohol free recipes.
Evidence: alcohol free refers to alcohol = 0
SQL: SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.alcohol = 0
Database: cookbook
Tables: Ingredient, Recipe, Nutrition, Quantity
Columns (table index, column name): -1, *, 0, ingredient_id, 0, category, 0, name, 0, plural, 1, recipe_id, 1, title, 1, subtitle, 1, servings, 1, yield_unit, 1, prep_min, 1, cook_min, 1, stnd_min, 1, source, 1, intro, 1, directions, 2, recipe_id, 2, protein, 2, carbo, 2, alcohol, 2, total_fat, 2, sat_fat, 2, cholestrl, 2, sodium, 2, iron, 2, vitamin_c, 2, vitamin_a, 2, fiber, 2, pcnt_cal_carb, 2, pcnt_cal_fat, 2, pcnt_cal_prot, 2, calories, 3, quantity_id, 3, recipe_id, 3, ingredient_id, 3, max_qty, 3, min_qty, 3, unit, 3, preparation, 3, optional
Question: What is the average vitamin C amount of all cakes?
Evidence: average vitamin C refers to AVG(vitamin_c); all cakes refers to title LIKE '%cake%'
SQL: 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%'
Database: cookbook
Tables: Ingredient, Recipe, Nutrition, Quantity
Columns (table index, column name): -1, *, 0, ingredient_id, 0, category, 0, name, 0, plural, 1, recipe_id, 1, title, 1, subtitle, 1, servings, 1, yield_unit, 1, prep_min, 1, cook_min, 1, stnd_min, 1, source, 1, intro, 1, directions, 2, recipe_id, 2, protein, 2, carbo, 2, alcohol, 2, total_fat, 2, sat_fat, 2, cholestrl, 2, sodium, 2, iron, 2, vitamin_c, 2, vitamin_a, 2, fiber, 2, pcnt_cal_carb, 2, pcnt_cal_fat, 2, pcnt_cal_prot, 2, calories, 3, quantity_id, 3, recipe_id, 3, ingredient_id, 3, max_qty, 3, min_qty, 3, unit, 3, preparation, 3, optional
Question: How many dairy recipes can serve more than 10 people?
Evidence: dairy recipes refers to category = 'dairy'; serve more than 10 people refers to servings > 10
SQL: 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
Database: cookbook
Tables: Ingredient, Recipe, Nutrition, Quantity
Columns (table index, column name): -1, *, 0, ingredient_id, 0, category, 0, name, 0, plural, 1, recipe_id, 1, title, 1, subtitle, 1, servings, 1, yield_unit, 1, prep_min, 1, cook_min, 1, stnd_min, 1, source, 1, intro, 1, directions, 2, recipe_id, 2, protein, 2, carbo, 2, alcohol, 2, total_fat, 2, sat_fat, 2, cholestrl, 2, sodium, 2, iron, 2, vitamin_c, 2, vitamin_a, 2, fiber, 2, pcnt_cal_carb, 2, pcnt_cal_fat, 2, pcnt_cal_prot, 2, calories, 3, quantity_id, 3, recipe_id, 3, ingredient_id, 3, max_qty, 3, min_qty, 3, unit, 3, preparation, 3, optional
Question: List the names of recipes that can lead to constipation.
Evidence: lead to constipation refers to iron > 20
SQL: SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.iron > 20
Database: cookbook
Tables: Ingredient, Recipe, Nutrition, Quantity
Columns (table index, column name): -1, *, 0, ingredient_id, 0, category, 0, name, 0, plural, 1, recipe_id, 1, title, 1, subtitle, 1, servings, 1, yield_unit, 1, prep_min, 1, cook_min, 1, stnd_min, 1, source, 1, intro, 1, directions, 2, recipe_id, 2, protein, 2, carbo, 2, alcohol, 2, total_fat, 2, sat_fat, 2, cholestrl, 2, sodium, 2, iron, 2, vitamin_c, 2, vitamin_a, 2, fiber, 2, pcnt_cal_carb, 2, pcnt_cal_fat, 2, pcnt_cal_prot, 2, calories, 3, quantity_id, 3, recipe_id, 3, ingredient_id, 3, max_qty, 3, min_qty, 3, unit, 3, preparation, 3, optional
Question: Which recipe has the highest calories?
Evidence: the highest calories refers to MAX(calories)
SQL: 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
Database: cookbook
Tables: Ingredient, Recipe, Nutrition, Quantity
Columns (table index, column name): -1, *, 0, ingredient_id, 0, category, 0, name, 0, plural, 1, recipe_id, 1, title, 1, subtitle, 1, servings, 1, yield_unit, 1, prep_min, 1, cook_min, 1, stnd_min, 1, source, 1, intro, 1, directions, 2, recipe_id, 2, protein, 2, carbo, 2, alcohol, 2, total_fat, 2, sat_fat, 2, cholestrl, 2, sodium, 2, iron, 2, vitamin_c, 2, vitamin_a, 2, fiber, 2, pcnt_cal_carb, 2, pcnt_cal_fat, 2, pcnt_cal_prot, 2, calories, 3, quantity_id, 3, recipe_id, 3, ingredient_id, 3, max_qty, 3, min_qty, 3, unit, 3, preparation, 3, optional
Question: How many recipes are non-dairy?
Evidence: non-dairy refers to category NOT LIKE '%dairy"
SQL: 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%'
Database: cookbook
Tables: Ingredient, Recipe, Nutrition, Quantity
Columns (table index, column name): -1, *, 0, ingredient_id, 0, category, 0, name, 0, plural, 1, recipe_id, 1, title, 1, subtitle, 1, servings, 1, yield_unit, 1, prep_min, 1, cook_min, 1, stnd_min, 1, source, 1, intro, 1, directions, 2, recipe_id, 2, protein, 2, carbo, 2, alcohol, 2, total_fat, 2, sat_fat, 2, cholestrl, 2, sodium, 2, iron, 2, vitamin_c, 2, vitamin_a, 2, fiber, 2, pcnt_cal_carb, 2, pcnt_cal_fat, 2, pcnt_cal_prot, 2, calories, 3, quantity_id, 3, recipe_id, 3, ingredient_id, 3, max_qty, 3, min_qty, 3, unit, 3, preparation, 3, optional
Question: List all the ingredients of Apricot Yogurt Parfaits.
Evidence: Apricot Yogurt Parfaits refers to title
SQL: 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'
Database: cookbook
Tables: Ingredient, Recipe, Nutrition, Quantity
Columns (table index, column name): -1, *, 0, ingredient_id, 0, category, 0, name, 0, plural, 1, recipe_id, 1, title, 1, subtitle, 1, servings, 1, yield_unit, 1, prep_min, 1, cook_min, 1, stnd_min, 1, source, 1, intro, 1, directions, 2, recipe_id, 2, protein, 2, carbo, 2, alcohol, 2, total_fat, 2, sat_fat, 2, cholestrl, 2, sodium, 2, iron, 2, vitamin_c, 2, vitamin_a, 2, fiber, 2, pcnt_cal_carb, 2, pcnt_cal_fat, 2, pcnt_cal_prot, 2, calories, 3, quantity_id, 3, recipe_id, 3, ingredient_id, 3, max_qty, 3, min_qty, 3, unit, 3, preparation, 3, optional
Question: Identify recipes with different maximum and minimum quantities.
Evidence: maximum quantities refers to max_qty; minimum quantities refers to max_qty <> min_qty
SQL: 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
Database: cookbook
Tables: Ingredient, Recipe, Nutrition, Quantity
Columns (table index, column name): -1, *, 0, ingredient_id, 0, category, 0, name, 0, plural, 1, recipe_id, 1, title, 1, subtitle, 1, servings, 1, yield_unit, 1, prep_min, 1, cook_min, 1, stnd_min, 1, source, 1, intro, 1, directions, 2, recipe_id, 2, protein, 2, carbo, 2, alcohol, 2, total_fat, 2, sat_fat, 2, cholestrl, 2, sodium, 2, iron, 2, vitamin_c, 2, vitamin_a, 2, fiber, 2, pcnt_cal_carb, 2, pcnt_cal_fat, 2, pcnt_cal_prot, 2, calories, 3, quantity_id, 3, recipe_id, 3, ingredient_id, 3, max_qty, 3, min_qty, 3, unit, 3, preparation, 3, optional
Question: What ingredients does the longest cooking time recipe have?
Evidence: the longest cooking time refers to MAX(cook_min)
SQL: 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
Database: cookbook
Tables: Ingredient, Recipe, Nutrition, Quantity
Columns (table index, column name): -1, *, 0, ingredient_id, 0, category, 0, name, 0, plural, 1, recipe_id, 1, title, 1, subtitle, 1, servings, 1, yield_unit, 1, prep_min, 1, cook_min, 1, stnd_min, 1, source, 1, intro, 1, directions, 2, recipe_id, 2, protein, 2, carbo, 2, alcohol, 2, total_fat, 2, sat_fat, 2, cholestrl, 2, sodium, 2, iron, 2, vitamin_c, 2, vitamin_a, 2, fiber, 2, pcnt_cal_carb, 2, pcnt_cal_fat, 2, pcnt_cal_prot, 2, calories, 3, quantity_id, 3, recipe_id, 3, ingredient_id, 3, max_qty, 3, min_qty, 3, unit, 3, preparation, 3, optional
Question: Calculate the percentage of recipes with no cholesterol included and have a cooking time less than 20 minutes among all recipes.
Evidence: 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)
SQL: 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
Database: cookbook
Tables: Ingredient, Recipe, Nutrition, Quantity
Columns (table index, column name): -1, *, 0, ingredient_id, 0, category, 0, name, 0, plural, 1, recipe_id, 1, title, 1, subtitle, 1, servings, 1, yield_unit, 1, prep_min, 1, cook_min, 1, stnd_min, 1, source, 1, intro, 1, directions, 2, recipe_id, 2, protein, 2, carbo, 2, alcohol, 2, total_fat, 2, sat_fat, 2, cholestrl, 2, sodium, 2, iron, 2, vitamin_c, 2, vitamin_a, 2, fiber, 2, pcnt_cal_carb, 2, pcnt_cal_fat, 2, pcnt_cal_prot, 2, calories, 3, quantity_id, 3, recipe_id, 3, ingredient_id, 3, max_qty, 3, min_qty, 3, unit, 3, preparation, 3, optional
Question: Among all recipes containing cheese, what is the percentage of recipes with calories greater than 200?
Evidence: 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)
SQL: 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'
Database: human_resources
Tables: location, position, employee
Columns (table index, column name): -1, *, 0, locationID, 0, locationcity, 0, address, 0, state, 0, zipcode, 0, officephone, 1, positionID, 1, positiontitle, 1, educationrequired, 1, minsalary, 1, maxsalary, 2, ssn, 2, lastname, 2, firstname, 2, hiredate, 2, salary, 2, gender, 2, performance, 2, positionID, 2, locationID
Question: Which employee has the highest salary? Please give his or her full name.
Evidence: the highest salary refers to MAX(salary); full name = firstname, lastname
SQL: SELECT firstname, lastname FROM employee ORDER BY salary DESC LIMIT 1
Database: human_resources
Tables: location, position, employee
Columns (table index, column name): -1, *, 0, locationID, 0, locationcity, 0, address, 0, state, 0, zipcode, 0, officephone, 1, positionID, 1, positiontitle, 1, educationrequired, 1, minsalary, 1, maxsalary, 2, ssn, 2, lastname, 2, firstname, 2, hiredate, 2, salary, 2, gender, 2, performance, 2, positionID, 2, locationID
Question: How many emplyees have a good job performance?
Evidence: good job performance refers to performance = 'Good'
SQL: SELECT COUNT(*) FROM employee WHERE performance = 'Good'
Database: human_resources
Tables: location, position, employee
Columns (table index, column name): -1, *, 0, locationID, 0, locationcity, 0, address, 0, state, 0, zipcode, 0, officephone, 1, positionID, 1, positiontitle, 1, educationrequired, 1, minsalary, 1, maxsalary, 2, ssn, 2, lastname, 2, firstname, 2, hiredate, 2, salary, 2, gender, 2, performance, 2, positionID, 2, locationID
Question: Please list the social security numbers of the male employees with a salary of over $70,000 a year.
Evidence: social security numbers refers to ssn; male employees refers to gender = 'M'; salary of over $70,000 a year refers to salary > '70000'
SQL: SELECT ssn FROM employee WHERE gender = 'M' AND CAST(REPLACE(SUBSTR(salary, 4), ',', '') AS REAL) > 70000
Database: human_resources
Tables: location, position, employee
Columns (table index, column name): -1, *, 0, locationID, 0, locationcity, 0, address, 0, state, 0, zipcode, 0, officephone, 1, positionID, 1, positiontitle, 1, educationrequired, 1, minsalary, 1, maxsalary, 2, ssn, 2, lastname, 2, firstname, 2, hiredate, 2, salary, 2, gender, 2, performance, 2, positionID, 2, locationID
Question: What is the required education for the position of regional manager?
Evidence: required education refers to educationrequired; position of regional manager refers to  positiontitle = 'Regional Manager'
SQL: SELECT educationrequired FROM position WHERE positiontitle = 'Regional Manager'
Database: human_resources
Tables: location, position, employee
Columns (table index, column name): -1, *, 0, locationID, 0, locationcity, 0, address, 0, state, 0, zipcode, 0, officephone, 1, positionID, 1, positiontitle, 1, educationrequired, 1, minsalary, 1, maxsalary, 2, ssn, 2, lastname, 2, firstname, 2, hiredate, 2, salary, 2, gender, 2, performance, 2, positionID, 2, locationID
Question: Which position has a lower minimum salary, Account Representative or Trainee?
Evidence: position of Account Representative refers to positiontitle = 'Account Representative'; position of Trainee refers to positiontitle = 'Trainee'; lower minimum salary refers to MIN(minsalary)
SQL: SELECT positiontitle FROM position WHERE positiontitle = 'Account Representative' OR positiontitle = 'Trainee' ORDER BY minsalary ASC LIMIT 1
Database: human_resources
Tables: location, position, employee
Columns (table index, column name): -1, *, 0, locationID, 0, locationcity, 0, address, 0, state, 0, zipcode, 0, officephone, 1, positionID, 1, positiontitle, 1, educationrequired, 1, minsalary, 1, maxsalary, 2, ssn, 2, lastname, 2, firstname, 2, hiredate, 2, salary, 2, gender, 2, performance, 2, positionID, 2, locationID
Question: In which city's office does Sandy Adams work at?
Evidence: Sandy Adams is the fullname of an employee; full name = firstname, lastname; city refers to locationcity
SQL: 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'
Database: human_resources
Tables: location, position, employee
Columns (table index, column name): -1, *, 0, locationID, 0, locationcity, 0, address, 0, state, 0, zipcode, 0, officephone, 1, positionID, 1, positiontitle, 1, educationrequired, 1, minsalary, 1, maxsalary, 2, ssn, 2, lastname, 2, firstname, 2, hiredate, 2, salary, 2, gender, 2, performance, 2, positionID, 2, locationID
Question: Among the employees working at the office in New York, how many of them have a good job performance?
Evidence: 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';
SQL: SELECT COUNT(*) FROM employee AS T1 INNER JOIN location AS T2  ON T1.locationID = T2.locationID WHERE T2.state = 'NY' AND T1.performance = 'Good'
Database: human_resources
Tables: location, position, employee
Columns (table index, column name): -1, *, 0, locationID, 0, locationcity, 0, address, 0, state, 0, zipcode, 0, officephone, 1, positionID, 1, positiontitle, 1, educationrequired, 1, minsalary, 1, maxsalary, 2, ssn, 2, lastname, 2, firstname, 2, hiredate, 2, salary, 2, gender, 2, performance, 2, positionID, 2, locationID
Question: What is the office phone number of the location at which Sandy Adams works?
Evidence: Sandy Adams is the fullname of an employee; full name = firstname, lastname;
SQL: 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'
Database: human_resources
Tables: location, position, employee
Columns (table index, column name): -1, *, 0, locationID, 0, locationcity, 0, address, 0, state, 0, zipcode, 0, officephone, 1, positionID, 1, positiontitle, 1, educationrequired, 1, minsalary, 1, maxsalary, 2, ssn, 2, lastname, 2, firstname, 2, hiredate, 2, salary, 2, gender, 2, performance, 2, positionID, 2, locationID
Question: How many male employees work at the address 450 Peachtree Rd?
Evidence: male employees refers to gender = 'M'
SQL: 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'
Database: human_resources
Tables: location, position, employee
Columns (table index, column name): -1, *, 0, locationID, 0, locationcity, 0, address, 0, state, 0, zipcode, 0, officephone, 1, positionID, 1, positiontitle, 1, educationrequired, 1, minsalary, 1, maxsalary, 2, ssn, 2, lastname, 2, firstname, 2, hiredate, 2, salary, 2, gender, 2, performance, 2, positionID, 2, locationID
Question: How many employees work as an Account Representative?
Evidence: work as an Account Representative refers to positiontitle = 'Account Representative'
SQL: SELECT COUNT(*) FROM employee AS T1  INNER JOIN position AS T2  ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Account Representative'
Database: human_resources
Tables: location, position, employee
Columns (table index, column name): -1, *, 0, locationID, 0, locationcity, 0, address, 0, state, 0, zipcode, 0, officephone, 1, positionID, 1, positiontitle, 1, educationrequired, 1, minsalary, 1, maxsalary, 2, ssn, 2, lastname, 2, firstname, 2, hiredate, 2, salary, 2, gender, 2, performance, 2, positionID, 2, locationID
Question: How much higher is James Johnson's salary from the minimum salary of his title?
Evidence: James Johnson is the fullname of an employee; full name = firstname, lastname; minimum salary refers to minsalary; calculation = SUBTRACT(salary, minsalary)
SQL: 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'
Database: human_resources
Tables: location, position, employee
Columns (table index, column name): -1, *, 0, locationID, 0, locationcity, 0, address, 0, state, 0, zipcode, 0, officephone, 1, positionID, 1, positiontitle, 1, educationrequired, 1, minsalary, 1, maxsalary, 2, ssn, 2, lastname, 2, firstname, 2, hiredate, 2, salary, 2, gender, 2, performance, 2, positionID, 2, locationID
Question: Among the employees who are Trainees, how many of them work in New York?
Evidence: Trainees is a position title; California refers to state = 'NY'
SQL: 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'
Database: human_resources
Tables: location, position, employee
Columns (table index, column name): -1, *, 0, locationID, 0, locationcity, 0, address, 0, state, 0, zipcode, 0, officephone, 1, positionID, 1, positiontitle, 1, educationrequired, 1, minsalary, 1, maxsalary, 2, ssn, 2, lastname, 2, firstname, 2, hiredate, 2, salary, 2, gender, 2, performance, 2, positionID, 2, locationID
Question: Please list the full names of the employees who are working as a Trainee.
Evidence: full name = firstname, lastname; trainees is a position title
SQL: SELECT T1.firstname, T1.lastname FROM employee AS T1  INNER JOIN position AS T2  ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Trainee'
Database: human_resources
Tables: location, position, employee
Columns (table index, column name): -1, *, 0, locationID, 0, locationcity, 0, address, 0, state, 0, zipcode, 0, officephone, 1, positionID, 1, positiontitle, 1, educationrequired, 1, minsalary, 1, maxsalary, 2, ssn, 2, lastname, 2, firstname, 2, hiredate, 2, salary, 2, gender, 2, performance, 2, positionID, 2, locationID
Question: Which employee's job position requires a higher education level, Jose Rodriguez or Sandy Adams?
Evidence: Jose Rodriguez AND Sandy Adams are the fullname of employee; full name = firstname, lastname; higher education level refers to MAX(educationrequired)
SQL: 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
Database: human_resources
Tables: location, position, employee
Columns (table index, column name): -1, *, 0, locationID, 0, locationcity, 0, address, 0, state, 0, zipcode, 0, officephone, 1, positionID, 1, positiontitle, 1, educationrequired, 1, minsalary, 1, maxsalary, 2, ssn, 2, lastname, 2, firstname, 2, hiredate, 2, salary, 2, gender, 2, performance, 2, positionID, 2, locationID
Question: Please list the zip codes of the offices where all the male employees with a good job performance work at.
Evidence: male employees refers to gender = 'M'; good job performance refers to performance = 'Good'
SQL: 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'
Database: human_resources
Tables: location, position, employee
Columns (table index, column name): -1, *, 0, locationID, 0, locationcity, 0, address, 0, state, 0, zipcode, 0, officephone, 1, positionID, 1, positiontitle, 1, educationrequired, 1, minsalary, 1, maxsalary, 2, ssn, 2, lastname, 2, firstname, 2, hiredate, 2, salary, 2, gender, 2, performance, 2, positionID, 2, locationID
Question: Please list the social security numbers of all the employees who work in California.
Evidence: social security numbers refers to ssn; California refers to state = 'CA'
SQL: SELECT T1.ssn FROM employee AS T1  INNER JOIN location AS T2  ON T1.locationID = T2.locationID WHERE T2.state = 'CA'
Database: human_resources
Tables: location, position, employee
Columns (table index, column name): -1, *, 0, locationID, 0, locationcity, 0, address, 0, state, 0, zipcode, 0, officephone, 1, positionID, 1, positiontitle, 1, educationrequired, 1, minsalary, 1, maxsalary, 2, ssn, 2, lastname, 2, firstname, 2, hiredate, 2, salary, 2, gender, 2, performance, 2, positionID, 2, locationID
Question: Among the employees who work as a Trainee, how many of them have a salary of over &20,000 a year?
Evidence: Trainee is a position title; salary of over 20,000 refers to salary > '20000'
SQL: 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'