sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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 international and domestic passengers are there in the airport London Heathrow?
SQL: SELECT International_Passengers ,  Domestic_Passengers FROM airport WHERE Airport_Name  =  "London Heathrow"
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: What are the total number of Domestic Passengers of airports that contain the word "London".
SQL: SELECT sum(Domestic_Passengers) FROM airport WHERE Airport_Name LIKE "%London%"
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: What are the total number of domestic passengers at all London airports?
SQL: SELECT sum(Domestic_Passengers) FROM airport WHERE Airport_Name LIKE "%London%"
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: What are the maximum and minimum number of transit passengers of all aiports.
SQL: SELECT max(Transit_Passengers) ,  min(Transit_Passengers) FROM airport
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: What is the maximum and mininum number of transit passengers for all airports?
SQL: SELECT max(Transit_Passengers) ,  min(Transit_Passengers) FROM airport
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: What are the name of pilots aged 25 or older?
SQL: SELECT Name FROM pilot WHERE Age  >=  25
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: what is the name of every pilot who is at least 25 years old?
SQL: SELECT Name FROM pilot WHERE Age  >=  25
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: List all pilot names in ascending alphabetical order.
SQL: SELECT Name FROM pilot ORDER BY Name ASC
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: What are the names of the pilots in alphabetical order?
SQL: SELECT Name FROM pilot ORDER BY Name ASC
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: List names of all pilot aged 30 or younger in descending alphabetical order.
SQL: SELECT Name FROM pilot WHERE Age  <=  30 ORDER BY Name DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: What are the names of all pilots 30 years old or young in descending alphabetical order?
SQL: SELECT Name FROM pilot WHERE Age  <=  30 ORDER BY Name DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: Please show the names of aircrafts associated with airport with name "London Gatwick".
SQL: SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID  =  T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID  =  T3.Airport_ID WHERE T3.Airport_Name  =  "London Gatwick"
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: What are the names of all the aircrafts associated with London Gatwick airport?
SQL: SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID  =  T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID  =  T3.Airport_ID WHERE T3.Airport_Name  =  "London Gatwick"
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: Please show the names and descriptions of aircrafts associated with airports that have a total number of passengers bigger than 10000000.
SQL: SELECT T1.Aircraft ,  T1.Description FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID  =  T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID  =  T3.Airport_ID WHERE T3.Total_Passengers  >  10000000
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: What are the names and descriptions of aircrafts associated with an airport that has more total passengers than 10000000?
SQL: SELECT T1.Aircraft ,  T1.Description FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID  =  T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID  =  T3.Airport_ID WHERE T3.Total_Passengers  >  10000000
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: What is the average total number of passengers of airports that are associated with aircraft "Robinson R-22"?
SQL: SELECT avg(T3.Total_Passengers) FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID  =  T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID  =  T3.Airport_ID WHERE T1.Aircraft  =  "Robinson R-22"
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: What is the average total number of passengers for all airports that the aircraft "Robinson R-22" visits?
SQL: SELECT avg(T3.Total_Passengers) FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID  =  T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID  =  T3.Airport_ID WHERE T1.Aircraft  =  "Robinson R-22"
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: Please list the location and the winning aircraft name.
SQL: SELECT T2.Location ,  T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID  =  T2.Winning_Aircraft
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: What is the location and name of the winning aircraft?
SQL: SELECT T2.Location ,  T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID  =  T2.Winning_Aircraft
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: List the name of the aircraft that has been named winning aircraft the most number of times.
SQL: SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID  =  T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: What is the name of the aircraft that has won an award the most?
SQL: SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID  =  T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: List the names of aircrafts and the number of times it won matches.
SQL: SELECT T1.Aircraft ,  COUNT(*) FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID  =  T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: For each aircraft that has won an award, what is its name and how many time has it won?
SQL: SELECT T1.Aircraft ,  COUNT(*) FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID  =  T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: List names of all pilot in descending order of age.
SQL: SELECT Name FROM pilot ORDER BY Age DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: What are the names of all pilots listed by descending age?
SQL: SELECT Name FROM pilot ORDER BY Age DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: List the names of aircrafts and that won matches at least twice.
SQL: SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID  =  T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft HAVING COUNT(*)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: What are the names of all aircrafts that have won a match at least twice?
SQL: SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID  =  T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft HAVING COUNT(*)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: List the names of aircrafts and that did not win any match.
SQL: SELECT Aircraft FROM aircraft WHERE Aircraft_ID NOT IN (SELECT Winning_Aircraft FROM MATCH)
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: What are the names of all aicrafts that have never won any match?
SQL: SELECT Aircraft FROM aircraft WHERE Aircraft_ID NOT IN (SELECT Winning_Aircraft FROM MATCH)
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: Show the names of aircrafts that are associated with both an airport named "London Heathrow" and an airport named "London Gatwick"
SQL: SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID  =  T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID  =  T3.Airport_ID WHERE T3.Airport_Name  =  "London Heathrow" INTERSECT SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID  =  T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID  =  T3.Airport_ID WHERE T3.Airport_Name  =  "London Gatwick"
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: What are the names of all aircrafts that are associated with both London Heathrow and Gatwick airports?
SQL: SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID  =  T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID  =  T3.Airport_ID WHERE T3.Airport_Name  =  "London Heathrow" INTERSECT SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID  =  T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID  =  T3.Airport_ID WHERE T3.Airport_Name  =  "London Gatwick"
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: Show all information on the airport that has the largest number of international passengers.
SQL: SELECT * FROM airport ORDER BY International_Passengers DESC LIMIT 1