brief_instruction stringlengths 16 224 | instruction stringlengths 687 8.77k | output stringlengths 18 577 |
|---|---|---|
What is the maximum and minimum market value of companies? |
-- Language PostgreSQL
-- Tables:
-- Table: people
columns : [['people id', 'number'], ['age', 'number'], ['name', 'text'], ['nationality', 'text'], ['graduation college', 'text']]
-- Table: company
columns : [['company id', 'number'], ['name', 'text'], ['headquarters', 'text'], ['industry', 'text'], ['sales in billion', 'number'], ['profits in billion', 'number'], ['assets in billion', 'number'], ['market value in billion', 'number']]
-- Table: employment
columns : [['company id', 'number'], ['people id', 'number'], ['year working', '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 maximum and minimum market value of companies?` to a syntactically-correct PostgreSQL query.
| SELECT max(Market_Value_in_Billion) , min(Market_Value_in_Billion) FROM company |
What is the headquarter of the company with the largest sales? |
-- Language PostgreSQL
-- Tables:
-- Table: people
columns : [['people id', 'number'], ['age', 'number'], ['name', 'text'], ['nationality', 'text'], ['graduation college', 'text']]
-- Table: company
columns : [['company id', 'number'], ['name', 'text'], ['headquarters', 'text'], ['industry', 'text'], ['sales in billion', 'number'], ['profits in billion', 'number'], ['assets in billion', 'number'], ['market value in billion', 'number']]
-- Table: employment
columns : [['company id', 'number'], ['people id', 'number'], ['year working', '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 headquarter of the company with the largest sales?` to a syntactically-correct PostgreSQL query.
| SELECT Headquarters FROM company ORDER BY Sales_in_Billion DESC LIMIT 1 |
Show the different headquarters and number of companies at each headquarter. |
-- Language PostgreSQL
-- Tables:
-- Table: people
columns : [['people id', 'number'], ['age', 'number'], ['name', 'text'], ['nationality', 'text'], ['graduation college', 'text']]
-- Table: company
columns : [['company id', 'number'], ['name', 'text'], ['headquarters', 'text'], ['industry', 'text'], ['sales in billion', 'number'], ['profits in billion', 'number'], ['assets in billion', 'number'], ['market value in billion', 'number']]
-- Table: employment
columns : [['company id', 'number'], ['people id', 'number'], ['year working', '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 `Show the different headquarters and number of companies at each headquarter.` to a syntactically-correct PostgreSQL query.
| SELECT Headquarters , COUNT(*) FROM company GROUP BY Headquarters |
Show the most common headquarter for companies. |
-- Language PostgreSQL
-- Tables:
-- Table: people
columns : [['people id', 'number'], ['age', 'number'], ['name', 'text'], ['nationality', 'text'], ['graduation college', 'text']]
-- Table: company
columns : [['company id', 'number'], ['name', 'text'], ['headquarters', 'text'], ['industry', 'text'], ['sales in billion', 'number'], ['profits in billion', 'number'], ['assets in billion', 'number'], ['market value in billion', 'number']]
-- Table: employment
columns : [['company id', 'number'], ['people id', 'number'], ['year working', '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 `Show the most common headquarter for companies.` to a syntactically-correct PostgreSQL query.
| SELECT Headquarters FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC LIMIT 1 |
Show the headquarters that have at least two companies. |
-- Language PostgreSQL
-- Tables:
-- Table: people
columns : [['people id', 'number'], ['age', 'number'], ['name', 'text'], ['nationality', 'text'], ['graduation college', 'text']]
-- Table: company
columns : [['company id', 'number'], ['name', 'text'], ['headquarters', 'text'], ['industry', 'text'], ['sales in billion', 'number'], ['profits in billion', 'number'], ['assets in billion', 'number'], ['market value in billion', 'number']]
-- Table: employment
columns : [['company id', 'number'], ['people id', 'number'], ['year working', '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 `Show the headquarters that have at least two companies.` to a syntactically-correct PostgreSQL query.
| SELECT Headquarters FROM company GROUP BY Headquarters HAVING COUNT(*) >= 2 |
Show the headquarters that have both companies in banking industry and companies in oil and gas industry. |
-- Language PostgreSQL
-- Tables:
-- Table: people
columns : [['people id', 'number'], ['age', 'number'], ['name', 'text'], ['nationality', 'text'], ['graduation college', 'text']]
-- Table: company
columns : [['company id', 'number'], ['name', 'text'], ['headquarters', 'text'], ['industry', 'text'], ['sales in billion', 'number'], ['profits in billion', 'number'], ['assets in billion', 'number'], ['market value in billion', 'number']]
-- Table: employment
columns : [['company id', 'number'], ['people id', 'number'], ['year working', '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 `Show the headquarters that have both companies in banking industry and companies in oil and gas industry.` to a syntactically-correct PostgreSQL query.
| SELECT Headquarters FROM company WHERE Industry = "Banking" INTERSECT SELECT Headquarters FROM company WHERE Industry = "Oil and gas" |
Show the names of companies and of employees. |
-- Language PostgreSQL
-- Tables:
-- Table: people
columns : [['people id', 'number'], ['age', 'number'], ['name', 'text'], ['nationality', 'text'], ['graduation college', 'text']]
-- Table: company
columns : [['company id', 'number'], ['name', 'text'], ['headquarters', 'text'], ['industry', 'text'], ['sales in billion', 'number'], ['profits in billion', 'number'], ['assets in billion', 'number'], ['market value in billion', 'number']]
-- Table: employment
columns : [['company id', 'number'], ['people id', 'number'], ['year working', '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 `Show the names of companies and of employees.` to a syntactically-correct PostgreSQL query.
| SELECT T3.Name , T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID |
Show names of companies and that of employees in descending order of number of years working for that employee. |
-- Language PostgreSQL
-- Tables:
-- Table: people
columns : [['people id', 'number'], ['age', 'number'], ['name', 'text'], ['nationality', 'text'], ['graduation college', 'text']]
-- Table: company
columns : [['company id', 'number'], ['name', 'text'], ['headquarters', 'text'], ['industry', 'text'], ['sales in billion', 'number'], ['profits in billion', 'number'], ['assets in billion', 'number'], ['market value in billion', 'number']]
-- Table: employment
columns : [['company id', 'number'], ['people id', 'number'], ['year working', '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 `Show names of companies and that of employees in descending order of number of years working for that employee.` to a syntactically-correct PostgreSQL query.
| SELECT T3.Name , T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID ORDER BY T1.Year_working |
Show the names of employees that work for companies with sales bigger than 200. |
-- Language PostgreSQL
-- Tables:
-- Table: people
columns : [['people id', 'number'], ['age', 'number'], ['name', 'text'], ['nationality', 'text'], ['graduation college', 'text']]
-- Table: company
columns : [['company id', 'number'], ['name', 'text'], ['headquarters', 'text'], ['industry', 'text'], ['sales in billion', 'number'], ['profits in billion', 'number'], ['assets in billion', 'number'], ['market value in billion', 'number']]
-- Table: employment
columns : [['company id', 'number'], ['people id', 'number'], ['year working', '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 `Show the names of employees that work for companies with sales bigger than 200.` to a syntactically-correct PostgreSQL query.
| SELECT T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID WHERE T3.Sales_in_Billion > 200 |
Show the names of companies and the number of employees they have |
-- Language PostgreSQL
-- Tables:
-- Table: people
columns : [['people id', 'number'], ['age', 'number'], ['name', 'text'], ['nationality', 'text'], ['graduation college', 'text']]
-- Table: company
columns : [['company id', 'number'], ['name', 'text'], ['headquarters', 'text'], ['industry', 'text'], ['sales in billion', 'number'], ['profits in billion', 'number'], ['assets in billion', 'number'], ['market value in billion', 'number']]
-- Table: employment
columns : [['company id', 'number'], ['people id', 'number'], ['year working', '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 `Show the names of companies and the number of employees they have` to a syntactically-correct PostgreSQL query.
| SELECT T3.Name , COUNT(*) FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID GROUP BY T3.Name |
List the names of people that are not employed by any company |
-- Language PostgreSQL
-- Tables:
-- Table: people
columns : [['people id', 'number'], ['age', 'number'], ['name', 'text'], ['nationality', 'text'], ['graduation college', 'text']]
-- Table: company
columns : [['company id', 'number'], ['name', 'text'], ['headquarters', 'text'], ['industry', 'text'], ['sales in billion', 'number'], ['profits in billion', 'number'], ['assets in billion', 'number'], ['market value in billion', 'number']]
-- Table: employment
columns : [['company id', 'number'], ['people id', 'number'], ['year working', '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 people that are not employed by any company` to a syntactically-correct PostgreSQL query.
| SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM employment) |
list the names of the companies with more than 200 sales in the descending order of sales and profits. |
-- Language PostgreSQL
-- Tables:
-- Table: people
columns : [['people id', 'number'], ['age', 'number'], ['name', 'text'], ['nationality', 'text'], ['graduation college', 'text']]
-- Table: company
columns : [['company id', 'number'], ['name', 'text'], ['headquarters', 'text'], ['industry', 'text'], ['sales in billion', 'number'], ['profits in billion', 'number'], ['assets in billion', 'number'], ['market value in billion', 'number']]
-- Table: employment
columns : [['company id', 'number'], ['people id', 'number'], ['year working', '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 the companies with more than 200 sales in the descending order of sales and profits.` to a syntactically-correct PostgreSQL query.
| SELECT name FROM company WHERE Sales_in_Billion > 200 ORDER BY Sales_in_Billion , Profits_in_Billion DESC |
How many film are there? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 film are there?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM film |
Count the number of films. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 `Count the number of films.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM film |
List the distinct director of all films. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 distinct director of all films.` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT Director FROM film |
What are the different film Directors? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 film Directors?` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT Director FROM film |
What is the average ticket sales gross in dollars of films? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 ticket sales gross in dollars of films?` to a syntactically-correct PostgreSQL query.
| SELECT avg(Gross_in_dollar) FROM film |
Return the average gross sales in dollars across all films. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 average gross sales in dollars across all films.` to a syntactically-correct PostgreSQL query.
| SELECT avg(Gross_in_dollar) FROM film |
What are the low and high estimates of film markets? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 low and high estimates of film markets?` to a syntactically-correct PostgreSQL query.
| SELECT Low_Estimate , High_Estimate FROM film_market_estimation |
Return the low and high estimates for all film markets. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 low and high estimates for all film markets.` to a syntactically-correct PostgreSQL query.
| SELECT Low_Estimate , High_Estimate FROM film_market_estimation |
What are the types of film market estimations in year 1995? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 types of film market estimations in year 1995?` to a syntactically-correct PostgreSQL query.
| SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995 |
Return the types of film market estimations in 1995. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 types of film market estimations in 1995.` to a syntactically-correct PostgreSQL query.
| SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995 |
What are the maximum and minimum number of cities in all markets. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 number of cities in all markets.` to a syntactically-correct PostgreSQL query.
| SELECT max(Number_cities) , min(Number_cities) FROM market |
Return the maximum and minimum number of cities across all markets. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 maximum and minimum number of cities across all markets.` to a syntactically-correct PostgreSQL query.
| SELECT max(Number_cities) , min(Number_cities) FROM market |
How many markets have number of cities smaller than 300? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 markets have number of cities smaller than 300?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM market WHERE Number_cities < 300 |
Count the number of markets that have a number of cities lower than 300. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 `Count the number of markets that have a number of cities lower than 300.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM market WHERE Number_cities < 300 |
List all countries of markets in ascending alphabetical order. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 all countries of markets in ascending alphabetical order.` to a syntactically-correct PostgreSQL query.
| SELECT Country FROM market ORDER BY Country ASC |
What are the countries for each market, ordered alphabetically? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 countries for each market, ordered alphabetically?` to a syntactically-correct PostgreSQL query.
| SELECT Country FROM market ORDER BY Country ASC |
List all countries of markets in descending order of number of cities. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 all countries of markets in descending order of number of cities.` to a syntactically-correct PostgreSQL query.
| SELECT Country FROM market ORDER BY Number_cities DESC |
What are the countries for each market ordered by decreasing number of cities? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 countries for each market ordered by decreasing number of cities?` to a syntactically-correct PostgreSQL query.
| SELECT Country FROM market ORDER BY Number_cities DESC |
Please show the titles of films and the types of market estimations. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 `Please show the titles of films and the types of market estimations.` to a syntactically-correct PostgreSQL query.
| SELECT T1.Title , T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID |
What are the titles of films and corresponding types of market estimations? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 titles of films and corresponding types of market estimations?` to a syntactically-correct PostgreSQL query.
| SELECT T1.Title , T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID |
Show the distinct director of films with market estimation in the year of 1995. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 `Show the distinct director of films with market estimation in the year of 1995.` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID WHERE T2.Year = 1995 |
Who are the different directors of films which had market estimation in 1995? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 `Who are the different directors of films which had market estimation in 1995?` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID WHERE T2.Year = 1995 |
What is the average number of cities of markets with low film market estimate bigger than 10000? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 number of cities of markets with low film market estimate bigger than 10000?` to a syntactically-correct PostgreSQL query.
| SELECT avg(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T1.Low_Estimate > 10000 |
Give the average number of cities within markets that had a low market estimation larger than 10000? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 the average number of cities within markets that had a low market estimation larger than 10000?` to a syntactically-correct PostgreSQL query.
| SELECT avg(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T1.Low_Estimate > 10000 |
Please list the countries and years of film market estimations. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 `Please list the countries and years of film market estimations.` to a syntactically-correct PostgreSQL query.
| SELECT T2.Country , T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID |
What are the countries of markets and their corresponding years of market estimation? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 countries of markets and their corresponding years of market estimation?` to a syntactically-correct PostgreSQL query.
| SELECT T2.Country , T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID |
Please list the years of film market estimations when the market is in country "Japan" in descending order. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 `Please list the years of film market estimations when the market is in country "Japan" in descending order.` to a syntactically-correct PostgreSQL query.
| SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = "Japan" ORDER BY T1.Year DESC |
What are the years of film market estimation for the market of Japan, ordered by year descending? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 years of film market estimation for the market of Japan, ordered by year descending?` to a syntactically-correct PostgreSQL query.
| SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = "Japan" ORDER BY T1.Year DESC |
List the studios of each film and the number of films produced by that studio. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 studios of each film and the number of films produced by that studio.` to a syntactically-correct PostgreSQL query.
| SELECT Studio , COUNT(*) FROM film GROUP BY Studio |
How films are produced by each studio? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 films are produced by each studio?` to a syntactically-correct PostgreSQL query.
| SELECT Studio , COUNT(*) FROM film GROUP BY Studio |
List the name of film studio that have the most number of films. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 of film studio that have the most number of films.` to a syntactically-correct PostgreSQL query.
| SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1 |
What is the name of teh studio that created the most films? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 teh studio that created the most films?` to a syntactically-correct PostgreSQL query.
| SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1 |
List the names of studios that have at least two films. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 studios that have at least two films.` to a syntactically-correct PostgreSQL query.
| SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2 |
What are the names of studios that have made two or more films? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 studios that have made two or more films?` to a syntactically-correct PostgreSQL query.
| SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2 |
List the title of films that do not have any market estimation. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 title of films that do not have any market estimation.` to a syntactically-correct PostgreSQL query.
| SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM film_market_estimation) |
What are the titles of films that do not have a film market estimation? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 titles of films that do not have a film market estimation?` to a syntactically-correct PostgreSQL query.
| SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM film_market_estimation) |
Show the studios that have produced films with director "Nicholas Meyer" and "Walter Hill". |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 `Show the studios that have produced films with director "Nicholas Meyer" and "Walter Hill".` to a syntactically-correct PostgreSQL query.
| SELECT Studio FROM film WHERE Director = "Nicholas Meyer" INTERSECT SELECT Studio FROM film WHERE Director = "Walter Hill" |
What are the names of studios that have produced films with both Nicholas Meyer and Walter Hill? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 studios that have produced films with both Nicholas Meyer and Walter Hill?` to a syntactically-correct PostgreSQL query.
| SELECT Studio FROM film WHERE Director = "Nicholas Meyer" INTERSECT SELECT Studio FROM film WHERE Director = "Walter Hill" |
Find the titles and studios of the films that are produced by some film studios that contained the word "Universal". |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 titles and studios of the films that are produced by some film studios that contained the word "Universal".` to a syntactically-correct PostgreSQL query.
| SELECT title , Studio FROM film WHERE Studio LIKE "%Universal%" |
What are the titles and studios of films that have been produced by a studio whose name contains "Universal"? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 titles and studios of films that have been produced by a studio whose name contains "Universal"?` to a syntactically-correct PostgreSQL query.
| SELECT title , Studio FROM film WHERE Studio LIKE "%Universal%" |
Show the studios that have not produced films with director "Walter Hill". |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 `Show the studios that have not produced films with director "Walter Hill".` to a syntactically-correct PostgreSQL query.
| SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director = "Walter Hill" |
Which studios have never worked with the director Walter Hill? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 `Which studios have never worked with the director Walter Hill?` to a syntactically-correct PostgreSQL query.
| SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director = "Walter Hill" |
List the studios which average gross is above 4500000. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 studios which average gross is above 4500000.` to a syntactically-correct PostgreSQL query.
| SELECT Studio FROM film GROUP BY Studio HAVING avg(Gross_in_dollar) >= 4500000 |
Which studios have an average gross of over 4500000? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 `Which studios have an average gross of over 4500000?` to a syntactically-correct PostgreSQL query.
| SELECT Studio FROM film GROUP BY Studio HAVING avg(Gross_in_dollar) >= 4500000 |
What is the title of the film that has the highest high market estimation. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 title of the film that has the highest high market estimation.` to a syntactically-correct PostgreSQL query.
| SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1 |
Return the title of the film with the highest high estimate? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 title of the film with the highest high estimate?` to a syntactically-correct PostgreSQL query.
| SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1 |
What are the titles and directors of the films were never presented in China? |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 titles and directors of the films were never presented in China?` to a syntactically-correct PostgreSQL query.
| SELECT title , director FROM film WHERE film_id NOT IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.Market_ID WHERE country = 'China') |
Return the titles and directors of films that were never in the market of China. |
-- Language PostgreSQL
-- Tables:
-- Table: film
columns : [['film id', 'number'], ['title', 'text'], ['studio', 'text'], ['director', 'text'], ['gross in dollar', 'number']]
-- Table: market
columns : [['market id', 'number'], ['country', 'text'], ['number cities', 'number']]
-- Table: film market estimation
columns : [['estimation id', 'number'], ['low estimate', 'number'], ['high estimate', 'number'], ['film id', 'number'], ['type', 'text'], ['market id', 'number'], ['year', '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 titles and directors of films that were never in the market of China.` to a syntactically-correct PostgreSQL query.
| SELECT title , director FROM film WHERE film_id NOT IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.Market_ID WHERE country = 'China') |
How many calendar items do we have? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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 `How many calendar items do we have?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM Ref_calendar |
Count the number of all the calendar items. |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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 `Count the number of all the calendar items.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM Ref_calendar |
Show all calendar dates and day Numbers. |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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 `Show all calendar dates and day Numbers.` to a syntactically-correct PostgreSQL query.
| SELECT calendar_date , day_Number FROM Ref_calendar |
What are all the calendar dates and day Numbers? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are all the calendar dates and day Numbers?` to a syntactically-correct PostgreSQL query.
| SELECT calendar_date , day_Number FROM Ref_calendar |
Show the number of document types. |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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 `Show the number of document types.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM Ref_document_types |
How many document types are there? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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 `How many document types are there?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM Ref_document_types |
List all document type codes and document type names. |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List all document type codes and document type names.` to a syntactically-correct PostgreSQL query.
| SELECT document_type_code , document_type_name FROM Ref_document_types |
What are all the document type codes and document type names? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are all the document type codes and document type names?` to a syntactically-correct PostgreSQL query.
| SELECT document_type_code , document_type_name FROM Ref_document_types |
What is the name and description for document type code RV? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the name and description for document type code RV?` to a syntactically-correct PostgreSQL query.
| SELECT document_type_name , document_type_description FROM Ref_document_types WHERE document_type_code = "RV" |
Give me the name and description of the document type code RV. |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Give me the name and description of the document type code RV.` to a syntactically-correct PostgreSQL query.
| SELECT document_type_name , document_type_description FROM Ref_document_types WHERE document_type_code = "RV" |
What is the document type code for document type "Paper"? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the document type code for document type "Paper"?` to a syntactically-correct PostgreSQL query.
| SELECT document_type_code FROM Ref_document_types WHERE document_type_name = "Paper" |
Find the code of the document type "Paper". |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the code of the document type "Paper".` to a syntactically-correct PostgreSQL query.
| SELECT document_type_code FROM Ref_document_types WHERE document_type_name = "Paper" |
Show the number of documents with document type code CV or BK. |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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 `Show the number of documents with document type code CV or BK.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM All_documents WHERE document_type_code = "CV" OR document_type_code = "BK" |
How many documents have document type code CV or BK? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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 `How many documents have document type code CV or BK?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM All_documents WHERE document_type_code = "CV" OR document_type_code = "BK" |
What is the date when the document "Marry CV" was stored? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the date when the document "Marry CV" was stored?` to a syntactically-correct PostgreSQL query.
| SELECT date_stored FROM All_documents WHERE Document_name = "Marry CV" |
When was the document named "Marry CV" stored? Give me the date. |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `When was the document named "Marry CV" stored? Give me the date.` to a syntactically-correct PostgreSQL query.
| SELECT date_stored FROM All_documents WHERE Document_name = "Marry CV" |
What is the day Number and date of all the documents? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the day Number and date of all the documents?` to a syntactically-correct PostgreSQL query.
| SELECT T2.day_Number , T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored = T2.calendar_date |
Return the day Number and stored date for all the documents. |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Return the day Number and stored date for all the documents.` to a syntactically-correct PostgreSQL query.
| SELECT T2.day_Number , T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored = T2.calendar_date |
What is the document type name for the document with name "How to read a book"? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the document type name for the document with name "How to read a book"?` to a syntactically-correct PostgreSQL query.
| SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = "How to read a book" |
Find the document type name of the document named "How to read a book". |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the document type name of the document named "How to read a book".` to a syntactically-correct PostgreSQL query.
| SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = "How to read a book" |
Show the number of locations. |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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 `Show the number of locations.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM Ref_locations |
How many locations are listed in the database? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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 `How many locations are listed in the database?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM Ref_locations |
List all location codes and location names. |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List all location codes and location names.` to a syntactically-correct PostgreSQL query.
| SELECT location_code , location_name FROM Ref_locations |
What are all the location codes and location names? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are all the location codes and location names?` to a syntactically-correct PostgreSQL query.
| SELECT location_code , location_name FROM Ref_locations |
What are the name and description for location code x? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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 name and description for location code x?` to a syntactically-correct PostgreSQL query.
| SELECT location_name , location_description FROM Ref_locations WHERE location_code = "x" |
Give me the name and description of the location with code x. |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Give me the name and description of the location with code x.` to a syntactically-correct PostgreSQL query.
| SELECT location_name , location_description FROM Ref_locations WHERE location_code = "x" |
What is the location code for the country "Canada"? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the location code for the country "Canada"?` to a syntactically-correct PostgreSQL query.
| SELECT location_code FROM Ref_locations WHERE location_name = "Canada" |
Show the location code of the country "Canada". |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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 `Show the location code of the country "Canada".` to a syntactically-correct PostgreSQL query.
| SELECT location_code FROM Ref_locations WHERE location_name = "Canada" |
How many roles are there? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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 `How many roles are there?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM ROLES |
Count the total number of roles listed. |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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 `Count the total number of roles listed.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM ROLES |
List all role codes, role names, and role descriptions. |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List all role codes, role names, and role descriptions.` to a syntactically-correct PostgreSQL query.
| SELECT role_code , role_name , role_description FROM ROLES |
What are all the role codes, role names, and role descriptions? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are all the role codes, role names, and role descriptions?` to a syntactically-correct PostgreSQL query.
| SELECT role_code , role_name , role_description FROM ROLES |
What are the name and description for role code "MG"? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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 name and description for role code "MG"?` to a syntactically-correct PostgreSQL query.
| SELECT role_name , role_description FROM ROLES WHERE role_code = "MG" |
Find the name and description of the role with code "MG". |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the name and description of the role with code "MG".` to a syntactically-correct PostgreSQL query.
| SELECT role_name , role_description FROM ROLES WHERE role_code = "MG" |
Show the description for role name "Proof Reader". |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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 `Show the description for role name "Proof Reader".` to a syntactically-correct PostgreSQL query.
| SELECT role_description FROM ROLES WHERE role_name = "Proof Reader" |
What is the description of the role named "Proof Reader"? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the description of the role named "Proof Reader"?` to a syntactically-correct PostgreSQL query.
| SELECT role_description FROM ROLES WHERE role_name = "Proof Reader" |
How many employees do we have? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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 `How many employees do we have?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM Employees |
Find the number of employees we have. |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the number of employees we have.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM Employees |
Show the name, role code, and date of birth for the employee with name 'Armani'. |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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 `Show the name, role code, and date of birth for the employee with name 'Armani'.` to a syntactically-correct PostgreSQL query.
| SELECT employee_name , role_code , date_of_birth FROM Employees WHERE employee_Name = 'Armani' |
What are the name, role code, and date of birth of the employee named 'Armani'? |
-- Language PostgreSQL
-- Tables:
-- Table: reference document types
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]
-- Table: reference calendar
columns : [['calendar date', 'time'], ['day number', 'number']]
-- Table: reference locations
columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']]
-- Table: roles
columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']]
-- Table: all documents
columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]
-- Table: employees
columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']]
-- Table: document locations
columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']]
-- Table: documents to be destroyed
columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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 name, role code, and date of birth of the employee named 'Armani'?` to a syntactically-correct PostgreSQL query.
| SELECT employee_name , role_code , date_of_birth FROM Employees WHERE employee_Name = 'Armani' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.