Chinastark/bird_dataset huggingface dataset:
Database: cookbook
Note: Apricot Yogurt Parfaits refers to title;
Question: List all the ingredients of Apricot Yogurt Parfaits.
SQL: SELECT ingredient.name, ingredient.category 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 = 'Apricot Yogurt Parfaits'
Database: cookbook
Note: maximum quantities refers to max_qty; minimum quantities refers to max_qty <> min_qty;
Question: Identify recipes with different maximum and minimum quantities.
SQL: SELECT recipe.title FROM recipe INNER JOIN quantity ON recipe.recipe_id = quantity.recipe_id WHERE quantity.max_qty <> quantity.min_qty
Database: cookbook
Note: the longest cooking time refers to MAX(cook_min);
Question: What ingredients does the longest cooking time recipe have?
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 ORDER BY recipe.cook_min DESC LIMIT 1
Database: cookbook
Note: 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);
Question: Calculate the percentage of recipes with no cholesterol included and have a cooking time less than 20 minutes among all recipes.
SQL: SELECT cast(sum(CASE WHEN recipe.cook_min < 20 AND nutrition.cholestrl = 0 THEN 1 ELSE 0 END) AS REAL) * 100 / count(*) FROM recipe INNER JOIN nutrition ON recipe.recipe_id = nutrition.recipe_id
Database: cookbook
Note: 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);
Question: Among all recipes containing cheese, what is the percentage of recipes with calories greater than 200?
SQL: SELECT cast(sum(CASE WHEN nutrition.calories > 200 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 INNER JOIN nutrition ON nutrition.recipe_id = recipe.recipe_id WHERE ingredient.category = 'cheese'
Database: human_resources
Note: the highest salary refers to MAX(salary); full name = firstname, lastname;
Question: Which employee has the highest salary? Please give his or her full name.
SQL: SELECT firstname, lastname FROM employee ORDER BY salary DESC LIMIT 1
Database: human_resources
Note: good job performance refers to performance = 'Good';
Question: How many emplyees have a good job performance?
SQL: SELECT count(*) FROM employee WHERE performance = 'Good'
Database: human_resources
Note: social security numbers refers to ssn; male employees refers to gender = 'M'; salary of over $70,000 a year refers to salary > '70000';
Question: Please list the social security numbers of the male employees with a salary of over $70,000 a year.
SQL: SELECT ssn FROM employee WHERE gender = 'M' AND cast(replace(substr(salary, 4), ',', '') AS REAL) > 70000
Database: human_resources
Note: required education refers to educationrequired; position of regional manager refers to  positiontitle = 'Regional Manager';
Question: What is the required education for the position of regional manager?
SQL: SELECT educationrequired FROM POSITION WHERE positiontitle = 'Regional Manager'
Database: human_resources
Note: position of Account Representative refers to positiontitle = 'Account Representative'; position of Trainee refers to positiontitle = 'Trainee'; lower minimum salary refers to MIN(minsalary);
Question: Which position has a lower minimum salary, Account Representative or Trainee?
SQL: SELECT positiontitle FROM POSITION WHERE positiontitle = 'Account Representative' OR positiontitle = 'Trainee' ORDER BY minsalary ASC LIMIT 1
Database: human_resources
Note: Sandy Adams is the fullname of an employee; full name = firstname, lastname; city refers to locationcity;
Question: In which city's office does Sandy Adams work at?
SQL: SELECT LOCATION.locationcity FROM employee  INNER JOIN LOCATION  ON employee.locationid = LOCATION.locationid WHERE employee.lastname = 'Adams' AND employee.firstname = 'Sandy'
Database: human_resources
Note: 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';
Question: Among the employees working at the office in New York, how many of them have a good job performance?
SQL: SELECT count(*) FROM employee INNER JOIN LOCATION  ON employee.locationid = LOCATION.locationid WHERE LOCATION.state = 'NY' AND employee.performance = 'Good'
Database: human_resources
Note: Sandy Adams is the fullname of an employee; full name = firstname, lastname;
Question: What is the office phone number of the location at which Sandy Adams works?
SQL: SELECT LOCATION.officephone FROM employee  INNER JOIN LOCATION  ON employee.locationid = LOCATION.locationid WHERE employee.lastname = 'Adams' AND employee.firstname = 'Sandy'
Database: human_resources
Note: male employees refers to gender = 'M';
Question: How many male employees work at the address 450 Peachtree Rd?
SQL: SELECT count(*) FROM employee  INNER JOIN LOCATION  ON employee.locationid = LOCATION.locationid WHERE LOCATION.address = '450 Peachtree Rd' AND employee.gender = 'M'
Database: human_resources
Note: work as an Account Representative refers to positiontitle = 'Account Representative';
Question: How many employees work as an Account Representative?
SQL: SELECT count(*) FROM employee  INNER JOIN POSITION  ON employee.positionid = POSITION.positionid WHERE POSITION.positiontitle = 'Account Representative'
Database: human_resources
Note: James Johnson is the fullname of an employee; full name = firstname, lastname; minimum salary refers to minsalary; calculation = SUBTRACT(salary, minsalary);
Question: How much higher is James Johnson's salary from the minimum salary of his title?
SQL: SELECT cast(replace(substr(employee.salary, 4), ',', '') AS REAL) - cast(replace(substr(POSITION.minsalary, 4), ',', '') AS REAL) AS diff FROM employee  INNER JOIN POSITION  ON employee.positionid = POSITION.positionid WHERE employee.lastname = 'Johnson' AND employee.firstname = 'James'
Database: human_resources
Note: Trainees is a position title; California refers to state = 'NY';
Question: Among the employees who are Trainees, how many of them work in New York?
SQL: SELECT count(*) FROM employee  INNER JOIN LOCATION  ON employee.locationid = LOCATION.locationid INNER JOIN POSITION  ON POSITION.positionid = employee.positionid WHERE POSITION.positiontitle = 'Trainee' AND LOCATION.state = 'NY'
Database: human_resources
Note: full name = firstname, lastname; trainees is a position title;
Question: Please list the full names of the employees who are working as a Trainee.
SQL: SELECT employee.firstname, employee.lastname FROM employee  INNER JOIN POSITION  ON employee.positionid = POSITION.positionid WHERE POSITION.positiontitle = 'Trainee'
Database: human_resources
Note: Jose Rodriguez AND Sandy Adams are the fullname of employee; full name = firstname, lastname; higher education level refers to MAX(educationrequired);
Question: Which employee's job position requires a higher education level, Jose Rodriguez or Sandy Adams?
SQL: SELECT employee.firstname, employee.lastname FROM employee  INNER JOIN POSITION  ON employee.positionid = POSITION.positionid WHERE (employee.lastname = 'Adams' AND employee.firstname = 'Sandy') OR (employee.lastname = 'Rodriguez' AND employee.firstname = 'Jose') ORDER BY POSITION.educationrequired DESC LIMIT 1
Database: human_resources
Note: male employees refers to gender = 'M'; good job performance refers to performance = 'Good';
Question: Please list the zip codes of the offices where all the male employees with a good job performance work at.
SQL: SELECT LOCATION.zipcode FROM employee  INNER JOIN LOCATION  ON employee.locationid = LOCATION.locationid WHERE employee.gender = 'M' AND employee.performance = 'Good'
Database: human_resources
Note: social security numbers refers to ssn; California refers to state = 'CA';
Question: Please list the social security numbers of all the employees who work in California.
SQL: SELECT employee.ssn FROM employee  INNER JOIN LOCATION  ON employee.locationid = LOCATION.locationid WHERE LOCATION.state = 'CA'
Database: human_resources
Note: Trainee is a position title; salary of over 20,000 refers to salary > '20000';
Question: Among the employees who work as a Trainee, how many of them have a salary of over &20,000 a year?
SQL: SELECT count(*) FROM employee  INNER JOIN POSITION  ON employee.positionid = POSITION.positionid WHERE cast(replace(substr(employee.salary, 4), ',', '') AS REAL) > 20000 AND POSITION.positiontitle = 'Trainee'
Database: human_resources
Note: average = DIVIDE( SUM(salary), COUNT(positiontitle) where positiontitle = 'Trainee'; Trainee is a position title;
Question: What is the average salary of the employees who work as a Trainee?
SQL: SELECT avg(cast(replace(substr(employee.salary, 4), ',', '') AS REAL)) AS AVG FROM employee  INNER JOIN POSITION  ON employee.positionid = POSITION.positionid WHERE POSITION.positiontitle = 'Trainee'
Database: human_resources
Note: AVG(salary); Trainee is a position title; minimum salary refers to minsalary; calculation = DIVIDE(SUBTRACT(AVG(salary), minsalary), minsalary) * 100;
Question: By what percentage is the average salary of Trainees higher than the minimum salary of this postion?
SQL: SELECT 100 * (avg(cast(replace(substr(employee.salary, 4), ',', '') AS REAL)) - cast(replace(substr(POSITION.minsalary, 4), ',', '') AS REAL)) / cast(replace(substr(POSITION.minsalary, 4), ',', '') AS REAL) AS per FROM employee  INNER JOIN POSITION  ON employee.positionid = POSITION.positionid WHERE POSITION.positiontitle = 'Trainee'
Database: human_resources
Note: number of female employees means COUNT(gender = 'F');
Question: Give the number of female employees.
SQL: SELECT count(*) FROM employee WHERE gender = 'F'
Database: human_resources
Note: Jose Rodriguez is the fullname of an employee; full name = firstname, lastname; name of city refers to locationcity;
Question: State the name of the city where Jose Rodriguez works.
SQL: SELECT LOCATION.locationcity FROM employee  INNER JOIN LOCATION  ON employee.locationid = LOCATION.locationid WHERE employee.firstname = 'Jose' AND employee.lastname = 'Rodriguez'
Database: human_resources
Note: Emily Wood is the full name of an employee; full name = firstname, lastname;
Question: In which state does Emily Wood work?
SQL: SELECT LOCATION.state FROM employee  INNER JOIN LOCATION  ON employee.locationid = LOCATION.locationid WHERE employee.firstname = 'Emily' AND employee.lastname = 'Wood'
Database: human_resources
Note: David Whitehead is the full name of an employee; full name = firstname, lastname;
Question: What is the education required for David Whitehead to reach his current position?
SQL: SELECT POSITION.educationrequired FROM employee  INNER JOIN POSITION  ON employee.positionid = POSITION.positionid WHERE employee.firstname = 'David' AND employee.lastname = 'Whitehead' AND employee.gender = 'M'
Database: human_resources
Note: Miami office refers to locationcity = 'Miami';
Question: How many employees are there in the "Miami" office?
SQL: SELECT count(*) FROM employee  INNER JOIN LOCATION  ON employee.locationid = LOCATION.locationid WHERE LOCATION.locationcity = 'Miami'
Database: human_resources
Note: Boston refers to locationcity = 'Boston'; the highest paid employee refers to MAX(salary); full name = firstname, lastname;
Question: Who is the highest paid employee in "Boston"? Give the full name.
SQL: SELECT employee.firstname, employee.lastname FROM employee  INNER JOIN LOCATION  ON employee.locationid = LOCATION.locationid WHERE LOCATION.locationcity = 'Boston' ORDER BY employee.salary DESC LIMIT 1
Database: human_resources
Note: New York City refers to locationcity = 'New York City'; good performance refers to performance = 'Good'; social security number refers to ssn;
Question: Who is the employee in “New York City” with a good performance? Give the social security number of the employee.
SQL: SELECT employee.firstname, employee.lastname, employee.ssn FROM employee  INNER JOIN LOCATION  ON employee.locationid = LOCATION.locationid WHERE LOCATION.locationcity = 'New York City' AND employee.performance = 'Good'
Database: human_resources
Note: account representatives is a position title; Chicago refers to locationcity = 'Chicago'; good performance refers to performance = 'Good';
Question: How many "account representatives" are there in Chicago with a good performance?
SQL: SELECT count(*) FROM employee  INNER JOIN LOCATION  ON employee.locationid = LOCATION.locationid INNER JOIN POSITION  ON POSITION.positionid = employee.positionid WHERE POSITION.positiontitle = 'Account Representative' AND LOCATION.locationcity = 'Chicago' AND employee.performance = 'Good'
Database: human_resources
Note: Kenneth Charles is the full name of an employee; full name = firstname, lastname;
Question: What is Kenneth Charles's position title?
SQL: SELECT POSITION.positiontitle FROM employee  INNER JOIN POSITION  ON employee.positionid = POSITION.positionid WHERE employee.firstname = 'Kenneth' AND employee.lastname = 'Charles'
Database: human_resources
Note: the highest paid refers to MAX(salary); manager is a position title;
Question: Give the full address of the office of the highest paid manager.
SQL: SELECT LOCATION.address FROM employee  INNER JOIN LOCATION  ON employee.locationid = LOCATION.locationid INNER JOIN POSITION  ON POSITION.positionid = employee.positionid WHERE POSITION.positiontitle = 'Manager' ORDER BY employee.salary DESC LIMIT 1
Database: human_resources
Note: Tracy Coulter is the full name of an employee; full name = firstname, lastname;
Question: What is the max salary for 'Tracy Coulter' if he/she stays on his/her position?
SQL: SELECT POSITION.maxsalary FROM employee  INNER JOIN POSITION  ON employee.positionid = POSITION.positionid WHERE employee.firstname = 'Tracy' AND employee.lastname = 'Coulter'
Database: human_resources
Note: Jose Rodriguez is the full name of an employee; full name = firstname, lastname; calculation = DIVIDE(SUBTRACT(maxsalary, salary), salary) * 100;
Question: If Jose Rodriguez tried his best, how many percentage can his salary raise without changing his position?
SQL: SELECT 100 * (cast(replace(substr(POSITION.maxsalary, 4), ',', '') AS REAL) - cast(replace(substr(employee.salary, 4), ',', '') AS REAL)) / cast(replace(substr(employee.salary, 4), ',', '') AS REAL) AS per FROM employee  INNER JOIN POSITION  ON employee.positionid = POSITION.positionid WHERE employee.firstname = 'Jose' AND employee.lastname = 'Rodriguez'
Database: human_resources
Note: performance is poor refers to performance = 'Poor'; salary of over $50,000 refers to salary > '50000';
Question: How many employees whose performance is poor have a salary of over $50,000 per year?
SQL: SELECT count(*) FROM employee WHERE performance = 'Poor' AND cast(replace(substr(salary, 4), ',', '') AS REAL) > 50000
Database: human_resources
Note: the highest salary refers to MAX(salary); full name = firstname, lastname;
Question: Who is the employee with the highest salary? Specify his/her full name.
SQL: SELECT firstname, lastname FROM employee WHERE cast(replace(substr(salary, 4), ',', '') AS REAL) = ( SELECT max(cast(replace(substr(salary, 4), ',', '') AS REAL)) FROM employee )
Database: human_resources
Note: maximum salary of no more than US$1000,000 refers to maxsalary < '100000';
Question: How many positions have a maximum salary of no more than US$1000,000?
SQL: SELECT count(*) FROM POSITION WHERE cast(replace(substr(maxsalary, 4), ',', '') AS REAL) < 100000
Database: human_resources
Note: first-ever employee that was hired refers to MIN(hiredate);
Question: How much is the salary of the first ever employee that was hired?
SQL: SELECT salary FROM employee ORDER BY hiredate ASC LIMIT 1
Database: human_resources
Note: most complex work refers to MAX(educationrequired); minimum salary refers to minsalary;
Question: How much is the minimum salary given to the position with the most complex work?
SQL: SELECT minsalary FROM POSITION ORDER BY educationrequired DESC LIMIT 1
Database: human_resources
Note: full office location address = address, locationcity, state, zipcode; location where most employees work at refers to MAX(locationid);
Question: What is the full office location address where most of the employees work at?
SQL: SELECT LOCATION.address, LOCATION.locationcity, LOCATION.state, LOCATION.zipcode FROM employee  INNER JOIN LOCATION  ON employee.locationid = LOCATION.locationid GROUP BY LOCATION.address, LOCATION.locationcity, LOCATION.state, LOCATION.zipcode ORDER BY count(*) DESC LIMIT 1
Database: human_resources
Note: 2 year degree refers to educationrequired = '2 year degree'; calculation = DIVIDE(SUM(salary), COUNT(positiontitle));
Question: What is the average salary of all employees with a 2 year degree position?
SQL: SELECT avg(cast(replace(substr(employee.salary, 4), ',', '') AS REAL)) FROM employee  INNER JOIN POSITION  ON employee.positionid = POSITION.positionid WHERE POSITION.educationrequired = '2 year degree'
Database: human_resources
Note: male refers to gender = 'M'; Regional Managers is a position title;
Question: How many male Regional Managers are there?
SQL: SELECT count(*) FROM employee  INNER JOIN POSITION  ON employee.positionid = POSITION.positionid WHERE POSITION.positiontitle = 'Regional Manager' AND employee.gender = 'M'
Database: human_resources
Note: poor performing employees refers to performance = 'Poor'; the highest amount of employees refers to MAX(positiontitle);
Question: Which position has the highest amount of poor performing employees?
SQL: SELECT POSITION.positiontitle FROM employee  INNER JOIN POSITION  ON employee.positionid = POSITION.positionid WHERE employee.performance = 'Poor' GROUP BY POSITION.positiontitle ORDER BY count(POSITION.positiontitle) DESC LIMIT 1
Database: human_resources
Note: 2 year degree refers to educationrequired = '2 year degree'; female refers to gender = 'F'; the highest number of employees refers to MAX(positionid);
Question: Which position has the highest number of female employees with a 2 year degree?
SQL: SELECT POSITION.positiontitle FROM employee  INNER JOIN POSITION  ON employee.positionid = POSITION.positionid WHERE POSITION.educationrequired = '2 year degree' AND employee.gender = 'F' GROUP BY POSITION.positiontitle ORDER BY count(POSITION.positiontitle) DESC LIMIT 1
Database: human_resources
Note: Account Representatives is a position title; satisfying performance mostly refers togood performance;
Question: How many Account Representatives are there in Illinois with satisfying performance?
SQL: SELECT count(*) FROM employee  INNER JOIN LOCATION  ON employee.locationid = LOCATION.locationid INNER JOIN POSITION  ON POSITION.positionid = employee.positionid WHERE POSITION.positiontitle = 'Account Representative' AND employee.performance = 'Good' AND LOCATION.state = 'IL'
Database: human_resources
Note: the worst performing refers to performance = 'Poor'; manager is a positiontitle; average salary refers to AVG(salary);
Question: What is the average salary of the worst performing managers?
SQL: SELECT avg(cast(replace(substr(employee.salary, 4), ',', '') AS REAL)) FROM employee INNER JOIN POSITION  ON employee.positionid = POSITION.positionid WHERE employee.performance = 'Poor' AND POSITION.positiontitle = 'Manager'
Database: human_resources
Note: good performing refers to performance = 'Good'; Account Representatives is a positiontitle; highest amount of employee refers to MAX(positionid);
Question: In which state can you find the highest amount of good performing Account Representatives?
SQL: SELECT LOCATION.state FROM employee  INNER JOIN LOCATION  ON employee.locationid = LOCATION.locationid INNER JOIN POSITION  ON POSITION.positionid = employee.positionid WHERE POSITION.positiontitle = 'Account Representative' AND employee.performance = 'Good' GROUP BY LOCATION.state ORDER BY count(LOCATION.state) DESC LIMIT 1
Database: human_resources
Note: full name = firstname, lastname; the lowest salary refers to MIN(salary);
Question: Mention the employee's full name and performance status who got the lowest in salary per year.
SQL: SELECT firstname, lastname, performance FROM employee ORDER BY salary ASC LIMIT 1
Database: human_resources
Note: Western states refers to state = 'CO' OR state = 'UT' OR state = 'CA'; location cities refers to locationcity;
Question: List the location cities in the Western states.
SQL: SELECT locationcity FROM LOCATION WHERE state IN ('CO', 'UT', 'CA')
Database: human_resources
Note: zip code of above 90000 refers to zipcode > 90000; city refers to locationcity;
Question: Which city and address has zip code of above 90000?
SQL: SELECT locationcity, address FROM LOCATION WHERE zipcode > 90000
Database: human_resources
Note: 4 years degree education refers to educationrequired = '4 year degree'; positions refers to positiontitle;
Question: Which positions are suitable with 4 years degree education?
SQL: SELECT positiontitle FROM POSITION WHERE educationrequired = '4 year degree'
Database: human_resources
Note: maximum salary refers to maxsalary; Trainee is a positiontitle;
Question: What is the maximum salary of position "Trainer"?
SQL: SELECT maxsalary FROM POSITION WHERE positiontitle = 'Trainee'
Database: human_resources
Note: full name = firstname, lastname; social security number refers to ssn; account representative is a position title; average performance refers to performance = 'Average';
Question: List the full name and social security number of the account representative with average performance.
SQL: SELECT employee.firstname, employee.lastname, employee.ssn FROM employee  INNER JOIN POSITION  ON employee.positionid = POSITION.positionid WHERE employee.performance = 'Average'
Database: human_resources
Note: Emily Wood is the full name of an employee; full name = firstname, lastname; when was she hired refers to hiredate;
Question: When was Emily Wood hired? Mention her position and salary.
SQL: SELECT employee.hiredate, POSITION.positiontitle, employee.salary FROM employee  INNER JOIN POSITION  ON employee.positionid = POSITION.positionid WHERE employee.firstname = 'Emily' AND employee.lastname = 'Wood'
Database: human_resources
Note: Bill Marlin is the full name of an employee; full name = firstname, lastname; maximum salary refers to maxsalary; minimum salary refers to minsalary;
Question: What are the maximum and minimum salary range and position title of Bill Marlin?
SQL: SELECT POSITION.maxsalary, POSITION.minsalary, POSITION.positiontitle FROM employee  INNER JOIN POSITION  ON employee.positionid = POSITION.positionid WHERE employee.firstname = 'Bill' AND employee.lastname = 'Marlin'
Database: human_resources
Note: full name = firstname, lastname; New York city refers to locationcity = 'New York City';
Question: List the full names, gender and positions who's location is in New York city.
SQL: SELECT employee.firstname, employee.lastname, employee.gender, POSITION.positiontitle FROM employee  INNER JOIN LOCATION  ON employee.locationid = LOCATION.locationid INNER JOIN POSITION  ON POSITION.positionid = employee.positionid WHERE LOCATION.locationcity = 'New York City'
Database: human_resources
Note: full name = firstname, lastname; Utah refers to state = 'UT';
Question: Mention the full name, hired date and performance status of the employee whose location is in Utah state.
SQL: SELECT employee.firstname, employee.lastname, employee.hiredate, employee.performance FROM employee  INNER JOIN LOCATION  ON employee.locationid = LOCATION.locationid WHERE LOCATION.state = 'UT'