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



Question: List the studios of each film and the number of films produced by that studio.
SQL: SELECT Studio ,  COUNT(*) FROM film GROUP BY 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.



Question: How films are produced by each studio?
SQL: SELECT Studio ,  COUNT(*) FROM film GROUP BY 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.



Question: List the name of film studio that have the most number of films.
SQL: SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1
-- 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.



Question: What is the name of teh studio that created the most films?
SQL: SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1
-- 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.



Question: List the names of studios that have at least two films.
SQL: SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*)  >=  2
-- 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.



Question: What are the names of studios that have made two or more films?
SQL: SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*)  >=  2
-- 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.



Question: List the title of films that do not have any market estimation.
SQL: SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM 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.



Question: What are the titles of films that do not have a film market estimation?
SQL: SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM 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.



Question: Show the studios that have produced films with director "Nicholas Meyer" and "Walter Hill".
SQL: SELECT Studio FROM film WHERE Director  =  "Nicholas Meyer" INTERSECT SELECT Studio FROM film WHERE 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.



Question: What are the names of studios that have produced films with both Nicholas Meyer and Walter Hill?
SQL: SELECT Studio FROM film WHERE Director  =  "Nicholas Meyer" INTERSECT SELECT Studio FROM film WHERE 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.



Question: Find the titles and studios of the films that are produced by some film studios that contained the word "Universal".
SQL: SELECT title ,  Studio FROM film WHERE Studio LIKE "%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.



Question: What are the titles and studios of films that have been produced by a studio whose name contains "Universal"?
SQL: SELECT title ,  Studio FROM film WHERE Studio LIKE "%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.



Question: Show the studios that have not produced films with director "Walter Hill".
SQL: SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE 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.



Question: Which studios have never worked with the director Walter Hill?
SQL: SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE 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.



Question: List the studios which average gross is above 4500000.
SQL: SELECT Studio FROM film GROUP BY Studio HAVING avg(Gross_in_dollar)  >=  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.



Question: Which studios have an average gross of over 4500000?
SQL: SELECT Studio FROM film GROUP BY Studio HAVING avg(Gross_in_dollar)  >=  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.



Question: What is the title of the film that has the highest high market estimation.
SQL: 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
-- 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.



Question: Return the title of the film with the highest high estimate?
SQL: 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
-- 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.



Question: What are the titles and directors of the films were never presented in China?
SQL: 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')
-- 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.



Question: Return the titles and directors of films that were never in the market of China.
SQL: 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')
-- 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.



Question: How many calendar items do we have?
SQL: SELECT count(*) FROM Ref_calendar
-- 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.



Question: Count the number of all the calendar items.
SQL: SELECT count(*) FROM Ref_calendar
-- 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.



Question: Show all calendar dates and day Numbers.
SQL: SELECT calendar_date ,  day_Number FROM Ref_calendar
-- 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.



Question: What are all the calendar dates and day Numbers?
SQL: SELECT calendar_date ,  day_Number FROM Ref_calendar
-- 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.



Question: Show the number of document types.
SQL: SELECT count(*) FROM Ref_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.



Question: How many document types are there?
SQL: SELECT count(*) FROM Ref_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.



Question: List all document type codes and document type names.
SQL: SELECT document_type_code ,  document_type_name FROM Ref_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.



Question: What are all the document type codes and document type names?
SQL: SELECT document_type_code ,  document_type_name FROM Ref_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.



Question: What is the name and description for document type code RV?
SQL: SELECT document_type_name ,  document_type_description FROM Ref_document_types WHERE 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.



Question: Give me the name and description of the document type code RV.
SQL: SELECT document_type_name ,  document_type_description FROM Ref_document_types WHERE 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.



Question: What is the document type code for document type "Paper"?
SQL: SELECT document_type_code FROM Ref_document_types WHERE document_type_name  =  "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.



Question: Find the code of the document type "Paper".
SQL: SELECT document_type_code FROM Ref_document_types WHERE document_type_name  =  "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.



Question: Show the number of documents with document type code CV or BK.
SQL: SELECT count(*) FROM All_documents WHERE document_type_code  =  "CV" OR document_type_code  =  "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.



Question: How many documents have document type code CV or BK?
SQL: SELECT count(*) FROM All_documents WHERE document_type_code  =  "CV" OR document_type_code  =  "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.



Question: What is the date when the document "Marry CV" was stored?
SQL: SELECT date_stored FROM All_documents WHERE Document_name  =  "Marry CV"