brief_instruction
stringlengths
16
224
instruction
stringlengths
687
8.77k
output
stringlengths
18
577
What are the full names and hire dates for employees in the same department as someone with the first name 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 `What are the full names and hire dates for employees in the same department as someone with the first name 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")
display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara excluding 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 excluding 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") AND first_name != "Clara"
What are the full names and hire dates for employees in the same department as someone with the first name Clara, not including 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 `What are the full names and hire dates for employees in the same department as someone with the first name Clara, not including 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") AND first_name != "Clara"
display the employee number and name( first name and last name ) for all employees who work in a department with any employee whose name contains a ’T’.
-- 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 number and name( first name and last name ) for all employees who work in a department with any employee whose name contains a ’T’.` to a syntactically-correct PostgreSQL query.
SELECT employee_id , first_name , last_name FROM employees WHERE department_id IN ( SELECT department_id FROM employees WHERE first_name LIKE '%T%' )
What are the ids and full names for employees who work in a department that has someone with a first name that contains the letter T?
-- 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 and full names for employees who work in a department that has someone with a first name that contains the letter T?` to a syntactically-correct PostgreSQL query.
SELECT employee_id , first_name , last_name FROM employees WHERE department_id IN ( SELECT department_id FROM employees WHERE first_name LIKE '%T%' )
display the employee number, name( first name and last name ), and salary for all employees who earn more than the average salary and who work in a department with any employee with a 'J' 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 `display the employee number, name( first name and last name ), and salary for all employees who earn more than the average salary and who work in a department with any employee with a 'J' in their first name.` to a syntactically-correct PostgreSQL query.
SELECT employee_id , first_name , last_name , salary FROM employees WHERE salary > ( SELECT AVG (salary) FROM employees ) AND department_id IN ( SELECT department_id FROM employees WHERE first_name LIKE '%J%')
What are the ids, full names, and salaries for employees making more than average and who work in a department with employees who have the letter J 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 ids, full names, and salaries for employees making more than average and who work in a department with employees who have the letter J in their first name?` to a syntactically-correct PostgreSQL query.
SELECT employee_id , first_name , last_name , salary FROM employees WHERE salary > ( SELECT AVG (salary) FROM employees ) AND department_id IN ( SELECT department_id FROM employees WHERE first_name LIKE '%J%')
display the employee number and job id for all employees whose salary is smaller than any salary of those employees whose job title is MK_MAN.
-- 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 number and job id for all employees whose salary is smaller than any salary of those employees whose job title is MK_MAN.` to a syntactically-correct PostgreSQL query.
SELECT employee_id , job_id FROM employees WHERE salary < ( SELECT min(salary) FROM employees WHERE job_id = 'MK_MAN' )
What are the employee ids and job ids for employees who make less than the lowest earning employee with title MK_MAN?
-- 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 ids for employees who make less than the lowest earning employee with title MK_MAN?` to a syntactically-correct PostgreSQL query.
SELECT employee_id , job_id FROM employees WHERE salary < ( SELECT min(salary) FROM employees WHERE job_id = 'MK_MAN' )
display the employee number, name( first name and last name ) and job title for all employees whose salary is more than any salary of those employees whose job title is PU_MAN.
-- 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 number, name( first name and last name ) and job title for all employees whose salary is more than any salary of those employees whose job title is PU_MAN.` to a syntactically-correct PostgreSQL query.
SELECT employee_id , first_name , last_name , job_id FROM employees WHERE salary > ( SELECT max(salary) FROM employees WHERE job_id = 'PU_MAN' )
What are the employee ids, full names, and job ids for employees who make more than the highest earning employee with title PU_MAN?
-- 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, full names, and job ids for employees who make more than the highest earning employee with title PU_MAN?` to a syntactically-correct PostgreSQL query.
SELECT employee_id , first_name , last_name , job_id FROM employees WHERE salary > ( SELECT max(salary) FROM employees WHERE job_id = 'PU_MAN' )
display the department id and the total salary for those departments which contains at least two 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 the department id and the total salary for those departments which contains at least two employees.` to a syntactically-correct PostgreSQL query.
SELECT department_id , SUM(salary) FROM employees GROUP BY department_id HAVING count(*) >= 2
What are total salaries and department id for each department that has more than 2 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 total salaries and department id for each department that has more than 2 employees?` to a syntactically-correct PostgreSQL query.
SELECT department_id , SUM(salary) FROM employees GROUP BY department_id HAVING count(*) >= 2
display all the information of those employees who did not have any job 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 all the information of those employees who did not have any job in the past.` to a syntactically-correct PostgreSQL query.
SELECT * FROM employees WHERE employee_id NOT IN (SELECT employee_id FROM job_history)
What is all the information about employees who have never had a job 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 `What is all the information about employees who have never had a job in the past?` to a syntactically-correct PostgreSQL query.
SELECT * FROM employees WHERE employee_id NOT IN (SELECT employee_id FROM job_history)
display the department ID, full name (first and last name), salary for those employees who is highest salary in every 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 ID, full name (first and last name), salary for those employees who is highest salary in every department.` to a syntactically-correct PostgreSQL query.
SELECT first_name , last_name , salary , department_id , MAX(salary) FROM employees GROUP BY department_id
What are the department ids, full names, and salaries for employees who make the most in their 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 department ids, full names, and salaries for employees who make the most in their departments?` to a syntactically-correct PostgreSQL query.
SELECT first_name , last_name , salary , department_id , MAX(salary) FROM employees GROUP BY department_id
display the first and last name, department, city, and state province 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 and last name, department, city, and state province for each employee.` to a syntactically-correct PostgreSQL query.
SELECT T1.first_name , T1.last_name , T2.department_name , T3.city , T3.state_province 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
What are the full names, departments, cities, and state provinces 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 `What are the full names, departments, cities, and state provinces for each employee?` to a syntactically-correct PostgreSQL query.
SELECT T1.first_name , T1.last_name , T2.department_name , T3.city , T3.state_province 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
display those employees who contain a letter z to their first name and also display their last name, city.
-- 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 contain a letter z to their first name and also display their last name, city.` to a syntactically-correct PostgreSQL query.
SELECT T1.first_name , T1.last_name , T3.city 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 WHERE T1.first_name LIKE '%z%'
What are the full names and cities of employees who have the letter Z in their first names?
-- 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 cities of employees who have the letter Z in their first names?` to a syntactically-correct PostgreSQL query.
SELECT T1.first_name , T1.last_name , T3.city 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 WHERE T1.first_name LIKE '%z%'
display the department name, city, and state province for 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 `display the department name, city, and state province for each department.` to a syntactically-correct PostgreSQL query.
SELECT T1.department_name , T2.city , T2.state_province FROM departments AS T1 JOIN locations AS T2 ON T2.location_id = T1.location_id
What are the department names, cities, and state provinces for 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 are the department names, cities, and state provinces for each department?` to a syntactically-correct PostgreSQL query.
SELECT T1.department_name , T2.city , T2.state_province FROM departments AS T1 JOIN locations AS T2 ON T2.location_id = T1.location_id
display the full name (first and last name ) of 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 `display the full name (first and last name ) of employee with ID and name of the country presently where (s)he is working.` to a syntactically-correct PostgreSQL query.
SELECT T1.first_name , T1.last_name , 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 the full names, ids of each employee and the name of the country they are in?
-- 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 the full names, ids of each employee and the name of the country they are in?` to a syntactically-correct PostgreSQL query.
SELECT T1.first_name , T1.last_name , 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 department_name , COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY department_name
What are the department names and how many employees work in each of 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 `What are the department names and how many employees work in each of them?` to a syntactically-correct PostgreSQL query.
SELECT department_name , COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY department_name
display the full name (first and last name), and salary of those employees who working in any department located in London.
-- 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 name), and salary of those employees who working in any department located in London.` to a syntactically-correct PostgreSQL query.
SELECT first_name , last_name , salary 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 WHERE T3.city = 'London'
What are full names and salaries of employees working in the city of London?
-- 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 full names and salaries of employees working in the city of London?` to a syntactically-correct PostgreSQL query.
SELECT first_name , last_name , salary 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 WHERE T3.city = 'London'
What is the name of the song that was released in the most recent year?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the name of the song that was released in the most recent year?` to a syntactically-correct PostgreSQL query.
SELECT song_name , releasedate FROM song ORDER BY releasedate DESC LIMIT 1
What is the name of the song that was released most recently?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the name of the song that was released most recently?` to a syntactically-correct PostgreSQL query.
SELECT song_name , releasedate FROM song ORDER BY releasedate DESC LIMIT 1
What is the id of the longest song?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the id of the longest song?` to a syntactically-correct PostgreSQL query.
SELECT f_id FROM files ORDER BY duration DESC LIMIT 1
Find the id of the song that lasts the longest.
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 of the song that lasts the longest.` to a syntactically-correct PostgreSQL query.
SELECT f_id FROM files ORDER BY duration DESC LIMIT 1
Find the names of all English songs.
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 names of all English songs.` to a syntactically-correct PostgreSQL query.
SELECT song_name FROM song WHERE languages = "english"
What are the names of all songs in English?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the names of all songs in English?` to a syntactically-correct PostgreSQL query.
SELECT song_name FROM song WHERE languages = "english"
What are the id of songs whose format is mp3.
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the id of songs whose format is mp3.` to a syntactically-correct PostgreSQL query.
SELECT f_id FROM files WHERE formats = "mp3"
What are the id of all the files in mp3 format?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the id of all the files in mp3 format?` to a syntactically-correct PostgreSQL query.
SELECT f_id FROM files WHERE formats = "mp3"
List the name and country of origin for all singers who have produced songs with rating above 9.
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `List the name and country of origin for all singers who have produced songs with rating above 9.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.rating > 9
What are the different names and countries of origins for all artists whose song ratings are above 9?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the different names and countries of origins for all artists whose song ratings are above 9?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.rating > 9
List the file size and format for all songs that have resolution lower than 800.
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `List the file size and format for all songs that have resolution lower than 800.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T1.file_size , T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.resolution < 800
What are the file sizes and formats for all songs with a resolution lower than 800?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the file sizes and formats for all songs with a resolution lower than 800?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T1.file_size , T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.resolution < 800
What is the name of the artist who produced the shortest song?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the name of the artist who produced the shortest song?` to a syntactically-correct PostgreSQL query.
SELECT T1.artist_name FROM song AS T1 JOIN files AS T2 ON T1.f_id = T2.f_id ORDER BY T2.duration LIMIT 1
What are the names of the artists who sang the shortest song?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the names of the artists who sang the shortest song?` to a syntactically-correct PostgreSQL query.
SELECT T1.artist_name FROM song AS T1 JOIN files AS T2 ON T1.f_id = T2.f_id ORDER BY T2.duration LIMIT 1
What are the names and countries of origin for the artists who produced the top three highly rated songs.
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the names and countries of origin for the artists who produced the top three highly rated songs.` to a syntactically-correct PostgreSQL query.
SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.rating DESC LIMIT 3
What are the names of the singers who sang the top 3 most highly rated songs and what countries do they hail from?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the names of the singers who sang the top 3 most highly rated songs and what countries do they hail from?` to a syntactically-correct PostgreSQL query.
SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.rating DESC LIMIT 3
How many songs have 4 minute duration?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `How many songs have 4 minute duration?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM files WHERE duration LIKE "4:%"
What is the count of the songs that last approximately 4 minutes?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the count of the songs that last approximately 4 minutes?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM files WHERE duration LIKE "4:%"
How many artists are from Bangladesh?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `How many artists are from Bangladesh?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM artist WHERE country = "Bangladesh"
How many Bangladeshi artists are listed?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `How many Bangladeshi artists are listed?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM artist WHERE country = "Bangladesh"
What is the average rating of songs produced by female artists?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the average rating of songs produced by female artists?` to a syntactically-correct PostgreSQL query.
SELECT avg(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female"
How many songs, on average, are sung by a female artist?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `How many songs, on average, are sung by a female artist?` to a syntactically-correct PostgreSQL query.
SELECT avg(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female"
What is the most popular file format?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the most popular file format?` to a syntactically-correct PostgreSQL query.
SELECT formats FROM files GROUP BY formats ORDER BY COUNT (*) DESC LIMIT 1
Find the file format that is used by the most files.
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 file format that is used by the most files.` to a syntactically-correct PostgreSQL query.
SELECT formats FROM files GROUP BY formats ORDER BY COUNT (*) DESC LIMIT 1
Find the names of the artists who are from UK and have produced English songs.
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 names of the artists who are from UK and have produced English songs.` to a syntactically-correct PostgreSQL query.
SELECT artist_name FROM artist WHERE country = "UK" INTERSECT SELECT artist_name FROM song WHERE languages = "english"
What are the names of the artists that are from the UK and sang songs in English?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the names of the artists that are from the UK and sang songs in English?` to a syntactically-correct PostgreSQL query.
SELECT artist_name FROM artist WHERE country = "UK" INTERSECT SELECT artist_name FROM song WHERE languages = "english"
Find the id of songs that are available in mp4 format and have resolution lower than 1000.
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 of songs that are available in mp4 format and have resolution lower than 1000.` to a syntactically-correct PostgreSQL query.
SELECT f_id FROM files WHERE formats = "mp4" INTERSECT SELECT f_id FROM song WHERE resolution < 1000
What is the id of the files that are available in the format of mp4 and a resolution smaller than 1000?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the id of the files that are available in the format of mp4 and a resolution smaller than 1000?` to a syntactically-correct PostgreSQL query.
SELECT f_id FROM files WHERE formats = "mp4" INTERSECT SELECT f_id FROM song WHERE resolution < 1000
What is the country of origin of the artist who is female and produced a song in Bangla?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the country of origin of the artist who is female and produced a song in Bangla?` to a syntactically-correct PostgreSQL query.
SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" AND T2.languages = "bangla"
What countries are the female artists who sung in the language Bangla from?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What countries are the female artists who sung in the language Bangla from?` to a syntactically-correct PostgreSQL query.
SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" AND T2.languages = "bangla"
What is the average duration of songs that have mp3 format and resolution below 800?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the average duration of songs that have mp3 format and resolution below 800?` to a syntactically-correct PostgreSQL query.
SELECT avg(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = "mp3" AND T2.resolution < 800
What is the average song duration for the songs that are in mp3 format and whose resolution below 800?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the average song duration for the songs that are in mp3 format and whose resolution below 800?` to a syntactically-correct PostgreSQL query.
SELECT avg(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = "mp3" AND T2.resolution < 800
What is the number of artists for each gender?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the number of artists for each gender?` to a syntactically-correct PostgreSQL query.
SELECT count(*) , gender FROM artist GROUP BY gender
How many artists are male and how many are female?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `How many artists are male and how many are female?` to a syntactically-correct PostgreSQL query.
SELECT count(*) , gender FROM artist GROUP BY gender
What is the average rating of songs for each language?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the average rating of songs for each language?` to a syntactically-correct PostgreSQL query.
SELECT avg(rating) , languages FROM song GROUP BY languages
What is the average song rating for each language?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the average song rating for each language?` to a syntactically-correct PostgreSQL query.
SELECT avg(rating) , languages FROM song GROUP BY languages
Return the gender and name of artist who produced the song with the lowest resolution.
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `Return the gender and name of artist who produced the song with the lowest resolution.` to a syntactically-correct PostgreSQL query.
SELECT T1.gender , T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.resolution LIMIT 1
What is the gender and name of the artist who sang the song with the smallest resolution?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the gender and name of the artist who sang the song with the smallest resolution?` to a syntactically-correct PostgreSQL query.
SELECT T1.gender , T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.resolution LIMIT 1
For each file format, return the number of artists who released songs in that format.
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `For each file format, return the number of artists who released songs in that format.` to a syntactically-correct PostgreSQL query.
SELECT count(*) , formats FROM files GROUP BY formats
How many songs were released for each format?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `How many songs were released for each format?` to a syntactically-correct PostgreSQL query.
SELECT count(*) , formats FROM files GROUP BY formats
Find the distinct names of all songs that have a higher resolution than some songs in English.
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 distinct names of all songs that have a higher resolution than some songs in English.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT song_name FROM song WHERE resolution > (SELECT min(resolution) FROM song WHERE languages = "english")
What are the different names for all songs that have a higher resolution than English songs?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the different names for all songs that have a higher resolution than English songs?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT song_name FROM song WHERE resolution > (SELECT min(resolution) FROM song WHERE languages = "english")
What are the names of all songs that have a lower rating than some song of blues genre?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the names of all songs that have a lower rating than some song of blues genre?` to a syntactically-correct PostgreSQL query.
SELECT song_name FROM song WHERE rating < (SELECT max(rating) FROM song WHERE genre_is = "blues")
What are the names of the songs that have a lower rating than at least one blues song?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the names of the songs that have a lower rating than at least one blues song?` to a syntactically-correct PostgreSQL query.
SELECT song_name FROM song WHERE rating < (SELECT max(rating) FROM song WHERE genre_is = "blues")
What is the name and country of origin of the artist who released a song that has "love" in its title?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the name and country of origin of the artist who released a song that has "love" in its title?` to a syntactically-correct PostgreSQL query.
SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.song_name LIKE "%love%"
What are the names of the artists who released a song that has the word love in its title, and where are the artists from?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the names of the artists who released a song that has the word love in its title, and where are the artists from?` to a syntactically-correct PostgreSQL query.
SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.song_name LIKE "%love%"
List the name and gender for all artists who released songs in March.
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `List the name and gender for all artists who released songs in March.` to a syntactically-correct PostgreSQL query.
SELECT T1.artist_name , T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.releasedate LIKE "%Mar%"
What are the names and genders of all artists who released songs in the month of March?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the names and genders of all artists who released songs in the month of March?` to a syntactically-correct PostgreSQL query.
SELECT T1.artist_name , T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.releasedate LIKE "%Mar%"
List the names of all genres in alphabetical oder, together with its ratings.
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `List the names of all genres in alphabetical oder, together with its ratings.` to a syntactically-correct PostgreSQL query.
SELECT g_name , rating FROM genre ORDER BY g_name
What are the names of all genres in alphabetical order, combined with its ratings?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the names of all genres in alphabetical order, combined with its ratings?` to a syntactically-correct PostgreSQL query.
SELECT g_name , rating FROM genre ORDER BY g_name
Give me a list of the names of all songs ordered by their resolution.
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 a list of the names of all songs ordered by their resolution.` to a syntactically-correct PostgreSQL query.
SELECT song_name FROM song ORDER BY resolution
What are the names of all songs that are ordered by their resolution numbers?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the names of all songs that are ordered by their resolution numbers?` to a syntactically-correct PostgreSQL query.
SELECT song_name FROM song ORDER BY resolution
What are the ids of songs that are available in either mp4 format or have resolution above 720?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the ids of songs that are available in either mp4 format or have resolution above 720?` to a syntactically-correct PostgreSQL query.
SELECT f_id FROM files WHERE formats = "mp4" UNION SELECT f_id FROM song WHERE resolution > 720
What are the ids of all songs that are available on mp4 or have a higher resolution than 720?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the ids of all songs that are available on mp4 or have a higher resolution than 720?` to a syntactically-correct PostgreSQL query.
SELECT f_id FROM files WHERE formats = "mp4" UNION SELECT f_id FROM song WHERE resolution > 720
List the names of all songs that have 4 minute duration or are in English.
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `List the names of all songs that have 4 minute duration or are in English.` to a syntactically-correct PostgreSQL query.
SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE "4:%" UNION SELECT song_name FROM song WHERE languages = "english"
What are the names of all songs that are approximately 4 minutes long or are in English?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the names of all songs that are approximately 4 minutes long or are in English?` to a syntactically-correct PostgreSQL query.
SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE "4:%" UNION SELECT song_name FROM song WHERE languages = "english"
What is the language used most often in the songs?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the language used most often in the songs?` to a syntactically-correct PostgreSQL query.
SELECT languages FROM song GROUP BY languages ORDER BY count(*) DESC LIMIT 1
What are the languages that are used most often in songs?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the languages that are used most often in songs?` to a syntactically-correct PostgreSQL query.
SELECT languages FROM song GROUP BY languages ORDER BY count(*) DESC LIMIT 1
What is the language that was used most often in songs with resolution above 500?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the language that was used most often in songs with resolution above 500?` to a syntactically-correct PostgreSQL query.
SELECT artist_name FROM song WHERE resolution > 500 GROUP BY languages ORDER BY count(*) DESC LIMIT 1
What is the name of the artist, for each language, that has the most songs with a higher resolution than 500?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the name of the artist, for each language, that has the most songs with a higher resolution than 500?` to a syntactically-correct PostgreSQL query.
SELECT artist_name FROM song WHERE resolution > 500 GROUP BY languages ORDER BY count(*) DESC LIMIT 1
What are the names of artists who are Male and are from UK?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the names of artists who are Male and are from UK?` to a syntactically-correct PostgreSQL query.
SELECT artist_name FROM artist WHERE country = "UK" AND gender = "Male"
What are the names of all male British artists?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the names of all male British artists?` to a syntactically-correct PostgreSQL query.
SELECT artist_name FROM artist WHERE country = "UK" AND gender = "Male"
Find the names of songs whose genre is modern or language is English.
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 names of songs whose genre is modern or language is English.` to a syntactically-correct PostgreSQL query.
SELECT song_name FROM song WHERE genre_is = "modern" OR languages = "english"
What are the names of the songs that are modern or sung in English?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the names of the songs that are modern or sung in English?` to a syntactically-correct PostgreSQL query.
SELECT song_name FROM song WHERE genre_is = "modern" OR languages = "english"
Return the names of songs for which format is mp3 and resolution is below 1000.
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `Return the names of songs for which format is mp3 and resolution is below 1000.` to a syntactically-correct PostgreSQL query.
SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = "mp3" INTERSECT SELECT song_name FROM song WHERE resolution < 1000
What are the names of all songs that are in mp3 format and have a resolution lower than 1000?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the names of all songs that are in mp3 format and have a resolution lower than 1000?` to a syntactically-correct PostgreSQL query.
SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = "mp3" INTERSECT SELECT song_name FROM song WHERE resolution < 1000
Return the names of singers who are from UK and released an English song.
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `Return the names of singers who are from UK and released an English song.` to a syntactically-correct PostgreSQL query.
SELECT artist_name FROM artist WHERE country = "UK" INTERSECT SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = "english"
What are the names of all singers that are from the UK and released a song in English?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the names of all singers that are from the UK and released a song in English?` to a syntactically-correct PostgreSQL query.
SELECT artist_name FROM artist WHERE country = "UK" INTERSECT SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = "english"
What are the average rating and resolution of songs that are in Bangla?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the average rating and resolution of songs that are in Bangla?` to a syntactically-correct PostgreSQL query.
SELECT avg(rating) , avg(resolution) FROM song WHERE languages = "bangla"
What is the average rating and resolution of all bangla songs?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What is the average rating and resolution of all bangla songs?` to a syntactically-correct PostgreSQL query.
SELECT avg(rating) , avg(resolution) FROM song WHERE languages = "bangla"
What are the maximum and minimum resolution of songs whose duration is 3 minutes?
-- Language PostgreSQL -- Tables: -- Table: genre columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']] -- Table: artist columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']] -- Table: files columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']] -- Table: song columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', '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 `What are the maximum and minimum resolution of songs whose duration is 3 minutes?` to a syntactically-correct PostgreSQL query.
SELECT max(T2.resolution) , min(T2.resolution) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE "3:%"