brief_instruction stringlengths 16 224 | instruction stringlengths 687 8.77k | output stringlengths 18 577 |
|---|---|---|
Find the id and number of shops for the company that produces the most expensive furniture. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturer
columns : [['manufacturer id', 'number'], ['open year', 'number'], ['name', 'text'], ['num of factories', 'number'], ['num of shops', 'number']]
-- Table: furniture
columns : [['furniture id', 'number'], ['name', 'text'], ['num of component', 'number'], ['market rate', 'number']]
-- Table: furniture manufacte
columns : [['manufacturer id', 'number'], ['furniture id', 'number'], ['price in dollar', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the id and number of shops for the company that produces the most expensive furniture.` to a syntactically-correct PostgreSQL query.
| SELECT t1.manufacturer_id , t1.num_of_shops FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id ORDER BY t2.Price_in_Dollar DESC LIMIT 1 |
Find the number of funiture types produced by each manufacturer as well as the company names. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturer
columns : [['manufacturer id', 'number'], ['open year', 'number'], ['name', 'text'], ['num of factories', 'number'], ['num of shops', 'number']]
-- Table: furniture
columns : [['furniture id', 'number'], ['name', 'text'], ['num of component', 'number'], ['market rate', 'number']]
-- Table: furniture manufacte
columns : [['manufacturer id', 'number'], ['furniture id', 'number'], ['price in dollar', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the number of funiture types produced by each manufacturer as well as the company names.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) , t1.name FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id GROUP BY t1.manufacturer_id |
Give me the names and prices of furnitures which some companies are manufacturing. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturer
columns : [['manufacturer id', 'number'], ['open year', 'number'], ['name', 'text'], ['num of factories', 'number'], ['num of shops', 'number']]
-- Table: furniture
columns : [['furniture id', 'number'], ['name', 'text'], ['num of component', 'number'], ['market rate', 'number']]
-- Table: furniture manufacte
columns : [['manufacturer id', 'number'], ['furniture id', 'number'], ['price in dollar', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Give me the names and prices of furnitures which some companies are manufacturing.` to a syntactically-correct PostgreSQL query.
| SELECT t1.name , t2.price_in_dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID |
Find the market shares and names of furnitures which no any company is producing in our records. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturer
columns : [['manufacturer id', 'number'], ['open year', 'number'], ['name', 'text'], ['num of factories', 'number'], ['num of shops', 'number']]
-- Table: furniture
columns : [['furniture id', 'number'], ['name', 'text'], ['num of component', 'number'], ['market rate', 'number']]
-- Table: furniture manufacte
columns : [['manufacturer id', 'number'], ['furniture id', 'number'], ['price in dollar', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the market shares and names of furnitures which no any company is producing in our records.` to a syntactically-correct PostgreSQL query.
| SELECT Market_Rate , name FROM furniture WHERE Furniture_ID NOT IN (SELECT Furniture_ID FROM furniture_manufacte) |
Find the name of the company that produces both furnitures with less than 6 components and furnitures with more than 10 components. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturer
columns : [['manufacturer id', 'number'], ['open year', 'number'], ['name', 'text'], ['num of factories', 'number'], ['num of shops', 'number']]
-- Table: furniture
columns : [['furniture id', 'number'], ['name', 'text'], ['num of component', 'number'], ['market rate', 'number']]
-- Table: furniture manufacte
columns : [['manufacturer id', 'number'], ['furniture id', 'number'], ['price in dollar', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the name of the company that produces both furnitures with less than 6 components and furnitures with more than 10 components.` to a syntactically-correct PostgreSQL query.
| SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component < 6 INTERSECT SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component > 10 |
Display the first name and department name for each employee. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Display the first name and department name for each employee.` to a syntactically-correct PostgreSQL query.
| SELECT T1.first_name , T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id |
What are the first name and department name of all employees? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the first name and department name of all employees?` to a syntactically-correct PostgreSQL query.
| SELECT T1.first_name , T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id |
List the full name (first and last name), and salary for those employees who earn below 6000. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List the full name (first and last name), and salary for those employees who earn below 6000.` to a syntactically-correct PostgreSQL query.
| SELECT first_name , last_name , salary FROM employees WHERE salary < 6000 |
What are the full names and salaries for any employees earning less than 6000? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the full names and salaries for any employees earning less than 6000?` to a syntactically-correct PostgreSQL query.
| SELECT first_name , last_name , salary FROM employees WHERE salary < 6000 |
Display the first name, and department number for all employees whose last name is "McEwen". |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Display the first name, and department number for all employees whose last name is "McEwen".` to a syntactically-correct PostgreSQL query.
| SELECT first_name , department_id FROM employees WHERE last_name = 'McEwen' |
What are the first names and department numbers for employees with last name McEwen? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the first names and department numbers for employees with last name McEwen?` to a syntactically-correct PostgreSQL query.
| SELECT first_name , department_id FROM employees WHERE last_name = 'McEwen' |
Return all the information for all employees without any department number. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Return all the information for all employees without any department number.` to a syntactically-correct PostgreSQL query.
| SELECT * FROM employees WHERE department_id = "null" |
What are all the employees without a department number? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are all the employees without a department number?` to a syntactically-correct PostgreSQL query.
| SELECT * FROM employees WHERE department_id = "null" |
Display all the information about the department Marketing. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Display all the information about the department Marketing.` to a syntactically-correct PostgreSQL query.
| SELECT * FROM departments WHERE department_name = 'Marketing' |
What is all the information about the Marketing department? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is all the information about the Marketing department?` to a syntactically-correct PostgreSQL query.
| SELECT * FROM departments WHERE department_name = 'Marketing' |
when is the hire date for those employees whose first name does not containing the letter M? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `when is the hire date for those employees whose first name does not containing the letter M?` to a syntactically-correct PostgreSQL query.
| SELECT hire_date FROM employees WHERE first_name NOT LIKE '%M%' |
On what dates were employees without the letter M in their first names hired? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `On what dates were employees without the letter M in their first names hired?` to a syntactically-correct PostgreSQL query.
| SELECT hire_date FROM employees WHERE first_name NOT LIKE '%M%' |
display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M.` to a syntactically-correct PostgreSQL query.
| SELECT first_name , last_name , hire_date , salary , department_id FROM employees WHERE first_name NOT LIKE '%M%' |
What are the full name, hire date, salary, and department id for employees without the letter M in their first name? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the full name, hire date, salary, and department id for employees without the letter M in their first name?` to a syntactically-correct PostgreSQL query.
| SELECT first_name , last_name , hire_date , salary , department_id FROM employees WHERE first_name NOT LIKE '%M%' |
display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M and make the result set in ascending order by department number. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M and make the result set in ascending order by department number.` to a syntactically-correct PostgreSQL query.
| SELECT first_name , last_name , hire_date , salary , department_id FROM employees WHERE first_name NOT LIKE '%M%' ORDER BY department_id |
What are the full name, hire data, salary and department id for employees without the letter M in their first name, ordered by ascending department id? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the full name, hire data, salary and department id for employees without the letter M in their first name, ordered by ascending department id?` to a syntactically-correct PostgreSQL query.
| SELECT first_name , last_name , hire_date , salary , department_id FROM employees WHERE first_name NOT LIKE '%M%' ORDER BY department_id |
what is the phone number of employees whose salary is in the range of 8000 and 12000? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `what is the phone number of employees whose salary is in the range of 8000 and 12000?` to a syntactically-correct PostgreSQL query.
| SELECT phone_number FROM employees WHERE salary BETWEEN 8000 AND 12000 |
Return the phone numbers of employees with salaries between 8000 and 12000. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Return the phone numbers of employees with salaries between 8000 and 12000.` to a syntactically-correct PostgreSQL query.
| SELECT phone_number FROM employees WHERE salary BETWEEN 8000 AND 12000 |
display all the information of employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display all the information of employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40.` to a syntactically-correct PostgreSQL query.
| SELECT * FROM employees WHERE salary BETWEEN 8000 AND 12000 AND commission_pct != "null" OR department_id != 40 |
Return all information about employees with salaries between 8000 and 12000 for which commission is not null or where their department id is not 40. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Return all information about employees with salaries between 8000 and 12000 for which commission is not null or where their department id is not 40.` to a syntactically-correct PostgreSQL query.
| SELECT * FROM employees WHERE salary BETWEEN 8000 AND 12000 AND commission_pct != "null" OR department_id != 40 |
What are the full name (first and last name) and salary for all employees who does not have any value for commission? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the full name (first and last name) and salary for all employees who does not have any value for commission?` to a syntactically-correct PostgreSQL query.
| SELECT first_name , last_name , salary FROM employees WHERE commission_pct = "null" |
Return the full names and salaries of employees with null commissions. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Return the full names and salaries of employees with null commissions.` to a syntactically-correct PostgreSQL query.
| SELECT first_name , last_name , salary FROM employees WHERE commission_pct = "null" |
Display the first and last name, and salary for those employees whose first name is ending with the letter m. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Display the first and last name, and salary for those employees whose first name is ending with the letter m.` to a syntactically-correct PostgreSQL query.
| SELECT first_name , last_name , salary FROM employees WHERE first_name LIKE '%m' |
Return the full names and salaries for employees with first names that end with the letter m. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Return the full names and salaries for employees with first names that end with the letter m.` to a syntactically-correct PostgreSQL query.
| SELECT first_name , last_name , salary FROM employees WHERE first_name LIKE '%m' |
Find job id and date of hire for those employees who was hired between November 5th, 2007 and July 5th, 2009. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find job id and date of hire for those employees who was hired between November 5th, 2007 and July 5th, 2009.` to a syntactically-correct PostgreSQL query.
| SELECT job_id , hire_date FROM employees WHERE hire_date BETWEEN '2007-11-05' AND '2009-07-05' |
What are the job ids and dates of hire for employees hired after November 5th, 2007 and before July 5th, 2009? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the job ids and dates of hire for employees hired after November 5th, 2007 and before July 5th, 2009?` to a syntactically-correct PostgreSQL query.
| SELECT job_id , hire_date FROM employees WHERE hire_date BETWEEN '2007-11-05' AND '2009-07-05' |
What are the first and last name for those employees who works either in department 70 or 90? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the first and last name for those employees who works either in department 70 or 90?` to a syntactically-correct PostgreSQL query.
| SELECT first_name , last_name FROM employees WHERE department_id = 70 OR department_id = 90 |
What are the full names of employees who with in department 70 or 90? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the full names of employees who with in department 70 or 90?` to a syntactically-correct PostgreSQL query.
| SELECT first_name , last_name FROM employees WHERE department_id = 70 OR department_id = 90 |
Find the salary and manager number for those employees who is working under a manager. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the salary and manager number for those employees who is working under a manager.` to a syntactically-correct PostgreSQL query.
| SELECT salary , manager_id FROM employees WHERE manager_id != "null" |
What are the salaries and manager ids for employees who have managers? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the salaries and manager ids for employees who have managers?` to a syntactically-correct PostgreSQL query.
| SELECT salary , manager_id FROM employees WHERE manager_id != "null" |
display all the details from Employees table for those employees who was hired before 2002-06-21. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display all the details from Employees table for those employees who was hired before 2002-06-21.` to a syntactically-correct PostgreSQL query.
| SELECT * FROM employees WHERE hire_date < '2002-06-21' |
What is all the information about employees hired before June 21, 2002? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is all the information about employees hired before June 21, 2002?` to a syntactically-correct PostgreSQL query.
| SELECT * FROM employees WHERE hire_date < '2002-06-21' |
display all the information for all employees who have the letters D or S in their first name and also arrange the result in descending order by salary. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display all the information for all employees who have the letters D or S in their first name and also arrange the result in descending order by salary.` to a syntactically-correct PostgreSQL query.
| SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC |
What is all the information about employees with D or S in their first name, ordered by salary descending? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is all the information about employees with D or S in their first name, ordered by salary descending?` to a syntactically-correct PostgreSQL query.
| SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC |
display those employees who joined after 7th September, 1987. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display those employees who joined after 7th September, 1987.` to a syntactically-correct PostgreSQL query.
| SELECT * FROM employees WHERE hire_date > '1987-09-07' |
Which employees were hired after September 7th, 1987? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Which employees were hired after September 7th, 1987?` to a syntactically-correct PostgreSQL query.
| SELECT * FROM employees WHERE hire_date > '1987-09-07' |
display the job title of jobs which minimum salary is greater than 9000. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display the job title of jobs which minimum salary is greater than 9000.` to a syntactically-correct PostgreSQL query.
| SELECT job_title FROM jobs WHERE min_salary > 9000 |
Which job titles correspond to jobs with salaries over 9000? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Which job titles correspond to jobs with salaries over 9000?` to a syntactically-correct PostgreSQL query.
| SELECT job_title FROM jobs WHERE min_salary > 9000 |
display job Title, the difference between minimum and maximum salaries for those jobs which max salary within the range 12000 to 18000. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display job Title, the difference between minimum and maximum salaries for those jobs which max salary within the range 12000 to 18000.` to a syntactically-correct PostgreSQL query.
| SELECT job_title , max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000 |
What are the job titles, and range of salaries for jobs with maximum salary between 12000 and 18000? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the job titles, and range of salaries for jobs with maximum salary between 12000 and 18000?` to a syntactically-correct PostgreSQL query.
| SELECT job_title , max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000 |
display the emails of the employees who have no commission percentage and salary within the range 7000 to 12000 and works in that department which number is 50. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display the emails of the employees who have no commission percentage and salary within the range 7000 to 12000 and works in that department which number is 50.` to a syntactically-correct PostgreSQL query.
| SELECT email FROM employees WHERE commission_pct = "null" AND salary BETWEEN 7000 AND 12000 AND department_id = 50 |
What are the emails of employees with null commission, salary between 7000 and 12000, and who work in department 50? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the emails of employees with null commission, salary between 7000 and 12000, and who work in department 50?` to a syntactically-correct PostgreSQL query.
| SELECT email FROM employees WHERE commission_pct = "null" AND salary BETWEEN 7000 AND 12000 AND department_id = 50 |
display the employee ID for each employee and the date on which he ended his previous job. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display the employee ID for each employee and the date on which he ended his previous job.` to a syntactically-correct PostgreSQL query.
| SELECT employee_id , MAX(end_date) FROM job_history GROUP BY employee_id |
What are the employee ids for each employee and final dates of employment at their last job? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the employee ids for each employee and final dates of employment at their last job?` to a syntactically-correct PostgreSQL query.
| SELECT employee_id , MAX(end_date) FROM job_history GROUP BY employee_id |
display those departments where more than ten employees work who got a commission percentage. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display those departments where more than ten employees work who got a commission percentage.` to a syntactically-correct PostgreSQL query.
| SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct) > 10 |
What are the department ids for which more than 10 employees had a commission? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the department ids for which more than 10 employees had a commission?` to a syntactically-correct PostgreSQL query.
| SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct) > 10 |
Find the ids of the departments where any manager is managing 4 or more employees. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the ids of the departments where any manager is managing 4 or more employees.` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT department_id FROM employees GROUP BY department_id , manager_id HAVING COUNT(employee_id) >= 4 |
What are department ids for departments with managers managing more than 3 employees? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are department ids for departments with managers managing more than 3 employees?` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT department_id FROM employees GROUP BY department_id , manager_id HAVING COUNT(employee_id) >= 4 |
display the average salary of employees for each department who gets a commission percentage. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display the average salary of employees for each department who gets a commission percentage.` to a syntactically-correct PostgreSQL query.
| SELECT department_id , AVG(salary) FROM employees WHERE commission_pct != "null" GROUP BY department_id |
What is the average salary of employees who have a commission percentage that is not null? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the average salary of employees who have a commission percentage that is not null?` to a syntactically-correct PostgreSQL query.
| SELECT department_id , AVG(salary) FROM employees WHERE commission_pct != "null" GROUP BY department_id |
display the country ID and number of cities for each country. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display the country ID and number of cities for each country.` to a syntactically-correct PostgreSQL query.
| SELECT country_id , COUNT(*) FROM locations GROUP BY country_id |
Give the country id and corresponding count of cities in each country. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Give the country id and corresponding count of cities in each country.` to a syntactically-correct PostgreSQL query.
| SELECT country_id , COUNT(*) FROM locations GROUP BY country_id |
display job ID for those jobs that were done by two or more for more than 300 days. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display job ID for those jobs that were done by two or more for more than 300 days.` to a syntactically-correct PostgreSQL query.
| SELECT job_id FROM job_history WHERE end_date - start_date > 300 GROUP BY job_id HAVING COUNT(*) >= 2 |
What are the job ids for jobs done more than once for a period of more than 300 days? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the job ids for jobs done more than once for a period of more than 300 days?` to a syntactically-correct PostgreSQL query.
| SELECT job_id FROM job_history WHERE end_date - start_date > 300 GROUP BY job_id HAVING COUNT(*) >= 2 |
display the ID for those employees who did two or more jobs in the past. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display the ID for those employees who did two or more jobs in the past.` to a syntactically-correct PostgreSQL query.
| SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2 |
What are the employee ids for employees who have held two or more jobs? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the employee ids for employees who have held two or more jobs?` to a syntactically-correct PostgreSQL query.
| SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2 |
Find employee with ID and name of the country presently where (s)he is working. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find employee with ID and name of the country presently where (s)he is working.` to a syntactically-correct PostgreSQL query.
| SELECT T1.employee_id , T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id |
What are all the employee ids and the names of the countries in which they work? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are all the employee ids and the names of the countries in which they work?` to a syntactically-correct PostgreSQL query.
| SELECT T1.employee_id , T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id |
display the department name and number of employees in each of the department. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display the department name and number of employees in each of the department.` to a syntactically-correct PostgreSQL query.
| SELECT T2.department_name , COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY T2.department_name |
Give the name of each department and the number of employees in each. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Give the name of each department and the number of employees in each.` to a syntactically-correct PostgreSQL query.
| SELECT T2.department_name , COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY T2.department_name |
Can you return all detailed info of jobs which was done by any of the employees who is presently earning a salary on and above 12000? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Can you return all detailed info of jobs which was done by any of the employees who is presently earning a salary on and above 12000?` to a syntactically-correct PostgreSQL query.
| SELECT * FROM job_history AS T1 JOIN employees AS T2 ON T1.employee_id = T2.employee_id WHERE T2.salary >= 12000 |
What is all the job history info done by employees earning a salary greater than or equal to 12000? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is all the job history info done by employees earning a salary greater than or equal to 12000?` to a syntactically-correct PostgreSQL query.
| SELECT * FROM job_history AS T1 JOIN employees AS T2 ON T1.employee_id = T2.employee_id WHERE T2.salary >= 12000 |
display job title and average salary of employees. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display job title and average salary of employees.` to a syntactically-correct PostgreSQL query.
| SELECT job_title , AVG(salary) FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id GROUP BY T2.job_title |
What is the average salary for each job title? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the average salary for each job title?` to a syntactically-correct PostgreSQL query.
| SELECT job_title , AVG(salary) FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id GROUP BY T2.job_title |
What is the full name ( first name and last name ) for those employees who gets more salary than the employee whose id is 163? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the full name ( first name and last name ) for those employees who gets more salary than the employee whose id is 163?` to a syntactically-correct PostgreSQL query.
| SELECT first_name , last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163 ) |
Provide the full names of employees earning more than the employee with id 163. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Provide the full names of employees earning more than the employee with id 163.` to a syntactically-correct PostgreSQL query.
| SELECT first_name , last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163 ) |
return the smallest salary for every departments. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `return the smallest salary for every departments.` to a syntactically-correct PostgreSQL query.
| SELECT MIN(salary) , department_id FROM employees GROUP BY department_id |
What is the minimum salary in each department? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the minimum salary in each department?` to a syntactically-correct PostgreSQL query.
| SELECT MIN(salary) , department_id FROM employees GROUP BY department_id |
Find the first name and last name and department id for those employees who earn such amount of salary which is the smallest salary of any of the departments. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the first name and last name and department id for those employees who earn such amount of salary which is the smallest salary of any of the departments.` to a syntactically-correct PostgreSQL query.
| SELECT first_name , last_name , department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id) |
What are the full names and department ids for the lowest paid employees across all departments. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the full names and department ids for the lowest paid employees across all departments.` to a syntactically-correct PostgreSQL query.
| SELECT first_name , last_name , department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id) |
Find the employee id for all employees who earn more than the average salary. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the employee id for all employees who earn more than the average salary.` to a syntactically-correct PostgreSQL query.
| SELECT employee_id FROM employees WHERE salary > (SELECT AVG(salary) FROM employees) |
What are the employee ids for employees who make more than the average? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the employee ids for employees who make more than the average?` to a syntactically-correct PostgreSQL query.
| SELECT employee_id FROM employees WHERE salary > (SELECT AVG(salary) FROM employees) |
display the employee id and salary of all employees who report to Payam (first name). |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display the employee id and salary of all employees who report to Payam (first name).` to a syntactically-correct PostgreSQL query.
| SELECT employee_id , salary FROM employees WHERE manager_id = (SELECT employee_id FROM employees WHERE first_name = 'Payam' ) |
What are the employee ids of employees who report to Payam, and what are their salaries? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the employee ids of employees who report to Payam, and what are their salaries?` to a syntactically-correct PostgreSQL query.
| SELECT employee_id , salary FROM employees WHERE manager_id = (SELECT employee_id FROM employees WHERE first_name = 'Payam' ) |
find the name of all departments that do actually have one or more employees assigned to them. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `find the name of all departments that do actually have one or more employees assigned to them.` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id |
What are the names of departments that have at least one employee. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of departments that have at least one employee.` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id |
get the details of employees who manage a department. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `get the details of employees who manage a department.` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id |
What is all the information regarding employees who are managers? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is all the information regarding employees who are managers?` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id |
display all the information about the department Marketing. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display all the information about the department Marketing.` to a syntactically-correct PostgreSQL query.
| SELECT * FROM departments WHERE department_name = 'Marketing' |
What is all the information about the Marketing department? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is all the information about the Marketing department?` to a syntactically-correct PostgreSQL query.
| SELECT * FROM departments WHERE department_name = 'Marketing' |
display the ID for those employees who did two or more jobs in the past. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display the ID for those employees who did two or more jobs in the past.` to a syntactically-correct PostgreSQL query.
| SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2 |
What are the employee ids for those who had two or more jobs. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the employee ids for those who had two or more jobs.` to a syntactically-correct PostgreSQL query.
| SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2 |
What are the unique ids of those departments where any manager is managing 4 or more employees. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the unique ids of those departments where any manager is managing 4 or more employees.` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT department_id FROM employees GROUP BY department_id , manager_id HAVING COUNT(employee_id) >= 4 |
Give the distinct department ids of departments in which a manager is in charge of 4 or more employees? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Give the distinct department ids of departments in which a manager is in charge of 4 or more employees?` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT department_id FROM employees GROUP BY department_id , manager_id HAVING COUNT(employee_id) >= 4 |
Find the job ID for those jobs which average salary is above 8000. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the job ID for those jobs which average salary is above 8000.` to a syntactically-correct PostgreSQL query.
| SELECT job_id FROM employees GROUP BY job_id HAVING AVG(salary) > 8000 |
What are the job ids corresponding to jobs with average salary above 8000? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the job ids corresponding to jobs with average salary above 8000?` to a syntactically-correct PostgreSQL query.
| SELECT job_id FROM employees GROUP BY job_id HAVING AVG(salary) > 8000 |
display the employee ID and job name for all those jobs in department 80. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display the employee ID and job name for all those jobs in department 80.` to a syntactically-correct PostgreSQL query.
| SELECT T1.employee_id , T2.job_title FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.department_id = 80 |
what are the employee ids and job titles for employees in department 80? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `what are the employee ids and job titles for employees in department 80?` to a syntactically-correct PostgreSQL query.
| SELECT T1.employee_id , T2.job_title FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.department_id = 80 |
What is the first name and job id for all employees in the Finance department? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the first name and job id for all employees in the Finance department?` to a syntactically-correct PostgreSQL query.
| SELECT T1.first_name , T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T2.department_name = 'Finance' |
Give the first name and job id for all employees in the Finance department. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Give the first name and job id for all employees in the Finance department.` to a syntactically-correct PostgreSQL query.
| SELECT T1.first_name , T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T2.department_name = 'Finance' |
display all the information of the employees whose salary if within the range of smallest salary and 2500. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display all the information of the employees whose salary if within the range of smallest salary and 2500.` to a syntactically-correct PostgreSQL query.
| SELECT * FROM employees WHERE salary BETWEEN (SELECT MIN(salary) FROM employees) AND 2500 |
What is all the information regarding employees with salaries above the minimum and under 2500? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is all the information regarding employees with salaries above the minimum and under 2500?` to a syntactically-correct PostgreSQL query.
| SELECT * FROM employees WHERE salary BETWEEN (SELECT MIN(salary) FROM employees) AND 2500 |
Find the ids of the employees who does not work in those departments where some employees works whose manager id within the range 100 and 200. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the ids of the employees who does not work in those departments where some employees works whose manager id within the range 100 and 200.` to a syntactically-correct PostgreSQL query.
| SELECT * FROM employees WHERE department_id NOT IN (SELECT department_id FROM departments WHERE manager_id BETWEEN 100 AND 200) |
What are the ids for employees who do not work in departments with managers that have ids between 100 and 200? |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the ids for employees who do not work in departments with managers that have ids between 100 and 200?` to a syntactically-correct PostgreSQL query.
| SELECT * FROM employees WHERE department_id NOT IN (SELECT department_id FROM departments WHERE manager_id BETWEEN 100 AND 200) |
display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara. |
-- Language PostgreSQL
-- Tables:
-- Table: regions
columns : [['region id', 'number'], ['region name', 'text']]
-- Table: countries
columns : [['country id', 'text'], ['country name', 'text'], ['region id', 'number']]
-- Table: departments
columns : [['department id', 'number'], ['department name', 'text'], ['manager id', 'number'], ['location id', 'number']]
-- Table: jobs
columns : [['job id', 'text'], ['job title', 'text'], ['min salary', 'number'], ['max salary', 'number']]
-- Table: employees
columns : [['employee id', 'number'], ['first name', 'text'], ['last name', 'text'], ['email', 'text'], ['phone number', 'text'], ['hire date', 'time'], ['job id', 'text'], ['salary', 'number'], ['commission pct', 'number'], ['manager id', 'number'], ['department id', 'number']]
-- Table: job history
columns : [['employee id', 'number'], ['start date', 'time'], ['end date', 'time'], ['job id', 'text'], ['department id', 'number']]
-- Table: locations
columns : [['location id', 'number'], ['street address', 'text'], ['postal code', 'text'], ['city', 'text'], ['state province', 'text'], ['country id', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara.` to a syntactically-correct PostgreSQL query.
| SELECT first_name , last_name , hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = "Clara") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.