sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the average, maximum, and minimum number of floors for all buildings?
SQL: SELECT avg(floors) ,  max(floors) ,  min(floors) FROM building
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the number of buildings with a height above the average or a number of floors above the average.
SQL: SELECT count(*) FROM building WHERE height_feet  >  (SELECT avg(height_feet) FROM building) OR floors  >  (SELECT avg(floors) FROM building)
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: List the names of buildings with at least 200 feet of height and with at least 20 floors.
SQL: SELECT name FROM building WHERE height_feet  >=  200 AND floors  >=  20
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the names and locations of institutions that are founded after 1990 and have the type "Private".
SQL: SELECT institution ,  LOCATION FROM institution WHERE founded  >  1990 AND TYPE  =  'Private'
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show institution types, along with the number of institutions and total enrollment for each type.
SQL: SELECT TYPE ,  count(*) ,  sum(enrollment) FROM institution GROUP BY TYPE
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the institution type with the largest number of institutions.
SQL: SELECT TYPE FROM institution GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the institution type with an institution founded after 1990 and an institution with at least 1000 enrollment.
SQL: SELECT TYPE FROM institution WHERE founded  >  1990 AND enrollment  >=  1000
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the name of buildings that do not have any institution.
SQL: SELECT name FROM building WHERE building_id NOT IN (SELECT building_id FROM institution)
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the names of buildings except for those having an institution founded in 2003.
SQL: SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id  =  T2.building_id WHERE T2.founded  =  2003
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: For each building, show the name of the building and the number of institutions in it.
SQL: SELECT T1.name ,  count(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id  =  T2.building_id GROUP BY T1.building_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the names and heights of buildings with at least two institutions founded after 1880.
SQL: SELECT T1.name ,  T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id  =  T2.building_id WHERE T2.founded  >  1880 GROUP BY T1.building_id HAVING count(*)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show all the distinct institution types.
SQL: SELECT DISTINCT TYPE FROM institution
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show institution names along with the number of proteins for each institution.
SQL: SELECT T1.institution ,  count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id  =  T2.institution_id GROUP BY T1.institution_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: How many proteins are associated with an institution founded after 1880 or an institution with type "Private"?
SQL: SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id  =  T2.institution_id WHERE T1.founded  >  1880 OR T1.type  =  'Private'
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the protein name and the institution name.
SQL: SELECT T2.protein_name ,  T1.institution FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id  =  T2.institution_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: How many proteins are associated with an institution in a building with at least 20 floors?
SQL: SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id  =  T2.institution_id JOIN building AS T3 ON T3.building_id  =  T1.building_id WHERE T3.floors  >=  20
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: How many institutions do not have an associated protein in our record?
SQL: SELECT count(*) FROM institution WHERE institution_id NOT IN (SELECT institution_id FROM protein)
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 all the locations where no cinema has capacity over 800.
SQL: SELECT LOCATION FROM cinema EXCEPT SELECT LOCATION FROM cinema WHERE capacity  >  800
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 all the locations where some cinemas were opened in both year 2010 and year 2011.
SQL: SELECT LOCATION FROM cinema WHERE openning_year  =  2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year  =  2011
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 many cinema do we have?
SQL: SELECT count(*) FROM cinema
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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: Count the number of cinemas.
SQL: SELECT count(*) FROM cinema
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 name, opening year, and capacity for each cinema.
SQL: SELECT name ,  openning_year ,  capacity FROM cinema
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 cinema name and location for cinemas with capacity above average.
SQL: SELECT name ,  LOCATION FROM cinema WHERE capacity  >  (SELECT avg(capacity) FROM cinema)
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 all the locations with a cinema?
SQL: SELECT DISTINCT LOCATION FROM cinema
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 distinct locations that has a cinema.
SQL: SELECT DISTINCT LOCATION FROM cinema
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 all the cinema names and opening years in descending order of opening year.
SQL: SELECT name ,  openning_year FROM cinema ORDER BY openning_year DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 name and location of the cinema with the largest capacity?
SQL: SELECT name ,  LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 average, minimum, and maximum capacity for all the cinemas opened in year 2011 or later.
SQL: SELECT avg(capacity) ,  min(capacity) ,  max(capacity) FROM cinema WHERE openning_year  >=  2011
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 each location and the number of cinemas there.
SQL: SELECT LOCATION ,  count(*) FROM cinema GROUP BY LOCATION
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 location with the most cinemas opened in year 2010 or later?
SQL: SELECT LOCATION FROM cinema WHERE openning_year  >=  2010 GROUP BY LOCATION ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 all the locations with at least two cinemas with capacity above 300.
SQL: SELECT LOCATION FROM cinema WHERE capacity  >  300 GROUP BY LOCATION HAVING count(*)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 locations have 2 or more cinemas with capacity over 300?
SQL: SELECT LOCATION FROM cinema WHERE capacity  >  300 GROUP BY LOCATION HAVING count(*)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 title and director for all films.
SQL: SELECT title ,  directed_by FROM film
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 title and director of each film?
SQL: SELECT title ,  directed_by FROM film
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 all directors.
SQL: SELECT DISTINCT directed_by FROM film
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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: Who are all the directors?
SQL: SELECT DISTINCT directed_by FROM film
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 all directors along with the number of films directed by each director.
SQL: SELECT directed_by ,  count(*) FROM film GROUP BY directed_by
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 total number of show times per dat for each cinema?
SQL: SELECT T2.name ,  sum(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id  =  T2.cinema_id GROUP BY T1.cinema_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 title and maximum price of each film?
SQL: SELECT T2.title ,  max(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id GROUP BY T1.film_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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: Give me the title and highest price for each film.
SQL: SELECT T2.title ,  max(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id GROUP BY T1.film_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 cinema name, film title, date, and price for each record in schedule.
SQL: SELECT T3.name ,  T2.title ,  T1.date ,  T1.price FROM schedule AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id JOIN cinema AS T3 ON T1.cinema_id  =  T3.cinema_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 title and director of the films without any schedule?
SQL: SELECT title ,  directed_by FROM film WHERE film_id NOT IN (SELECT film_id FROM schedule)
-- Language PostgreSQL
        -- Tables: 
             -- Table: film 
columns : [['film id', 'number'], ['rank in series', 'number'], ['number in season', 'number'], ['title', 'text'], ['directed by', 'text'], ['original air date', 'text'], ['production code', 'text']]

 -- Table: cinema 
columns : [['cinema id', 'number'], ['name', 'text'], ['openning year', 'number'], ['capacity', 'number'], ['location', 'text']]

 -- Table: schedule 
columns : [['cinema id', 'number'], ['film id', 'number'], ['date', 'text'], ['show times per day', 'number'], ['price', '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 director with the largest number of show times in total.
SQL: SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id GROUP BY T2.directed_by ORDER BY sum(T1.show_times_per_day) DESC LIMIT 1