sert121/SpiderSQL huggingface dataset:
-- 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.



Question: 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?
SQL: SELECT first_name ,  last_name ,  hire_date ,  salary ,  department_id FROM employees WHERE first_name NOT LIKE '%M%' ORDER BY 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.



Question: what is the phone number of employees whose salary is in the range of 8000 and 12000?
SQL: SELECT phone_number FROM employees WHERE salary 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.



Question: Return the phone numbers of employees with salaries between 8000 and 12000.
SQL: SELECT phone_number FROM employees WHERE salary 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.



Question: 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.
SQL: SELECT * FROM employees WHERE salary BETWEEN 8000 AND 12000 AND commission_pct != "null" OR  department_id != 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.



Question: 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.
SQL: SELECT * FROM employees WHERE salary BETWEEN 8000 AND 12000 AND commission_pct != "null" OR  department_id != 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.



Question: What are the full name (first and last name) and salary for all employees who does not have any value for commission?
SQL: SELECT first_name ,  last_name ,  salary FROM  employees WHERE commission_pct  =  "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.



Question: Return the full names and salaries of employees with null commissions.
SQL: SELECT first_name ,  last_name ,  salary FROM  employees WHERE commission_pct  =  "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.



Question: Display the first and last name, and salary for those employees whose first name is ending with the letter m.
SQL: SELECT first_name ,  last_name ,  salary FROM employees WHERE first_name LIKE '%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.



Question: Return the full names and salaries for employees with first names that end with the letter m.
SQL: SELECT first_name ,  last_name ,  salary FROM employees WHERE first_name LIKE '%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.



Question: Find job id and date of hire for those employees who was hired between November 5th, 2007 and July 5th, 2009.
SQL: SELECT job_id ,  hire_date FROM employees WHERE hire_date BETWEEN '2007-11-05' AND '2009-07-05'
-- 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.



Question: What are the job ids and dates of hire for employees hired after November 5th, 2007 and before July 5th, 2009?
SQL: SELECT job_id ,  hire_date FROM employees WHERE hire_date BETWEEN '2007-11-05' AND '2009-07-05'
-- 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.



Question: What are the first and last name for those employees who works either in department 70 or 90?
SQL: SELECT first_name ,  last_name FROM employees WHERE department_id  =  70 OR department_id  =  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.



Question: What are the full names of employees who with in department 70 or 90?
SQL: SELECT first_name ,  last_name FROM employees WHERE department_id  =  70 OR department_id  =  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.



Question: Find the salary and manager number for those employees who is working under a manager.
SQL: SELECT salary ,  manager_id FROM employees WHERE manager_id != "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.



Question: What are the salaries and manager ids for employees who have managers?
SQL: SELECT salary ,  manager_id FROM employees WHERE manager_id != "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.



Question: display all the details from Employees table for those employees who was hired before 2002-06-21.
SQL: SELECT * FROM employees WHERE hire_date  <  '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.



Question: What is all the information about employees hired before June 21, 2002?
SQL: SELECT * FROM employees WHERE hire_date  <  '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.



Question: 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.
SQL: SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC
-- 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.



Question: What is all the information about employees with D or S in their first name, ordered by salary descending?
SQL: SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC
-- 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.



Question: display those employees who joined after 7th September, 1987.
SQL: SELECT * FROM employees WHERE hire_date  >  '1987-09-07'
-- 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.



Question: Which employees were hired after September 7th, 1987?
SQL: SELECT * FROM employees WHERE hire_date  >  '1987-09-07'
-- 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.



Question: display the job title of jobs which minimum salary is greater than 9000.
SQL: SELECT job_title FROM jobs WHERE min_salary  >  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.



Question: Which job titles correspond to jobs with salaries over 9000?
SQL: SELECT job_title FROM jobs WHERE min_salary  >  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.



Question: display job Title, the difference between minimum and maximum salaries for those jobs which max salary within the range 12000 to 18000.
SQL: SELECT job_title ,  max_salary - min_salary FROM jobs WHERE max_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.



Question: What are the job titles, and range of salaries for jobs with maximum salary between 12000 and 18000?
SQL: SELECT job_title ,  max_salary - min_salary FROM jobs WHERE max_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.



Question: 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.
SQL: SELECT email FROM employees WHERE commission_pct  =  "null" AND salary BETWEEN 7000 AND 12000 AND department_id = 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.



Question: What are the emails of employees with null commission, salary between 7000 and 12000, and who work in department 50?
SQL: SELECT email FROM employees WHERE commission_pct  =  "null" AND salary BETWEEN 7000 AND 12000 AND department_id = 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.



Question: display the employee ID for each employee and the date on which he ended his previous job.
SQL: SELECT employee_id ,  MAX(end_date) FROM job_history GROUP BY employee_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.



Question: What are the employee ids for each employee and final dates of employment at their last job?
SQL: SELECT employee_id ,  MAX(end_date) FROM job_history GROUP BY employee_id