sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: third party companies 
columns : [['company id', 'number'], ['company type', 'text'], ['company name', 'text'], ['company address', 'text'], ['other company details', 'text']]

 -- Table: maintenance contracts 
columns : [['maintenance contract id', 'number'], ['maintenance contract company id', 'number'], ['contract start date', 'time'], ['contract end date', 'time'], ['other contract details', 'text']]

 -- Table: parts 
columns : [['part id', 'number'], ['part name', 'text'], ['chargeable yn', 'text'], ['chargeable amount', 'text'], ['other part details', 'text']]

 -- Table: skills 
columns : [['skill id', 'number'], ['skill code', 'text'], ['skill description', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff name', 'text'], ['gender', 'text'], ['other staff details', 'text']]

 -- Table: assets 
columns : [['asset id', 'number'], ['maintenance contract id', 'number'], ['supplier company id', 'number'], ['asset details', 'text'], ['asset make', 'text'], ['asset model', 'text'], ['asset acquired date', 'time'], ['asset disposed date', 'time'], ['other asset details', 'text']]

 -- Table: asset parts 
columns : [['asset id', 'number'], ['part id', 'number']]

 -- Table: maintenance engineers 
columns : [['engineer id', 'number'], ['company id', 'number'], ['first name', 'text'], ['last name', 'text'], ['other details', 'text']]

 -- Table: engineer skills 
columns : [['engineer id', 'number'], ['skill id', 'number']]

 -- Table: fault log 
columns : [['fault log entry id', 'number'], ['asset id', 'number'], ['recorded by staff id', 'number'], ['fault log entry datetime', 'time'], ['fault description', 'text'], ['other fault details', 'text']]

 -- Table: engineer visits 
columns : [['engineer visit id', 'number'], ['contact staff id', 'number'], ['engineer id', 'number'], ['fault log entry id', 'number'], ['fault status', 'text'], ['visit start datetime', 'time'], ['visit end datetime', 'time'], ['other visit details', 'text']]

 -- Table: part faults 
columns : [['part fault id', 'number'], ['part id', 'number'], ['fault short name', 'text'], ['fault description', 'text'], ['other fault details', 'text']]

 -- Table: fault log parts 
columns : [['fault log entry id', 'number'], ['part fault id', 'number'], ['fault status', 'text']]

 -- Table: skills required to fix 
columns : [['part fault id', 'number'], ['skill id', '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 gender makes up the majority of the staff?
SQL: SELECT gender FROM staff GROUP BY gender ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: third party companies 
columns : [['company id', 'number'], ['company type', 'text'], ['company name', 'text'], ['company address', 'text'], ['other company details', 'text']]

 -- Table: maintenance contracts 
columns : [['maintenance contract id', 'number'], ['maintenance contract company id', 'number'], ['contract start date', 'time'], ['contract end date', 'time'], ['other contract details', 'text']]

 -- Table: parts 
columns : [['part id', 'number'], ['part name', 'text'], ['chargeable yn', 'text'], ['chargeable amount', 'text'], ['other part details', 'text']]

 -- Table: skills 
columns : [['skill id', 'number'], ['skill code', 'text'], ['skill description', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff name', 'text'], ['gender', 'text'], ['other staff details', 'text']]

 -- Table: assets 
columns : [['asset id', 'number'], ['maintenance contract id', 'number'], ['supplier company id', 'number'], ['asset details', 'text'], ['asset make', 'text'], ['asset model', 'text'], ['asset acquired date', 'time'], ['asset disposed date', 'time'], ['other asset details', 'text']]

 -- Table: asset parts 
columns : [['asset id', 'number'], ['part id', 'number']]

 -- Table: maintenance engineers 
columns : [['engineer id', 'number'], ['company id', 'number'], ['first name', 'text'], ['last name', 'text'], ['other details', 'text']]

 -- Table: engineer skills 
columns : [['engineer id', 'number'], ['skill id', 'number']]

 -- Table: fault log 
columns : [['fault log entry id', 'number'], ['asset id', 'number'], ['recorded by staff id', 'number'], ['fault log entry datetime', 'time'], ['fault description', 'text'], ['other fault details', 'text']]

 -- Table: engineer visits 
columns : [['engineer visit id', 'number'], ['contact staff id', 'number'], ['engineer id', 'number'], ['fault log entry id', 'number'], ['fault status', 'text'], ['visit start datetime', 'time'], ['visit end datetime', 'time'], ['other visit details', 'text']]

 -- Table: part faults 
columns : [['part fault id', 'number'], ['part id', 'number'], ['fault short name', 'text'], ['fault description', 'text'], ['other fault details', 'text']]

 -- Table: fault log parts 
columns : [['fault log entry id', 'number'], ['part fault id', 'number'], ['fault status', 'text']]

 -- Table: skills required to fix 
columns : [['part fault id', 'number'], ['skill id', '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 engineers did each staff contact? List both the contact staff name and number of engineers contacted.
SQL: SELECT T1.staff_name ,  count(*) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id  =  T2.contact_staff_id GROUP BY T1.staff_name
-- Language PostgreSQL
        -- Tables: 
             -- Table: third party companies 
columns : [['company id', 'number'], ['company type', 'text'], ['company name', 'text'], ['company address', 'text'], ['other company details', 'text']]

 -- Table: maintenance contracts 
columns : [['maintenance contract id', 'number'], ['maintenance contract company id', 'number'], ['contract start date', 'time'], ['contract end date', 'time'], ['other contract details', 'text']]

 -- Table: parts 
columns : [['part id', 'number'], ['part name', 'text'], ['chargeable yn', 'text'], ['chargeable amount', 'text'], ['other part details', 'text']]

 -- Table: skills 
columns : [['skill id', 'number'], ['skill code', 'text'], ['skill description', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff name', 'text'], ['gender', 'text'], ['other staff details', 'text']]

 -- Table: assets 
columns : [['asset id', 'number'], ['maintenance contract id', 'number'], ['supplier company id', 'number'], ['asset details', 'text'], ['asset make', 'text'], ['asset model', 'text'], ['asset acquired date', 'time'], ['asset disposed date', 'time'], ['other asset details', 'text']]

 -- Table: asset parts 
columns : [['asset id', 'number'], ['part id', 'number']]

 -- Table: maintenance engineers 
columns : [['engineer id', 'number'], ['company id', 'number'], ['first name', 'text'], ['last name', 'text'], ['other details', 'text']]

 -- Table: engineer skills 
columns : [['engineer id', 'number'], ['skill id', 'number']]

 -- Table: fault log 
columns : [['fault log entry id', 'number'], ['asset id', 'number'], ['recorded by staff id', 'number'], ['fault log entry datetime', 'time'], ['fault description', 'text'], ['other fault details', 'text']]

 -- Table: engineer visits 
columns : [['engineer visit id', 'number'], ['contact staff id', 'number'], ['engineer id', 'number'], ['fault log entry id', 'number'], ['fault status', 'text'], ['visit start datetime', 'time'], ['visit end datetime', 'time'], ['other visit details', 'text']]

 -- Table: part faults 
columns : [['part fault id', 'number'], ['part id', 'number'], ['fault short name', 'text'], ['fault description', 'text'], ['other fault details', 'text']]

 -- Table: fault log parts 
columns : [['fault log entry id', 'number'], ['part fault id', 'number'], ['fault status', 'text']]

 -- Table: skills required to fix 
columns : [['part fault id', 'number'], ['skill id', '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 assets did not incur any fault log? List the asset model.
SQL: SELECT asset_model FROM Assets WHERE asset_id NOT IN (SELECT asset_id FROM Fault_Log)
-- Language PostgreSQL
        -- Tables: 
             -- Table: train 
columns : [['id', 'number'], ['train number', 'number'], ['name', 'text'], ['origin', 'text'], ['destination', 'text'], ['time', 'text'], ['interval', 'text']]

 -- Table: station 
columns : [['id', 'number'], ['network name', 'text'], ['services', 'text'], ['local authority', 'text']]

 -- Table: route 
columns : [['train id', 'number'], ['station id', 'number']]

 -- Table: weekly weather 
columns : [['station id', 'number'], ['day of week', 'text'], ['high temperature', 'number'], ['low temperature', 'number'], ['precipitation', 'number'], ['wind speed mph', 'number']]

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



Question: list the local authorities and services provided by all stations.
SQL: SELECT local_authority ,  services FROM station
-- Language PostgreSQL
        -- Tables: 
             -- Table: train 
columns : [['id', 'number'], ['train number', 'number'], ['name', 'text'], ['origin', 'text'], ['destination', 'text'], ['time', 'text'], ['interval', 'text']]

 -- Table: station 
columns : [['id', 'number'], ['network name', 'text'], ['services', 'text'], ['local authority', 'text']]

 -- Table: route 
columns : [['train id', 'number'], ['station id', 'number']]

 -- Table: weekly weather 
columns : [['station id', 'number'], ['day of week', 'text'], ['high temperature', 'number'], ['low temperature', 'number'], ['precipitation', 'number'], ['wind speed mph', 'number']]

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



Question: show all train numbers and names ordered by their time from early to late.
SQL: SELECT train_number ,  name FROM train ORDER BY TIME
-- Language PostgreSQL
        -- Tables: 
             -- Table: train 
columns : [['id', 'number'], ['train number', 'number'], ['name', 'text'], ['origin', 'text'], ['destination', 'text'], ['time', 'text'], ['interval', 'text']]

 -- Table: station 
columns : [['id', 'number'], ['network name', 'text'], ['services', 'text'], ['local authority', 'text']]

 -- Table: route 
columns : [['train id', 'number'], ['station id', 'number']]

 -- Table: weekly weather 
columns : [['station id', 'number'], ['day of week', 'text'], ['high temperature', 'number'], ['low temperature', 'number'], ['precipitation', 'number'], ['wind speed mph', '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 times and numbers of all trains that go to Chennai, ordered by time.
SQL: SELECT TIME ,  train_number FROM train WHERE destination  =  'Chennai' ORDER BY TIME
-- Language PostgreSQL
        -- Tables: 
             -- Table: train 
columns : [['id', 'number'], ['train number', 'number'], ['name', 'text'], ['origin', 'text'], ['destination', 'text'], ['time', 'text'], ['interval', 'text']]

 -- Table: station 
columns : [['id', 'number'], ['network name', 'text'], ['services', 'text'], ['local authority', 'text']]

 -- Table: route 
columns : [['train id', 'number'], ['station id', 'number']]

 -- Table: weekly weather 
columns : [['station id', 'number'], ['day of week', 'text'], ['high temperature', 'number'], ['low temperature', 'number'], ['precipitation', 'number'], ['wind speed mph', '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 trains have 'Express' in their names?
SQL: SELECT count(*) FROM train WHERE name LIKE "%Express%"
-- Language PostgreSQL
        -- Tables: 
             -- Table: train 
columns : [['id', 'number'], ['train number', 'number'], ['name', 'text'], ['origin', 'text'], ['destination', 'text'], ['time', 'text'], ['interval', 'text']]

 -- Table: station 
columns : [['id', 'number'], ['network name', 'text'], ['services', 'text'], ['local authority', 'text']]

 -- Table: route 
columns : [['train id', 'number'], ['station id', 'number']]

 -- Table: weekly weather 
columns : [['station id', 'number'], ['day of week', 'text'], ['high temperature', 'number'], ['low temperature', 'number'], ['precipitation', 'number'], ['wind speed mph', 'number']]

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



Question: Find the number and time of the train that goes from Chennai to Guruvayur.
SQL: SELECT train_number ,  TIME FROM train WHERE origin  =  'Chennai' AND destination  =  'Guruvayur'
-- Language PostgreSQL
        -- Tables: 
             -- Table: train 
columns : [['id', 'number'], ['train number', 'number'], ['name', 'text'], ['origin', 'text'], ['destination', 'text'], ['time', 'text'], ['interval', 'text']]

 -- Table: station 
columns : [['id', 'number'], ['network name', 'text'], ['services', 'text'], ['local authority', 'text']]

 -- Table: route 
columns : [['train id', 'number'], ['station id', 'number']]

 -- Table: weekly weather 
columns : [['station id', 'number'], ['day of week', 'text'], ['high temperature', 'number'], ['low temperature', 'number'], ['precipitation', 'number'], ['wind speed mph', 'number']]

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



Question: Find the number of trains starting from each origin.
SQL: SELECT origin ,  count(*) FROM train GROUP BY origin
-- Language PostgreSQL
        -- Tables: 
             -- Table: train 
columns : [['id', 'number'], ['train number', 'number'], ['name', 'text'], ['origin', 'text'], ['destination', 'text'], ['time', 'text'], ['interval', 'text']]

 -- Table: station 
columns : [['id', 'number'], ['network name', 'text'], ['services', 'text'], ['local authority', 'text']]

 -- Table: route 
columns : [['train id', 'number'], ['station id', 'number']]

 -- Table: weekly weather 
columns : [['station id', 'number'], ['day of week', 'text'], ['high temperature', 'number'], ['low temperature', 'number'], ['precipitation', 'number'], ['wind speed mph', 'number']]

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



Question: Find the name of the train whose route runs through greatest number of stations.
SQL: SELECT t1.name FROM train AS t1 JOIN route AS t2 ON t1.id  =  t2.train_id GROUP BY t2.train_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: train 
columns : [['id', 'number'], ['train number', 'number'], ['name', 'text'], ['origin', 'text'], ['destination', 'text'], ['time', 'text'], ['interval', 'text']]

 -- Table: station 
columns : [['id', 'number'], ['network name', 'text'], ['services', 'text'], ['local authority', 'text']]

 -- Table: route 
columns : [['train id', 'number'], ['station id', 'number']]

 -- Table: weekly weather 
columns : [['station id', 'number'], ['day of week', 'text'], ['high temperature', 'number'], ['low temperature', 'number'], ['precipitation', 'number'], ['wind speed mph', 'number']]

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



Question: Find the number of trains for each station, as well as the station network name and services.
SQL: SELECT count(*) ,  t1.network_name ,  t1.services FROM station AS t1 JOIN route AS t2 ON t1.id  =  t2.station_id GROUP BY t2.station_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: train 
columns : [['id', 'number'], ['train number', 'number'], ['name', 'text'], ['origin', 'text'], ['destination', 'text'], ['time', 'text'], ['interval', 'text']]

 -- Table: station 
columns : [['id', 'number'], ['network name', 'text'], ['services', 'text'], ['local authority', 'text']]

 -- Table: route 
columns : [['train id', 'number'], ['station id', 'number']]

 -- Table: weekly weather 
columns : [['station id', 'number'], ['day of week', 'text'], ['high temperature', 'number'], ['low temperature', 'number'], ['precipitation', 'number'], ['wind speed mph', '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 high temperature for each day of week?
SQL: SELECT avg(high_temperature) ,  day_of_week FROM weekly_weather GROUP BY day_of_week
-- Language PostgreSQL
        -- Tables: 
             -- Table: train 
columns : [['id', 'number'], ['train number', 'number'], ['name', 'text'], ['origin', 'text'], ['destination', 'text'], ['time', 'text'], ['interval', 'text']]

 -- Table: station 
columns : [['id', 'number'], ['network name', 'text'], ['services', 'text'], ['local authority', 'text']]

 -- Table: route 
columns : [['train id', 'number'], ['station id', 'number']]

 -- Table: weekly weather 
columns : [['station id', 'number'], ['day of week', 'text'], ['high temperature', 'number'], ['low temperature', 'number'], ['precipitation', 'number'], ['wind speed mph', '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 maximum low temperature and average precipitation at the Amersham station.
SQL: SELECT max(t1.low_temperature) ,  avg(t1.precipitation) FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id  =  t2.id WHERE t2.network_name  =  "Amersham"
-- Language PostgreSQL
        -- Tables: 
             -- Table: train 
columns : [['id', 'number'], ['train number', 'number'], ['name', 'text'], ['origin', 'text'], ['destination', 'text'], ['time', 'text'], ['interval', 'text']]

 -- Table: station 
columns : [['id', 'number'], ['network name', 'text'], ['services', 'text'], ['local authority', 'text']]

 -- Table: route 
columns : [['train id', 'number'], ['station id', 'number']]

 -- Table: weekly weather 
columns : [['station id', 'number'], ['day of week', 'text'], ['high temperature', 'number'], ['low temperature', 'number'], ['precipitation', 'number'], ['wind speed mph', 'number']]

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



Question: Find names and times of trains that run through stations for the local authority Chiltern.
SQL: SELECT t3.name ,  t3.time FROM station AS t1 JOIN route AS t2 ON t1.id  =  t2.station_id JOIN train AS t3 ON t2.train_id  =  t3.id WHERE t1.local_authority  =  "Chiltern"
-- Language PostgreSQL
        -- Tables: 
             -- Table: train 
columns : [['id', 'number'], ['train number', 'number'], ['name', 'text'], ['origin', 'text'], ['destination', 'text'], ['time', 'text'], ['interval', 'text']]

 -- Table: station 
columns : [['id', 'number'], ['network name', 'text'], ['services', 'text'], ['local authority', 'text']]

 -- Table: route 
columns : [['train id', 'number'], ['station id', 'number']]

 -- Table: weekly weather 
columns : [['station id', 'number'], ['day of week', 'text'], ['high temperature', 'number'], ['low temperature', 'number'], ['precipitation', 'number'], ['wind speed mph', '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 services are provided by all stations?
SQL: SELECT count(DISTINCT services) FROM station
-- Language PostgreSQL
        -- Tables: 
             -- Table: train 
columns : [['id', 'number'], ['train number', 'number'], ['name', 'text'], ['origin', 'text'], ['destination', 'text'], ['time', 'text'], ['interval', 'text']]

 -- Table: station 
columns : [['id', 'number'], ['network name', 'text'], ['services', 'text'], ['local authority', 'text']]

 -- Table: route 
columns : [['train id', 'number'], ['station id', 'number']]

 -- Table: weekly weather 
columns : [['station id', 'number'], ['day of week', 'text'], ['high temperature', 'number'], ['low temperature', 'number'], ['precipitation', 'number'], ['wind speed mph', 'number']]

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



Question: Find the id and local authority of the station with has the highest average high temperature.
SQL: SELECT t2.id ,  t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id  =  t2.id GROUP BY t1.station_id ORDER BY avg(high_temperature) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: train 
columns : [['id', 'number'], ['train number', 'number'], ['name', 'text'], ['origin', 'text'], ['destination', 'text'], ['time', 'text'], ['interval', 'text']]

 -- Table: station 
columns : [['id', 'number'], ['network name', 'text'], ['services', 'text'], ['local authority', 'text']]

 -- Table: route 
columns : [['train id', 'number'], ['station id', 'number']]

 -- Table: weekly weather 
columns : [['station id', 'number'], ['day of week', 'text'], ['high temperature', 'number'], ['low temperature', 'number'], ['precipitation', 'number'], ['wind speed mph', 'number']]

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



Question: Find the id and local authority of the station whose maximum precipitation is higher than 50.
SQL: SELECT t2.id ,  t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id  =  t2.id GROUP BY t1.station_id HAVING max(t1.precipitation)  >  50
-- Language PostgreSQL
        -- Tables: 
             -- Table: train 
columns : [['id', 'number'], ['train number', 'number'], ['name', 'text'], ['origin', 'text'], ['destination', 'text'], ['time', 'text'], ['interval', 'text']]

 -- Table: station 
columns : [['id', 'number'], ['network name', 'text'], ['services', 'text'], ['local authority', 'text']]

 -- Table: route 
columns : [['train id', 'number'], ['station id', 'number']]

 -- Table: weekly weather 
columns : [['station id', 'number'], ['day of week', 'text'], ['high temperature', 'number'], ['low temperature', 'number'], ['precipitation', 'number'], ['wind speed mph', 'number']]

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



Question: show the lowest low temperature and highest wind speed in miles per hour.
SQL: SELECT min(low_temperature) ,  max(wind_speed_mph) FROM weekly_weather
-- Language PostgreSQL
        -- Tables: 
             -- Table: train 
columns : [['id', 'number'], ['train number', 'number'], ['name', 'text'], ['origin', 'text'], ['destination', 'text'], ['time', 'text'], ['interval', 'text']]

 -- Table: station 
columns : [['id', 'number'], ['network name', 'text'], ['services', 'text'], ['local authority', 'text']]

 -- Table: route 
columns : [['train id', 'number'], ['station id', 'number']]

 -- Table: weekly weather 
columns : [['station id', 'number'], ['day of week', 'text'], ['high temperature', 'number'], ['low temperature', 'number'], ['precipitation', 'number'], ['wind speed mph', 'number']]

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



Question: Find the origins from which more than 1 train starts.
SQL: SELECT origin FROM train GROUP BY origin HAVING count(*)  >  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', 'number']]

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



Question: Find the number of professors in accounting department.
SQL: SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code WHERE DEPT_NAME  =  "Accounting"
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 professors are in the accounting dept?
SQL: SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code WHERE DEPT_NAME  =  "Accounting"
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 professors are teaching class with code ACCT-211?
SQL: SELECT count(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE  =  "ACCT-211"
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 professors teach a class with the code ACCT-211?
SQL: SELECT count(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE  =  "ACCT-211"
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 first and last name of the professor in biology department?
SQL: SELECT T3.EMP_FNAME ,  T3.EMP_LNAME FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code JOIN employee AS T3 ON T1.EMP_NUM  =  T3.EMP_NUM WHERE DEPT_NAME  =  "Biology"
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 first and last name of all biology professors?
SQL: SELECT T3.EMP_FNAME ,  T3.EMP_LNAME FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code JOIN employee AS T3 ON T1.EMP_NUM  =  T3.EMP_NUM WHERE DEPT_NAME  =  "Biology"
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 first names and date of birth of professors teaching course ACCT-211?
SQL: SELECT DISTINCT T1.EMP_FNAME ,  T1.EMP_DOB FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM  =  T2.PROF_NUM WHERE CRS_CODE  =  "ACCT-211"
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 first names and birthdates of the professors in charge of ACCT-211?
SQL: SELECT DISTINCT T1.EMP_FNAME ,  T1.EMP_DOB FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM  =  T2.PROF_NUM WHERE CRS_CODE  =  "ACCT-211"
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 classes are professor whose last name is Graztevski has?
SQL: SELECT count(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM  =  T2.PROF_NUM WHERE T1.EMP_LNAME  =  'Graztevski'
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 classes does the professor whose last name is Graztevski teach?
SQL: SELECT count(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM  =  T2.PROF_NUM WHERE T1.EMP_LNAME  =  'Graztevski'