sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: body builder 
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]

 -- Table: people 
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', '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 birth places that are shared by at least two people?
SQL: SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: body builder 
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]

 -- Table: people 
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', '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 height and weight of people in descending order of height.
SQL: SELECT Height ,  Weight FROM people ORDER BY Height DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: body builder 
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]

 -- Table: people 
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', '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 information about each body builder.
SQL: SELECT * FROM body_builder
-- Language PostgreSQL
        -- Tables: 
             -- Table: body builder 
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]

 -- Table: people 
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', '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 and origins of people who are not body builders.
SQL: SELECT Name ,  birth_place FROM people EXCEPT SELECT T1.Name ,  T1.birth_place FROM people AS T1 JOIN body_builder AS T2 ON T1.people_id  =  T2.people_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: body builder 
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]

 -- Table: people 
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', '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 distinct birth places are there?
SQL: SELECT count(DISTINCT Birth_Place) FROM people
-- Language PostgreSQL
        -- Tables: 
             -- Table: body builder 
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]

 -- Table: people 
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', '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 persons are not body builders?
SQL: SELECT count(*) FROM people WHERE people_id NOT IN (SELECT People_ID FROM body_builder)
-- Language PostgreSQL
        -- Tables: 
             -- Table: body builder 
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]

 -- Table: people 
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', '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 weight of the body builders who have snatch score higher than 140 or have the height greater than 200.
SQL: SELECT T2.weight FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id  =  T2.people_id WHERE T1.snatch  >  140 OR T2.height  >  200;
-- Language PostgreSQL
        -- Tables: 
             -- Table: body builder 
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]

 -- Table: people 
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', '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 total scores of the body builders whose birthday contains the string "January" ?
SQL: SELECT T1.total FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id  =  T2.people_id WHERE T2.Birth_Date LIKE "%January%";
-- Language PostgreSQL
        -- Tables: 
             -- Table: body builder 
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]

 -- Table: people 
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', '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 minimum snatch score?
SQL: SELECT min(snatch) FROM body_builder
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 elections are there?
SQL: SELECT count(*) FROM election
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 votes of elections in descending order.
SQL: SELECT Votes FROM election ORDER BY Votes DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 dates and vote percents of elections.
SQL: SELECT Date ,  Vote_Percent FROM election
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 minimum and maximum vote percents of elections?
SQL: SELECT min(Vote_Percent) ,  max(Vote_Percent) FROM election
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 names and parties of representatives?
SQL: SELECT Name ,  Party FROM representative
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 names of representatives whose party is not "Republican"?
SQL: SELECT Name FROM Representative WHERE Party != "Republican"
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 life spans of representatives from New York state or Indiana state?
SQL: SELECT Lifespan FROM representative WHERE State  =  "New York" OR State  =  "Indiana"
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 names of representatives and the dates of elections they participated in.
SQL: SELECT T2.Name ,  T1.Date FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 names of representatives with more than 10000 votes in election?
SQL: SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID WHERE Votes  >  10000
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 names of representatives in descending order of votes?
SQL: SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID ORDER BY votes DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 party of the representative that has the smallest number of votes.
SQL: SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID ORDER BY votes ASC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 lifespans of representatives in descending order of vote percent?
SQL: SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID ORDER BY Vote_Percent DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 average number of votes of representatives from party "Republican"?
SQL: SELECT avg(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID WHERE T2.Party  =  "Republican"
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 different parties of representative? Show the party name and the number of representatives in each party.
SQL: SELECT Party ,  COUNT(*) FROM representative GROUP BY Party
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 party that has the largest number of representatives?
SQL: SELECT Party ,  COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 parties have at least three representatives?
SQL: SELECT Party FROM representative GROUP BY Party HAVING COUNT(*)  >=  3
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 states have at least two representatives?
SQL: SELECT State FROM representative GROUP BY State HAVING COUNT(*)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 representatives that have not participated in elections listed here.
SQL: SELECT Name FROM representative WHERE Representative_ID NOT IN (SELECT Representative_ID FROM election)
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 parties that have both representatives in New York state and representatives in Pennsylvania state.
SQL: SELECT Party FROM representative WHERE State  =  "New York" INTERSECT SELECT Party FROM representative WHERE State  =  "Pennsylvania"
-- Language PostgreSQL
        -- Tables: 
             -- Table: election 
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]

 -- Table: representative 
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', '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 distinct parties are there for representatives?
SQL: SELECT count(DISTINCT Party) FROM representative
-- Language PostgreSQL
        -- Tables: 
             -- Table: apartment buildings 
columns : [['building id', 'number'], ['building short name', 'text'], ['building full name', 'text'], ['building description', 'text'], ['building address', 'text'], ['building manager', 'text'], ['building phone', 'text']]

 -- Table: apartments 
columns : [['apartment id', 'number'], ['building id', 'number'], ['apartment type code', 'text'], ['apartment number', 'text'], ['bathroom count', 'number'], ['bedroom count', 'number'], ['room count', 'text']]

 -- Table: apartment facilities 
columns : [['apartment id', 'number'], ['facility code', 'text']]

 -- Table: guests 
columns : [['guest id', 'number'], ['gender code', 'text'], ['guest first name', 'text'], ['guest last name', 'text'], ['date of birth', 'time']]

 -- Table: apartment bookings 
columns : [['apartment booking id', 'number'], ['apartment id', 'number'], ['guest id', 'number'], ['booking status code', 'text'], ['booking start date', 'time'], ['booking end date', 'time']]

 -- Table: view unit status 
columns : [['apartment id', 'number'], ['apartment booking id', 'number'], ['status date', 'time'], ['available yes or no', 'others']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the 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 apartment bookings are there in total?
SQL: SELECT count(*) FROM Apartment_Bookings
-- Language PostgreSQL
        -- Tables: 
             -- Table: apartment buildings 
columns : [['building id', 'number'], ['building short name', 'text'], ['building full name', 'text'], ['building description', 'text'], ['building address', 'text'], ['building manager', 'text'], ['building phone', 'text']]

 -- Table: apartments 
columns : [['apartment id', 'number'], ['building id', 'number'], ['apartment type code', 'text'], ['apartment number', 'text'], ['bathroom count', 'number'], ['bedroom count', 'number'], ['room count', 'text']]

 -- Table: apartment facilities 
columns : [['apartment id', 'number'], ['facility code', 'text']]

 -- Table: guests 
columns : [['guest id', 'number'], ['gender code', 'text'], ['guest first name', 'text'], ['guest last name', 'text'], ['date of birth', 'time']]

 -- Table: apartment bookings 
columns : [['apartment booking id', 'number'], ['apartment id', 'number'], ['guest id', 'number'], ['booking status code', 'text'], ['booking start date', 'time'], ['booking end date', 'time']]

 -- Table: view unit status 
columns : [['apartment id', 'number'], ['apartment booking id', 'number'], ['status date', 'time'], ['available yes or no', 'others']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the 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 total number of apartment bookings.
SQL: SELECT count(*) FROM Apartment_Bookings
-- Language PostgreSQL
        -- Tables: 
             -- Table: apartment buildings 
columns : [['building id', 'number'], ['building short name', 'text'], ['building full name', 'text'], ['building description', 'text'], ['building address', 'text'], ['building manager', 'text'], ['building phone', 'text']]

 -- Table: apartments 
columns : [['apartment id', 'number'], ['building id', 'number'], ['apartment type code', 'text'], ['apartment number', 'text'], ['bathroom count', 'number'], ['bedroom count', 'number'], ['room count', 'text']]

 -- Table: apartment facilities 
columns : [['apartment id', 'number'], ['facility code', 'text']]

 -- Table: guests 
columns : [['guest id', 'number'], ['gender code', 'text'], ['guest first name', 'text'], ['guest last name', 'text'], ['date of birth', 'time']]

 -- Table: apartment bookings 
columns : [['apartment booking id', 'number'], ['apartment id', 'number'], ['guest id', 'number'], ['booking status code', 'text'], ['booking start date', 'time'], ['booking end date', 'time']]

 -- Table: view unit status 
columns : [['apartment id', 'number'], ['apartment booking id', 'number'], ['status date', 'time'], ['available yes or no', 'others']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the 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 start dates and end dates of all the apartment bookings.
SQL: SELECT booking_start_date ,  booking_end_date FROM Apartment_Bookings
-- Language PostgreSQL
        -- Tables: 
             -- Table: apartment buildings 
columns : [['building id', 'number'], ['building short name', 'text'], ['building full name', 'text'], ['building description', 'text'], ['building address', 'text'], ['building manager', 'text'], ['building phone', 'text']]

 -- Table: apartments 
columns : [['apartment id', 'number'], ['building id', 'number'], ['apartment type code', 'text'], ['apartment number', 'text'], ['bathroom count', 'number'], ['bedroom count', 'number'], ['room count', 'text']]

 -- Table: apartment facilities 
columns : [['apartment id', 'number'], ['facility code', 'text']]

 -- Table: guests 
columns : [['guest id', 'number'], ['gender code', 'text'], ['guest first name', 'text'], ['guest last name', 'text'], ['date of birth', 'time']]

 -- Table: apartment bookings 
columns : [['apartment booking id', 'number'], ['apartment id', 'number'], ['guest id', 'number'], ['booking status code', 'text'], ['booking start date', 'time'], ['booking end date', 'time']]

 -- Table: view unit status 
columns : [['apartment id', 'number'], ['apartment booking id', 'number'], ['status date', 'time'], ['available yes or no', 'others']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the 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 start date and end date of each apartment booking?
SQL: SELECT booking_start_date ,  booking_end_date FROM Apartment_Bookings
-- Language PostgreSQL
        -- Tables: 
             -- Table: apartment buildings 
columns : [['building id', 'number'], ['building short name', 'text'], ['building full name', 'text'], ['building description', 'text'], ['building address', 'text'], ['building manager', 'text'], ['building phone', 'text']]

 -- Table: apartments 
columns : [['apartment id', 'number'], ['building id', 'number'], ['apartment type code', 'text'], ['apartment number', 'text'], ['bathroom count', 'number'], ['bedroom count', 'number'], ['room count', 'text']]

 -- Table: apartment facilities 
columns : [['apartment id', 'number'], ['facility code', 'text']]

 -- Table: guests 
columns : [['guest id', 'number'], ['gender code', 'text'], ['guest first name', 'text'], ['guest last name', 'text'], ['date of birth', 'time']]

 -- Table: apartment bookings 
columns : [['apartment booking id', 'number'], ['apartment id', 'number'], ['guest id', 'number'], ['booking status code', 'text'], ['booking start date', 'time'], ['booking end date', 'time']]

 -- Table: view unit status 
columns : [['apartment id', 'number'], ['apartment booking id', 'number'], ['status date', 'time'], ['available yes or no', 'others']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the 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 distinct building descriptions.
SQL: SELECT DISTINCT building_description FROM Apartment_Buildings
-- Language PostgreSQL
        -- Tables: 
             -- Table: apartment buildings 
columns : [['building id', 'number'], ['building short name', 'text'], ['building full name', 'text'], ['building description', 'text'], ['building address', 'text'], ['building manager', 'text'], ['building phone', 'text']]

 -- Table: apartments 
columns : [['apartment id', 'number'], ['building id', 'number'], ['apartment type code', 'text'], ['apartment number', 'text'], ['bathroom count', 'number'], ['bedroom count', 'number'], ['room count', 'text']]

 -- Table: apartment facilities 
columns : [['apartment id', 'number'], ['facility code', 'text']]

 -- Table: guests 
columns : [['guest id', 'number'], ['gender code', 'text'], ['guest first name', 'text'], ['guest last name', 'text'], ['date of birth', 'time']]

 -- Table: apartment bookings 
columns : [['apartment booking id', 'number'], ['apartment id', 'number'], ['guest id', 'number'], ['booking status code', 'text'], ['booking start date', 'time'], ['booking end date', 'time']]

 -- Table: view unit status 
columns : [['apartment id', 'number'], ['apartment booking id', 'number'], ['status date', 'time'], ['available yes or no', 'others']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the 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 a list of all the distinct building descriptions.
SQL: SELECT DISTINCT building_description FROM Apartment_Buildings
-- Language PostgreSQL
        -- Tables: 
             -- Table: apartment buildings 
columns : [['building id', 'number'], ['building short name', 'text'], ['building full name', 'text'], ['building description', 'text'], ['building address', 'text'], ['building manager', 'text'], ['building phone', 'text']]

 -- Table: apartments 
columns : [['apartment id', 'number'], ['building id', 'number'], ['apartment type code', 'text'], ['apartment number', 'text'], ['bathroom count', 'number'], ['bedroom count', 'number'], ['room count', 'text']]

 -- Table: apartment facilities 
columns : [['apartment id', 'number'], ['facility code', 'text']]

 -- Table: guests 
columns : [['guest id', 'number'], ['gender code', 'text'], ['guest first name', 'text'], ['guest last name', 'text'], ['date of birth', 'time']]

 -- Table: apartment bookings 
columns : [['apartment booking id', 'number'], ['apartment id', 'number'], ['guest id', 'number'], ['booking status code', 'text'], ['booking start date', 'time'], ['booking end date', 'time']]

 -- Table: view unit status 
columns : [['apartment id', 'number'], ['apartment booking id', 'number'], ['status date', 'time'], ['available yes or no', 'others']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the 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 short names of the buildings managed by "Emma".
SQL: SELECT building_short_name FROM Apartment_Buildings WHERE building_manager	 =  "Emma"
-- Language PostgreSQL
        -- Tables: 
             -- Table: apartment buildings 
columns : [['building id', 'number'], ['building short name', 'text'], ['building full name', 'text'], ['building description', 'text'], ['building address', 'text'], ['building manager', 'text'], ['building phone', 'text']]

 -- Table: apartments 
columns : [['apartment id', 'number'], ['building id', 'number'], ['apartment type code', 'text'], ['apartment number', 'text'], ['bathroom count', 'number'], ['bedroom count', 'number'], ['room count', 'text']]

 -- Table: apartment facilities 
columns : [['apartment id', 'number'], ['facility code', 'text']]

 -- Table: guests 
columns : [['guest id', 'number'], ['gender code', 'text'], ['guest first name', 'text'], ['guest last name', 'text'], ['date of birth', 'time']]

 -- Table: apartment bookings 
columns : [['apartment booking id', 'number'], ['apartment id', 'number'], ['guest id', 'number'], ['booking status code', 'text'], ['booking start date', 'time'], ['booking end date', 'time']]

 -- Table: view unit status 
columns : [['apartment id', 'number'], ['apartment booking id', 'number'], ['status date', 'time'], ['available yes or no', 'others']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the 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 buildings does "Emma" manage? Give me the short names of the buildings.
SQL: SELECT building_short_name FROM Apartment_Buildings WHERE building_manager	 =  "Emma"
-- Language PostgreSQL
        -- Tables: 
             -- Table: apartment buildings 
columns : [['building id', 'number'], ['building short name', 'text'], ['building full name', 'text'], ['building description', 'text'], ['building address', 'text'], ['building manager', 'text'], ['building phone', 'text']]

 -- Table: apartments 
columns : [['apartment id', 'number'], ['building id', 'number'], ['apartment type code', 'text'], ['apartment number', 'text'], ['bathroom count', 'number'], ['bedroom count', 'number'], ['room count', 'text']]

 -- Table: apartment facilities 
columns : [['apartment id', 'number'], ['facility code', 'text']]

 -- Table: guests 
columns : [['guest id', 'number'], ['gender code', 'text'], ['guest first name', 'text'], ['guest last name', 'text'], ['date of birth', 'time']]

 -- Table: apartment bookings 
columns : [['apartment booking id', 'number'], ['apartment id', 'number'], ['guest id', 'number'], ['booking status code', 'text'], ['booking start date', 'time'], ['booking end date', 'time']]

 -- Table: view unit status 
columns : [['apartment id', 'number'], ['apartment booking id', 'number'], ['status date', 'time'], ['available yes or no', 'others']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the 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 addresses and phones of all the buildings managed by "Brenden".
SQL: SELECT building_address ,  building_phone FROM Apartment_Buildings WHERE building_manager	 =  "Brenden"
-- Language PostgreSQL
        -- Tables: 
             -- Table: apartment buildings 
columns : [['building id', 'number'], ['building short name', 'text'], ['building full name', 'text'], ['building description', 'text'], ['building address', 'text'], ['building manager', 'text'], ['building phone', 'text']]

 -- Table: apartments 
columns : [['apartment id', 'number'], ['building id', 'number'], ['apartment type code', 'text'], ['apartment number', 'text'], ['bathroom count', 'number'], ['bedroom count', 'number'], ['room count', 'text']]

 -- Table: apartment facilities 
columns : [['apartment id', 'number'], ['facility code', 'text']]

 -- Table: guests 
columns : [['guest id', 'number'], ['gender code', 'text'], ['guest first name', 'text'], ['guest last name', 'text'], ['date of birth', 'time']]

 -- Table: apartment bookings 
columns : [['apartment booking id', 'number'], ['apartment id', 'number'], ['guest id', 'number'], ['booking status code', 'text'], ['booking start date', 'time'], ['booking end date', 'time']]

 -- Table: view unit status 
columns : [['apartment id', 'number'], ['apartment booking id', 'number'], ['status date', 'time'], ['available yes or no', 'others']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the 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 address and phone number of the buildings managed by "Brenden"?
SQL: SELECT building_address ,  building_phone FROM Apartment_Buildings WHERE building_manager	 =  "Brenden"
-- Language PostgreSQL
        -- Tables: 
             -- Table: apartment buildings 
columns : [['building id', 'number'], ['building short name', 'text'], ['building full name', 'text'], ['building description', 'text'], ['building address', 'text'], ['building manager', 'text'], ['building phone', 'text']]

 -- Table: apartments 
columns : [['apartment id', 'number'], ['building id', 'number'], ['apartment type code', 'text'], ['apartment number', 'text'], ['bathroom count', 'number'], ['bedroom count', 'number'], ['room count', 'text']]

 -- Table: apartment facilities 
columns : [['apartment id', 'number'], ['facility code', 'text']]

 -- Table: guests 
columns : [['guest id', 'number'], ['gender code', 'text'], ['guest first name', 'text'], ['guest last name', 'text'], ['date of birth', 'time']]

 -- Table: apartment bookings 
columns : [['apartment booking id', 'number'], ['apartment id', 'number'], ['guest id', 'number'], ['booking status code', 'text'], ['booking start date', 'time'], ['booking end date', 'time']]

 -- Table: view unit status 
columns : [['apartment id', 'number'], ['apartment booking id', 'number'], ['status date', 'time'], ['available yes or no', 'others']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the 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 building full names that contain the word "court"?
SQL: SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE "%court%"
-- Language PostgreSQL
        -- Tables: 
             -- Table: apartment buildings 
columns : [['building id', 'number'], ['building short name', 'text'], ['building full name', 'text'], ['building description', 'text'], ['building address', 'text'], ['building manager', 'text'], ['building phone', 'text']]

 -- Table: apartments 
columns : [['apartment id', 'number'], ['building id', 'number'], ['apartment type code', 'text'], ['apartment number', 'text'], ['bathroom count', 'number'], ['bedroom count', 'number'], ['room count', 'text']]

 -- Table: apartment facilities 
columns : [['apartment id', 'number'], ['facility code', 'text']]

 -- Table: guests 
columns : [['guest id', 'number'], ['gender code', 'text'], ['guest first name', 'text'], ['guest last name', 'text'], ['date of birth', 'time']]

 -- Table: apartment bookings 
columns : [['apartment booking id', 'number'], ['apartment id', 'number'], ['guest id', 'number'], ['booking status code', 'text'], ['booking start date', 'time'], ['booking end date', 'time']]

 -- Table: view unit status 
columns : [['apartment id', 'number'], ['apartment booking id', 'number'], ['status date', 'time'], ['available yes or no', 'others']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the 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 all the building full names containing the word "court".
SQL: SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE "%court%"
-- Language PostgreSQL
        -- Tables: 
             -- Table: apartment buildings 
columns : [['building id', 'number'], ['building short name', 'text'], ['building full name', 'text'], ['building description', 'text'], ['building address', 'text'], ['building manager', 'text'], ['building phone', 'text']]

 -- Table: apartments 
columns : [['apartment id', 'number'], ['building id', 'number'], ['apartment type code', 'text'], ['apartment number', 'text'], ['bathroom count', 'number'], ['bedroom count', 'number'], ['room count', 'text']]

 -- Table: apartment facilities 
columns : [['apartment id', 'number'], ['facility code', 'text']]

 -- Table: guests 
columns : [['guest id', 'number'], ['gender code', 'text'], ['guest first name', 'text'], ['guest last name', 'text'], ['date of birth', 'time']]

 -- Table: apartment bookings 
columns : [['apartment booking id', 'number'], ['apartment id', 'number'], ['guest id', 'number'], ['booking status code', 'text'], ['booking start date', 'time'], ['booking end date', 'time']]

 -- Table: view unit status 
columns : [['apartment id', 'number'], ['apartment booking id', 'number'], ['status date', 'time'], ['available yes or no', 'others']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the 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 minimum and maximum number of bathrooms of all the apartments?
SQL: SELECT min(bathroom_count) ,  max(bathroom_count) FROM Apartments