sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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 total and maximum duration of trips with bike id 636?
SQL: SELECT sum(duration) ,  max(duration) FROM trip WHERE bike_id  =  636
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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 total and maximum duration for all trips with the bike id 636?
SQL: SELECT sum(duration) ,  max(duration) FROM trip WHERE bike_id  =  636
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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: For each zip code, return the average mean temperature of August there.
SQL: SELECT zip_code  ,  avg(mean_temperature_f) FROM weather WHERE date LIKE "8/%" GROUP BY zip_code
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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: For each zip code, what is the average mean temperature for all dates that start with '8'?
SQL: SELECT zip_code  ,  avg(mean_temperature_f) FROM weather WHERE date LIKE "8/%" GROUP BY zip_code
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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: From the trip record, find the number of unique bikes.
SQL: SELECT count(DISTINCT bike_id) FROM trip
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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 different bike ids are there?
SQL: SELECT count(DISTINCT bike_id) FROM trip
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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 number of distinct cities the stations are located at?
SQL: SELECT count(DISTINCT city) FROM station
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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 different cities have these stations?
SQL: SELECT count(DISTINCT city) FROM station
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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 stations does Mountain View city has?
SQL: SELECT COUNT(*) FROM station WHERE city  =  "Mountain View"
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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 stations are in Mountain View?
SQL: SELECT COUNT(*) FROM station WHERE city  =  "Mountain View"
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', 'number']]

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



Question: Return the unique name for stations that have ever had 7 bikes available.
SQL: SELECT DISTINCT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id  =  T2.station_id WHERE T2.bikes_available  =  7
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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 different names for each station that has ever had 7 bikes available?
SQL: SELECT DISTINCT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id  =  T2.station_id WHERE T2.bikes_available  =  7
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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 start station had the most trips starting from August? Give me the name and id of the station.
SQL: SELECT start_station_name ,  start_station_id FROM trip WHERE start_date LIKE "8/%" GROUP BY start_station_name ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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 start station's name and id for the one that had the most start trips in August?
SQL: SELECT start_station_name ,  start_station_id FROM trip WHERE start_date LIKE "8/%" GROUP BY start_station_name ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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 bike traveled the most often in zip code 94002?
SQL: SELECT bike_id FROM trip WHERE zip_code  =  94002 GROUP BY bike_id ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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 id of the bike that traveled the most in 94002?
SQL: SELECT bike_id FROM trip WHERE zip_code  =  94002 GROUP BY bike_id ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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 days had both mean humidity above 50 and mean visibility above 8?
SQL: SELECT COUNT(*) FROM weather WHERE mean_humidity  >  50 AND mean_visibility_miles  >  8
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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 number of days that had an average humity above 50 and an average visibility above 8?
SQL: SELECT COUNT(*) FROM weather WHERE mean_humidity  >  50 AND mean_visibility_miles  >  8
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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 latitude, longitude, city of the station from which the shortest trip started?
SQL: SELECT T1.lat ,  T1.long ,  T1.city FROM station AS T1 JOIN trip AS T2 ON T1.id  =  T2.start_station_id ORDER BY T2.duration LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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 latitude, longitude, and city of the station from which the trip with smallest duration started?
SQL: SELECT T1.lat ,  T1.long ,  T1.city FROM station AS T1 JOIN trip AS T2 ON T1.id  =  T2.start_station_id ORDER BY T2.duration LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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 ids of stations that are located in San Francisco and have average bike availability above 10.
SQL: SELECT id FROM station WHERE city  =  "San Francisco" INTERSECT SELECT station_id FROM status GROUP BY station_id HAVING avg(bikes_available)  >  10
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', '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 ids of the stations in San Francisco that normally have more than 10 bikes available?
SQL: SELECT id FROM station WHERE city  =  "San Francisco" INTERSECT SELECT station_id FROM status GROUP BY station_id HAVING avg(bikes_available)  >  10
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', 'number']]

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



Question: What are the names and ids of stations that had more than 14 bikes available on average or were installed in December?
SQL: SELECT T1.name ,  T1.id FROM station AS T1 JOIN status AS T2 ON T1.id  =  T2.station_id GROUP BY T2.station_id HAVING avg(T2.bikes_available)  >  14 UNION SELECT name ,  id FROM station WHERE installation_date LIKE "12/%"
-- Language PostgreSQL
        -- Tables: 
             -- Table: station 
columns : [['id', 'number'], ['name', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['dock count', 'number'], ['city', 'text'], ['installation date', 'text']]

 -- Table: status 
columns : [['station id', 'number'], ['bikes available', 'number'], ['docks available', 'number'], ['time', 'text']]

 -- Table: trip 
columns : [['id', 'number'], ['duration', 'number'], ['start date', 'text'], ['start station name', 'text'], ['start station id', 'number'], ['end date', 'text'], ['end station name', 'text'], ['end station id', 'number'], ['bike id', 'number'], ['subscription type', 'text'], ['zip code', 'number']]

 -- Table: weather 
columns : [['date', 'text'], ['max temperature f', 'number'], ['mean temperature f', 'number'], ['min temperature f', 'number'], ['max dew point f', 'number'], ['mean dew point f', 'number'], ['min dew point f', 'number'], ['max humidity', 'number'], ['mean humidity', 'number'], ['min humidity', 'number'], ['max sea level pressure inches', 'number'], ['mean sea level pressure inches', 'number'], ['min sea level pressure inches', 'number'], ['max visibility miles', 'number'], ['mean visibility miles', 'number'], ['min visibility miles', 'number'], ['max wind speed mph', 'number'], ['mean wind speed mph', 'number'], ['max gust speed mph', 'number'], ['precipitation inches', 'number'], ['cloud cover', 'number'], ['events', 'text'], ['wind dir degrees', 'number'], ['zip code', 'number']]

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



Question: What are the names and ids of all stations that have more than 14 bikes available on average or had bikes installed in December?
SQL: SELECT T1.name ,  T1.id FROM station AS T1 JOIN status AS T2 ON T1.id  =  T2.station_id GROUP BY T2.station_id HAVING avg(T2.bikes_available)  >  14 UNION SELECT name ,  id FROM station WHERE installation_date LIKE "12/%"