sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: people 
columns : [['person id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['login name', 'text'], ['password', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['student details', 'text']]

 -- Table: courses 
columns : [['course id', 'text'], ['course name', 'text'], ['course description', 'text'], ['other details', 'text']]

 -- Table: people addresses 
columns : [['person address id', 'number'], ['person id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: student course registrations 
columns : [['student id', 'number'], ['course id', 'number'], ['registration date', 'time']]

 -- Table: student course attendance 
columns : [['student id', 'number'], ['course id', 'number'], ['date of attendance', 'time']]

 -- Table: candidates 
columns : [['candidate id', 'number'], ['candidate details', 'text']]

 -- Table: candidate assessments 
columns : [['candidate id', 'number'], ['qualification', 'text'], ['assessment date', 'time'], ['asessment outcome code', '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 first names of people in alphabetical order?
SQL: SELECT first_name FROM people ORDER BY first_name
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: people 
columns : [['person id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['login name', 'text'], ['password', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['student details', 'text']]

 -- Table: courses 
columns : [['course id', 'text'], ['course name', 'text'], ['course description', 'text'], ['other details', 'text']]

 -- Table: people addresses 
columns : [['person address id', 'number'], ['person id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: student course registrations 
columns : [['student id', 'number'], ['course id', 'number'], ['registration date', 'time']]

 -- Table: student course attendance 
columns : [['student id', 'number'], ['course id', 'number'], ['date of attendance', 'time']]

 -- Table: candidates 
columns : [['candidate id', 'number'], ['candidate details', 'text']]

 -- Table: candidate assessments 
columns : [['candidate id', 'number'], ['qualification', 'text'], ['assessment date', 'time'], ['asessment outcome code', '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 first names of the people in alphabetical order?
SQL: SELECT first_name FROM people ORDER BY first_name
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: people 
columns : [['person id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['login name', 'text'], ['password', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['student details', 'text']]

 -- Table: courses 
columns : [['course id', 'text'], ['course name', 'text'], ['course description', 'text'], ['other details', 'text']]

 -- Table: people addresses 
columns : [['person address id', 'number'], ['person id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: student course registrations 
columns : [['student id', 'number'], ['course id', 'number'], ['registration date', 'time']]

 -- Table: student course attendance 
columns : [['student id', 'number'], ['course id', 'number'], ['date of attendance', 'time']]

 -- Table: candidates 
columns : [['candidate id', 'number'], ['candidate details', 'text']]

 -- Table: candidate assessments 
columns : [['candidate id', 'number'], ['qualification', 'text'], ['assessment date', 'time'], ['asessment outcome code', '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 id of students who registered courses or attended courses?
SQL: SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: people 
columns : [['person id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['login name', 'text'], ['password', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['student details', 'text']]

 -- Table: courses 
columns : [['course id', 'text'], ['course name', 'text'], ['course description', 'text'], ['other details', 'text']]

 -- Table: people addresses 
columns : [['person address id', 'number'], ['person id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: student course registrations 
columns : [['student id', 'number'], ['course id', 'number'], ['registration date', 'time']]

 -- Table: student course attendance 
columns : [['student id', 'number'], ['course id', 'number'], ['date of attendance', 'time']]

 -- Table: candidates 
columns : [['candidate id', 'number'], ['candidate details', 'text']]

 -- Table: candidate assessments 
columns : [['candidate id', 'number'], ['qualification', 'text'], ['assessment date', 'time'], ['asessment outcome code', '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 ids of the students who either registered or attended a course?
SQL: SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: people 
columns : [['person id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['login name', 'text'], ['password', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['student details', 'text']]

 -- Table: courses 
columns : [['course id', 'text'], ['course name', 'text'], ['course description', 'text'], ['other details', 'text']]

 -- Table: people addresses 
columns : [['person address id', 'number'], ['person id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: student course registrations 
columns : [['student id', 'number'], ['course id', 'number'], ['registration date', 'time']]

 -- Table: student course attendance 
columns : [['student id', 'number'], ['course id', 'number'], ['date of attendance', 'time']]

 -- Table: candidates 
columns : [['candidate id', 'number'], ['candidate details', 'text']]

 -- Table: candidate assessments 
columns : [['candidate id', 'number'], ['qualification', 'text'], ['assessment date', 'time'], ['asessment outcome code', 'text']]

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



Question: Find the id of courses which are registered or attended by student whose id is 121?
SQL: SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: people 
columns : [['person id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['login name', 'text'], ['password', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['student details', 'text']]

 -- Table: courses 
columns : [['course id', 'text'], ['course name', 'text'], ['course description', 'text'], ['other details', 'text']]

 -- Table: people addresses 
columns : [['person address id', 'number'], ['person id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: student course registrations 
columns : [['student id', 'number'], ['course id', 'number'], ['registration date', 'time']]

 -- Table: student course attendance 
columns : [['student id', 'number'], ['course id', 'number'], ['date of attendance', 'time']]

 -- Table: candidates 
columns : [['candidate id', 'number'], ['candidate details', 'text']]

 -- Table: candidate assessments 
columns : [['candidate id', 'number'], ['qualification', 'text'], ['assessment date', 'time'], ['asessment outcome code', '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 ids of the courses that are registered or attended by the student whose id is 121?
SQL: SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: people 
columns : [['person id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['login name', 'text'], ['password', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['student details', 'text']]

 -- Table: courses 
columns : [['course id', 'text'], ['course name', 'text'], ['course description', 'text'], ['other details', 'text']]

 -- Table: people addresses 
columns : [['person address id', 'number'], ['person id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: student course registrations 
columns : [['student id', 'number'], ['course id', 'number'], ['registration date', 'time']]

 -- Table: student course attendance 
columns : [['student id', 'number'], ['course id', 'number'], ['date of attendance', 'time']]

 -- Table: candidates 
columns : [['candidate id', 'number'], ['candidate details', 'text']]

 -- Table: candidate assessments 
columns : [['candidate id', 'number'], ['qualification', 'text'], ['assessment date', 'time'], ['asessment outcome code', 'text']]

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



Question: What are all info of students who registered courses but not attended courses?
SQL: SELECT * FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: people 
columns : [['person id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['login name', 'text'], ['password', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['student details', 'text']]

 -- Table: courses 
columns : [['course id', 'text'], ['course name', 'text'], ['course description', 'text'], ['other details', 'text']]

 -- Table: people addresses 
columns : [['person address id', 'number'], ['person id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: student course registrations 
columns : [['student id', 'number'], ['course id', 'number'], ['registration date', 'time']]

 -- Table: student course attendance 
columns : [['student id', 'number'], ['course id', 'number'], ['date of attendance', 'time']]

 -- Table: candidates 
columns : [['candidate id', 'number'], ['candidate details', 'text']]

 -- Table: candidate assessments 
columns : [['candidate id', 'number'], ['qualification', 'text'], ['assessment date', 'time'], ['asessment outcome code', 'text']]

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



Question: What are all details of the students who registered but did not attend any course?
SQL: SELECT * FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: people 
columns : [['person id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['login name', 'text'], ['password', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['student details', 'text']]

 -- Table: courses 
columns : [['course id', 'text'], ['course name', 'text'], ['course description', 'text'], ['other details', 'text']]

 -- Table: people addresses 
columns : [['person address id', 'number'], ['person id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: student course registrations 
columns : [['student id', 'number'], ['course id', 'number'], ['registration date', 'time']]

 -- Table: student course attendance 
columns : [['student id', 'number'], ['course id', 'number'], ['date of attendance', 'time']]

 -- Table: candidates 
columns : [['candidate id', 'number'], ['candidate details', 'text']]

 -- Table: candidate assessments 
columns : [['candidate id', 'number'], ['qualification', 'text'], ['assessment date', 'time'], ['asessment outcome code', '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 id of students who registered course statistics in the order of registration date.
SQL: SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.registration_date
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: people 
columns : [['person id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['login name', 'text'], ['password', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['student details', 'text']]

 -- Table: courses 
columns : [['course id', 'text'], ['course name', 'text'], ['course description', 'text'], ['other details', 'text']]

 -- Table: people addresses 
columns : [['person address id', 'number'], ['person id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: student course registrations 
columns : [['student id', 'number'], ['course id', 'number'], ['registration date', 'time']]

 -- Table: student course attendance 
columns : [['student id', 'number'], ['course id', 'number'], ['date of attendance', 'time']]

 -- Table: candidates 
columns : [['candidate id', 'number'], ['candidate details', 'text']]

 -- Table: candidate assessments 
columns : [['candidate id', 'number'], ['qualification', 'text'], ['assessment date', 'time'], ['asessment outcome code', '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 ids of the students who registered course statistics by order of registration date?
SQL: SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.registration_date
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: people 
columns : [['person id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['login name', 'text'], ['password', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['student details', 'text']]

 -- Table: courses 
columns : [['course id', 'text'], ['course name', 'text'], ['course description', 'text'], ['other details', 'text']]

 -- Table: people addresses 
columns : [['person address id', 'number'], ['person id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: student course registrations 
columns : [['student id', 'number'], ['course id', 'number'], ['registration date', 'time']]

 -- Table: student course attendance 
columns : [['student id', 'number'], ['course id', 'number'], ['date of attendance', 'time']]

 -- Table: candidates 
columns : [['candidate id', 'number'], ['candidate details', 'text']]

 -- Table: candidate assessments 
columns : [['candidate id', 'number'], ['qualification', 'text'], ['assessment date', 'time'], ['asessment outcome code', '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 id of students who attended  statistics courses in the order of attendance date.
SQL: SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.date_of_attendance
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: people 
columns : [['person id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['login name', 'text'], ['password', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['student details', 'text']]

 -- Table: courses 
columns : [['course id', 'text'], ['course name', 'text'], ['course description', 'text'], ['other details', 'text']]

 -- Table: people addresses 
columns : [['person address id', 'number'], ['person id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: student course registrations 
columns : [['student id', 'number'], ['course id', 'number'], ['registration date', 'time']]

 -- Table: student course attendance 
columns : [['student id', 'number'], ['course id', 'number'], ['date of attendance', 'time']]

 -- Table: candidates 
columns : [['candidate id', 'number'], ['candidate details', 'text']]

 -- Table: candidate assessments 
columns : [['candidate id', 'number'], ['qualification', 'text'], ['assessment date', 'time'], ['asessment outcome code', '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 ids of the students who attended courses in the statistics department in order of attendance date.
SQL: SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.date_of_attendance
-- 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: Give me the dates when the max temperature was higher than 85.
SQL: SELECT date FROM weather WHERE max_temperature_f  >  85
-- 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 dates with a maximum temperature higher than 85?
SQL: SELECT date FROM weather WHERE max_temperature_f  >  85
-- 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 of stations that have latitude lower than 37.5?
SQL: SELECT name FROM station WHERE lat  <  37.5
-- 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 of all stations with a latitude smaller than 37.5?
SQL: SELECT name FROM station WHERE lat  <  37.5
-- 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 city, return the highest latitude among its stations.
SQL: SELECT city ,  max(lat) FROM station GROUP BY city
-- 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 city, what is the highest latitude for its stations?
SQL: SELECT city ,  max(lat) FROM station GROUP BY city
-- 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: Give me the start station and end station for the trips with the three oldest id.
SQL: SELECT start_station_name ,  end_station_name FROM trip ORDER BY id LIMIT 3
-- 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 station station and end station for the trips with the three smallest ids?
SQL: SELECT start_station_name ,  end_station_name FROM trip ORDER BY id LIMIT 3
-- 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 average latitude and longitude of stations located in San Jose city?
SQL: SELECT avg(lat) ,  avg(long) FROM station WHERE city  =  "San Jose"
-- 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 average latitude and longitude in San Jose?
SQL: SELECT avg(lat) ,  avg(long) FROM station WHERE city  =  "San Jose"
-- 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 trip that has the shortest duration?
SQL: SELECT id FROM trip ORDER BY 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 id of the shortest trip?
SQL: SELECT id FROM trip ORDER BY duration LIMIT 1