brief_instruction
stringlengths
16
224
instruction
stringlengths
687
8.77k
output
stringlengths
18
577
What are the descriptions for the aircrafts?
-- 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. Translate `What are the descriptions for the aircrafts?` to a syntactically-correct PostgreSQL query.
SELECT Description FROM aircraft
What is the average number of international passengers of all airports?
-- 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. Translate `What is the average number of international passengers of all airports?` to a syntactically-correct PostgreSQL query.
SELECT avg(International_Passengers) FROM airport
What is the average number of international passengers for an 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. Translate `What is the average number of international passengers for an airport?` to a syntactically-correct PostgreSQL query.
SELECT avg(International_Passengers) FROM airport
What are the number of international and domestic passengers of the airport named 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. Translate `What are the number of international and domestic passengers of the airport named London "Heathrow"?` to a syntactically-correct PostgreSQL query.
SELECT International_Passengers , Domestic_Passengers FROM airport WHERE Airport_Name = "London Heathrow"
How many international and domestic passengers are there in the airport 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. Translate `How many international and domestic passengers are there in the airport London Heathrow?` to a syntactically-correct PostgreSQL query.
SELECT International_Passengers , Domestic_Passengers FROM airport WHERE Airport_Name = "London Heathrow"
What are the total number of Domestic Passengers of airports that contain the word "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. Translate `What are the total number of Domestic Passengers of airports that contain the word "London".` to a syntactically-correct PostgreSQL query.
SELECT sum(Domestic_Passengers) FROM airport WHERE Airport_Name LIKE "%London%"
What are the total number of domestic passengers at all London airports?
-- 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. Translate `What are the total number of domestic passengers at all London airports?` to a syntactically-correct PostgreSQL query.
SELECT sum(Domestic_Passengers) FROM airport WHERE Airport_Name LIKE "%London%"
What are the maximum and minimum number of transit passengers of all aiports.
-- 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. Translate `What are the maximum and minimum number of transit passengers of all aiports.` to a syntactically-correct PostgreSQL query.
SELECT max(Transit_Passengers) , min(Transit_Passengers) FROM airport
What is the maximum and mininum number of transit passengers for all airports?
-- 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. Translate `What is the maximum and mininum number of transit passengers for all airports?` to a syntactically-correct PostgreSQL query.
SELECT max(Transit_Passengers) , min(Transit_Passengers) FROM airport
What are the name of pilots aged 25 or older?
-- 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. Translate `What are the name of pilots aged 25 or older?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM pilot WHERE Age >= 25
what is the name of every pilot who is at least 25 years old?
-- 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. Translate `what is the name of every pilot who is at least 25 years old?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM pilot WHERE Age >= 25
List all pilot names in ascending alphabetical order.
-- 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. Translate `List all pilot names in ascending alphabetical order.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM pilot ORDER BY Name ASC
What are the names of the pilots in alphabetical order?
-- 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. Translate `What are the names of the pilots in alphabetical order?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM pilot ORDER BY Name ASC
List names of all pilot aged 30 or younger in descending alphabetical order.
-- 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. Translate `List names of all pilot aged 30 or younger in descending alphabetical order.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM pilot WHERE Age <= 30 ORDER BY Name DESC
What are the names of all pilots 30 years old or young in descending alphabetical order?
-- 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. Translate `What are the names of all pilots 30 years old or young in descending alphabetical order?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM pilot WHERE Age <= 30 ORDER BY Name DESC
Please show the names of aircrafts associated with airport with 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. Translate `Please show the names of aircrafts associated with airport with name "London Gatwick".` to a syntactically-correct PostgreSQL query.
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"
What are the names of all the aircrafts associated with London Gatwick 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. Translate `What are the names of all the aircrafts associated with London Gatwick airport?` to a syntactically-correct PostgreSQL query.
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"
Please show the names and descriptions of aircrafts associated with airports that have a total number of passengers bigger than 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. Translate `Please show the names and descriptions of aircrafts associated with airports that have a total number of passengers bigger than 10000000.` to a syntactically-correct PostgreSQL query.
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
What are the names and descriptions of aircrafts associated with an airport that has more total passengers than 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. Translate `What are the names and descriptions of aircrafts associated with an airport that has more total passengers than 10000000?` to a syntactically-correct PostgreSQL query.
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
What is the average total number of passengers of airports that are associated with 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. Translate `What is the average total number of passengers of airports that are associated with aircraft "Robinson R-22"?` to a syntactically-correct PostgreSQL query.
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"
What is the average total number of passengers for all airports that the aircraft "Robinson R-22" visits?
-- 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. Translate `What is the average total number of passengers for all airports that the aircraft "Robinson R-22" visits?` to a syntactically-correct PostgreSQL query.
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"
Please list the location and the winning aircraft name.
-- 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. Translate `Please list the location and the winning aircraft name.` to a syntactically-correct PostgreSQL query.
SELECT T2.Location , T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft
What is the location and name of the 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. Translate `What is the location and name of the winning aircraft?` to a syntactically-correct PostgreSQL query.
SELECT T2.Location , T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft
List the name of the aircraft that has been named winning aircraft the most number of times.
-- 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. Translate `List the name of the aircraft that has been named winning aircraft the most number of times.` to a syntactically-correct PostgreSQL query.
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
What is the name of the aircraft that has won an award the most?
-- 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. Translate `What is the name of the aircraft that has won an award the most?` to a syntactically-correct PostgreSQL query.
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
List the names of aircrafts and the number of times it won matches.
-- 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. Translate `List the names of aircrafts and the number of times it won matches.` to a syntactically-correct PostgreSQL query.
SELECT T1.Aircraft , COUNT(*) FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft
For each aircraft that has won an award, what is its name and how many time has it won?
-- 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. Translate `For each aircraft that has won an award, what is its name and how many time has it won?` to a syntactically-correct PostgreSQL query.
SELECT T1.Aircraft , COUNT(*) FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft
List names of all pilot in descending order of age.
-- 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. Translate `List names of all pilot in descending order of age.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM pilot ORDER BY Age DESC
What are the names of all pilots listed by descending age?
-- 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. Translate `What are the names of all pilots listed by descending age?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM pilot ORDER BY Age DESC
List the names of aircrafts and that won matches at least twice.
-- 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. Translate `List the names of aircrafts and that won matches at least twice.` to a syntactically-correct PostgreSQL query.
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
What are the names of all aircrafts that have won a match at least twice?
-- 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. Translate `What are the names of all aircrafts that have won a match at least twice?` to a syntactically-correct PostgreSQL query.
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
List the names of aircrafts and that did not win any 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. Translate `List the names of aircrafts and that did not win any match.` to a syntactically-correct PostgreSQL query.
SELECT Aircraft FROM aircraft WHERE Aircraft_ID NOT IN (SELECT Winning_Aircraft FROM MATCH)
What are the names of all aicrafts that have never won any 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. Translate `What are the names of all aicrafts that have never won any match?` to a syntactically-correct PostgreSQL query.
SELECT Aircraft FROM aircraft WHERE Aircraft_ID NOT IN (SELECT Winning_Aircraft FROM MATCH)
Show the names of aircrafts that are associated with both an airport named "London Heathrow" and an airport named "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. Translate `Show the names of aircrafts that are associated with both an airport named "London Heathrow" and an airport named "London Gatwick"` to a syntactically-correct PostgreSQL query.
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"
What are the names of all aircrafts that are associated with both London Heathrow and Gatwick airports?
-- 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. Translate `What are the names of all aircrafts that are associated with both London Heathrow and Gatwick airports?` to a syntactically-correct PostgreSQL query.
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"
Show all information on the airport that has the largest number of international passengers.
-- 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. Translate `Show all information on the airport that has the largest number of international passengers.` to a syntactically-correct PostgreSQL query.
SELECT * FROM airport ORDER BY International_Passengers DESC LIMIT 1
What is all the information on the airport with the largest number of international passengers?
-- 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. Translate `What is all the information on the airport with the largest number of international passengers?` to a syntactically-correct PostgreSQL query.
SELECT * FROM airport ORDER BY International_Passengers DESC LIMIT 1
find the name and age of the pilot who has won the most number of times among the pilots who are younger than 30.
-- 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. Translate `find the name and age of the pilot who has won the most number of times among the pilots who are younger than 30.` to a syntactically-correct PostgreSQL query.
SELECT t1.name , t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot WHERE t1.age < 30 GROUP BY t2.winning_pilot ORDER BY count(*) DESC LIMIT 1
What is the name and age of the pilot younger than 30 who has won the most number of times?
-- 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. Translate `What is the name and age of the pilot younger than 30 who has won the most number of times?` to a syntactically-correct PostgreSQL query.
SELECT t1.name , t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot WHERE t1.age < 30 GROUP BY t2.winning_pilot ORDER BY count(*) DESC LIMIT 1
what is the name and age of the youngest winning pilot?
-- 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. Translate `what is the name and age of the youngest winning pilot?` to a syntactically-correct PostgreSQL query.
SELECT t1.name , t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot ORDER BY t1.age LIMIT 1
How old is the youngest winning pilot and what is their name?
-- 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. Translate `How old is the youngest winning pilot and what is their name?` to a syntactically-correct PostgreSQL query.
SELECT t1.name , t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot ORDER BY t1.age LIMIT 1
find the name of pilots who did not win the matches held in the country of Australia.
-- 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. Translate `find the name of pilots who did not win the matches held in the country of Australia.` to a syntactically-correct PostgreSQL query.
SELECT name FROM pilot WHERE pilot_id NOT IN (SELECT Winning_Pilot FROM MATCH WHERE country = 'Australia')
What are the names of the pilots that have not won any matches in Australia?
-- 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. Translate `What are the names of the pilots that have not won any matches in Australia?` to a syntactically-correct PostgreSQL query.
SELECT name FROM pilot WHERE pilot_id NOT IN (SELECT Winning_Pilot FROM MATCH WHERE country = 'Australia')
How many residents does each property have? List property id and resident count.
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer details', 'text']] -- Table: properties columns : [['property id', 'number'], ['property type code', 'text'], ['property address', 'text'], ['other details', 'text']] -- Table: residents columns : [['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time'], ['date moved out', 'time'], ['other details', 'text']] -- Table: organizations columns : [['organization id', 'number'], ['parent organization id', 'number'], ['organization details', 'text']] -- Table: services columns : [['service id', 'number'], ['organization id', 'number'], ['service type code', 'text'], ['service details', 'text']] -- Table: residents services columns : [['resident id', 'number'], ['service id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['date requested', 'time'], ['date provided', 'time'], ['other details', 'text']] -- Table: things columns : [['thing id', 'number'], ['organization id', 'number'], ['type of thing code', 'text'], ['service type code', 'text'], ['service details', 'text']] -- Table: customer events columns : [['customer event id', 'number'], ['customer id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['resident id', 'number'], ['thing id', 'number']] -- Table: customer event notes columns : [['customer event note id', 'number'], ['customer event id', 'number'], ['service type code', 'text'], ['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time']] -- Table: timed status of things columns : [['thing id', 'number'], ['date and date', 'time'], ['status of thing code', 'text']] -- Table: timed locations of things columns : [['thing id', 'number'], ['date and time', 'time'], ['location code', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many residents does each property have? List property id and resident count.` to a syntactically-correct PostgreSQL query.
SELECT T1.property_id , count(*) FROM properties AS T1 JOIN residents AS T2 ON T1.property_id = T2.property_id GROUP BY T1.property_id
What is the distinct service types that are provided by the organization which has detail 'Denesik and Sons Party'?
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer details', 'text']] -- Table: properties columns : [['property id', 'number'], ['property type code', 'text'], ['property address', 'text'], ['other details', 'text']] -- Table: residents columns : [['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time'], ['date moved out', 'time'], ['other details', 'text']] -- Table: organizations columns : [['organization id', 'number'], ['parent organization id', 'number'], ['organization details', 'text']] -- Table: services columns : [['service id', 'number'], ['organization id', 'number'], ['service type code', 'text'], ['service details', 'text']] -- Table: residents services columns : [['resident id', 'number'], ['service id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['date requested', 'time'], ['date provided', 'time'], ['other details', 'text']] -- Table: things columns : [['thing id', 'number'], ['organization id', 'number'], ['type of thing code', 'text'], ['service type code', 'text'], ['service details', 'text']] -- Table: customer events columns : [['customer event id', 'number'], ['customer id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['resident id', 'number'], ['thing id', 'number']] -- Table: customer event notes columns : [['customer event note id', 'number'], ['customer event id', 'number'], ['service type code', 'text'], ['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time']] -- Table: timed status of things columns : [['thing id', 'number'], ['date and date', 'time'], ['status of thing code', 'text']] -- Table: timed locations of things columns : [['thing id', 'number'], ['date and time', 'time'], ['location code', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the distinct service types that are provided by the organization which has detail 'Denesik and Sons Party'?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T1.service_type_code FROM services AS T1 JOIN organizations AS T2 ON T1.organization_id = T2.organization_id WHERE T2.organization_details = 'Denesik and Sons Party'
How many services has each resident requested? List the resident id, details, and the count in descending order of the count.
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer details', 'text']] -- Table: properties columns : [['property id', 'number'], ['property type code', 'text'], ['property address', 'text'], ['other details', 'text']] -- Table: residents columns : [['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time'], ['date moved out', 'time'], ['other details', 'text']] -- Table: organizations columns : [['organization id', 'number'], ['parent organization id', 'number'], ['organization details', 'text']] -- Table: services columns : [['service id', 'number'], ['organization id', 'number'], ['service type code', 'text'], ['service details', 'text']] -- Table: residents services columns : [['resident id', 'number'], ['service id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['date requested', 'time'], ['date provided', 'time'], ['other details', 'text']] -- Table: things columns : [['thing id', 'number'], ['organization id', 'number'], ['type of thing code', 'text'], ['service type code', 'text'], ['service details', 'text']] -- Table: customer events columns : [['customer event id', 'number'], ['customer id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['resident id', 'number'], ['thing id', 'number']] -- Table: customer event notes columns : [['customer event note id', 'number'], ['customer event id', 'number'], ['service type code', 'text'], ['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time']] -- Table: timed status of things columns : [['thing id', 'number'], ['date and date', 'time'], ['status of thing code', 'text']] -- Table: timed locations of things columns : [['thing id', 'number'], ['date and time', 'time'], ['location code', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many services has each resident requested? List the resident id, details, and the count in descending order of the count.` to a syntactically-correct PostgreSQL query.
SELECT T1.resident_id , T1.other_details , count(*) FROM Residents AS T1 JOIN Residents_Services AS T2 ON T1.resident_id = T2.resident_id GROUP BY T1.resident_id ORDER BY count(*) DESC
What is the maximum number that a certain service is provided? List the service id, details and number.
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer details', 'text']] -- Table: properties columns : [['property id', 'number'], ['property type code', 'text'], ['property address', 'text'], ['other details', 'text']] -- Table: residents columns : [['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time'], ['date moved out', 'time'], ['other details', 'text']] -- Table: organizations columns : [['organization id', 'number'], ['parent organization id', 'number'], ['organization details', 'text']] -- Table: services columns : [['service id', 'number'], ['organization id', 'number'], ['service type code', 'text'], ['service details', 'text']] -- Table: residents services columns : [['resident id', 'number'], ['service id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['date requested', 'time'], ['date provided', 'time'], ['other details', 'text']] -- Table: things columns : [['thing id', 'number'], ['organization id', 'number'], ['type of thing code', 'text'], ['service type code', 'text'], ['service details', 'text']] -- Table: customer events columns : [['customer event id', 'number'], ['customer id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['resident id', 'number'], ['thing id', 'number']] -- Table: customer event notes columns : [['customer event note id', 'number'], ['customer event id', 'number'], ['service type code', 'text'], ['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time']] -- Table: timed status of things columns : [['thing id', 'number'], ['date and date', 'time'], ['status of thing code', 'text']] -- Table: timed locations of things columns : [['thing id', 'number'], ['date and time', 'time'], ['location code', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the maximum number that a certain service is provided? List the service id, details and number.` to a syntactically-correct PostgreSQL query.
SELECT T1.service_id , T1.service_details , count(*) FROM Services AS T1 JOIN Residents_Services AS T2 ON T1.service_id = T2.service_id GROUP BY T1.service_id ORDER BY count(*) DESC LIMIT 1
List the id and type of each thing, and the details of the organization that owns it.
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer details', 'text']] -- Table: properties columns : [['property id', 'number'], ['property type code', 'text'], ['property address', 'text'], ['other details', 'text']] -- Table: residents columns : [['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time'], ['date moved out', 'time'], ['other details', 'text']] -- Table: organizations columns : [['organization id', 'number'], ['parent organization id', 'number'], ['organization details', 'text']] -- Table: services columns : [['service id', 'number'], ['organization id', 'number'], ['service type code', 'text'], ['service details', 'text']] -- Table: residents services columns : [['resident id', 'number'], ['service id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['date requested', 'time'], ['date provided', 'time'], ['other details', 'text']] -- Table: things columns : [['thing id', 'number'], ['organization id', 'number'], ['type of thing code', 'text'], ['service type code', 'text'], ['service details', 'text']] -- Table: customer events columns : [['customer event id', 'number'], ['customer id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['resident id', 'number'], ['thing id', 'number']] -- Table: customer event notes columns : [['customer event note id', 'number'], ['customer event id', 'number'], ['service type code', 'text'], ['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time']] -- Table: timed status of things columns : [['thing id', 'number'], ['date and date', 'time'], ['status of thing code', 'text']] -- Table: timed locations of things columns : [['thing id', 'number'], ['date and time', 'time'], ['location code', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List the id and type of each thing, and the details of the organization that owns it.` to a syntactically-correct PostgreSQL query.
SELECT T1.thing_id , T1.type_of_Thing_Code , T2.organization_details FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id
What are the id and details of the customers who have at least 3 events?
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer details', 'text']] -- Table: properties columns : [['property id', 'number'], ['property type code', 'text'], ['property address', 'text'], ['other details', 'text']] -- Table: residents columns : [['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time'], ['date moved out', 'time'], ['other details', 'text']] -- Table: organizations columns : [['organization id', 'number'], ['parent organization id', 'number'], ['organization details', 'text']] -- Table: services columns : [['service id', 'number'], ['organization id', 'number'], ['service type code', 'text'], ['service details', 'text']] -- Table: residents services columns : [['resident id', 'number'], ['service id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['date requested', 'time'], ['date provided', 'time'], ['other details', 'text']] -- Table: things columns : [['thing id', 'number'], ['organization id', 'number'], ['type of thing code', 'text'], ['service type code', 'text'], ['service details', 'text']] -- Table: customer events columns : [['customer event id', 'number'], ['customer id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['resident id', 'number'], ['thing id', 'number']] -- Table: customer event notes columns : [['customer event note id', 'number'], ['customer event id', 'number'], ['service type code', 'text'], ['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time']] -- Table: timed status of things columns : [['thing id', 'number'], ['date and date', 'time'], ['status of thing code', 'text']] -- Table: timed locations of things columns : [['thing id', 'number'], ['date and time', 'time'], ['location code', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the id and details of the customers who have at least 3 events?` to a syntactically-correct PostgreSQL query.
SELECT T1.customer_id , T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) >= 3
What is each customer's move in date, and the corresponding customer id and details?
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer details', 'text']] -- Table: properties columns : [['property id', 'number'], ['property type code', 'text'], ['property address', 'text'], ['other details', 'text']] -- Table: residents columns : [['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time'], ['date moved out', 'time'], ['other details', 'text']] -- Table: organizations columns : [['organization id', 'number'], ['parent organization id', 'number'], ['organization details', 'text']] -- Table: services columns : [['service id', 'number'], ['organization id', 'number'], ['service type code', 'text'], ['service details', 'text']] -- Table: residents services columns : [['resident id', 'number'], ['service id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['date requested', 'time'], ['date provided', 'time'], ['other details', 'text']] -- Table: things columns : [['thing id', 'number'], ['organization id', 'number'], ['type of thing code', 'text'], ['service type code', 'text'], ['service details', 'text']] -- Table: customer events columns : [['customer event id', 'number'], ['customer id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['resident id', 'number'], ['thing id', 'number']] -- Table: customer event notes columns : [['customer event note id', 'number'], ['customer event id', 'number'], ['service type code', 'text'], ['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time']] -- Table: timed status of things columns : [['thing id', 'number'], ['date and date', 'time'], ['status of thing code', 'text']] -- Table: timed locations of things columns : [['thing id', 'number'], ['date and time', 'time'], ['location code', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is each customer's move in date, and the corresponding customer id and details?` to a syntactically-correct PostgreSQL query.
SELECT T2.date_moved_in , T1.customer_id , T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id
Which events have the number of notes between one and three? List the event id and the property id.
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer details', 'text']] -- Table: properties columns : [['property id', 'number'], ['property type code', 'text'], ['property address', 'text'], ['other details', 'text']] -- Table: residents columns : [['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time'], ['date moved out', 'time'], ['other details', 'text']] -- Table: organizations columns : [['organization id', 'number'], ['parent organization id', 'number'], ['organization details', 'text']] -- Table: services columns : [['service id', 'number'], ['organization id', 'number'], ['service type code', 'text'], ['service details', 'text']] -- Table: residents services columns : [['resident id', 'number'], ['service id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['date requested', 'time'], ['date provided', 'time'], ['other details', 'text']] -- Table: things columns : [['thing id', 'number'], ['organization id', 'number'], ['type of thing code', 'text'], ['service type code', 'text'], ['service details', 'text']] -- Table: customer events columns : [['customer event id', 'number'], ['customer id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['resident id', 'number'], ['thing id', 'number']] -- Table: customer event notes columns : [['customer event note id', 'number'], ['customer event id', 'number'], ['service type code', 'text'], ['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time']] -- Table: timed status of things columns : [['thing id', 'number'], ['date and date', 'time'], ['status of thing code', 'text']] -- Table: timed locations of things columns : [['thing id', 'number'], ['date and time', 'time'], ['location code', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Which events have the number of notes between one and three? List the event id and the property id.` to a syntactically-correct PostgreSQL query.
SELECT T1.Customer_Event_ID , T1.property_id FROM Customer_Events AS T1 JOIN Customer_Event_Notes AS T2 ON T1.Customer_Event_ID = T2.Customer_Event_ID GROUP BY T1.customer_event_id HAVING count(*) BETWEEN 1 AND 3
What are the distinct id and type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21'
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer details', 'text']] -- Table: properties columns : [['property id', 'number'], ['property type code', 'text'], ['property address', 'text'], ['other details', 'text']] -- Table: residents columns : [['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time'], ['date moved out', 'time'], ['other details', 'text']] -- Table: organizations columns : [['organization id', 'number'], ['parent organization id', 'number'], ['organization details', 'text']] -- Table: services columns : [['service id', 'number'], ['organization id', 'number'], ['service type code', 'text'], ['service details', 'text']] -- Table: residents services columns : [['resident id', 'number'], ['service id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['date requested', 'time'], ['date provided', 'time'], ['other details', 'text']] -- Table: things columns : [['thing id', 'number'], ['organization id', 'number'], ['type of thing code', 'text'], ['service type code', 'text'], ['service details', 'text']] -- Table: customer events columns : [['customer event id', 'number'], ['customer id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['resident id', 'number'], ['thing id', 'number']] -- Table: customer event notes columns : [['customer event note id', 'number'], ['customer event id', 'number'], ['service type code', 'text'], ['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time']] -- Table: timed status of things columns : [['thing id', 'number'], ['date and date', 'time'], ['status of thing code', 'text']] -- Table: timed locations of things columns : [['thing id', 'number'], ['date and time', 'time'], ['location code', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the distinct id and type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21'` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T2.thing_id , T2.Type_of_Thing_Code FROM Timed_Status_of_Things AS T1 JOIN Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.Status_of_Thing_Code = 'Close' OR T1.Date_and_Date < '2017-06-19 02:59:21'
How many distinct locations have the things with service detail 'Unsatisfied' been located in?
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer details', 'text']] -- Table: properties columns : [['property id', 'number'], ['property type code', 'text'], ['property address', 'text'], ['other details', 'text']] -- Table: residents columns : [['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time'], ['date moved out', 'time'], ['other details', 'text']] -- Table: organizations columns : [['organization id', 'number'], ['parent organization id', 'number'], ['organization details', 'text']] -- Table: services columns : [['service id', 'number'], ['organization id', 'number'], ['service type code', 'text'], ['service details', 'text']] -- Table: residents services columns : [['resident id', 'number'], ['service id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['date requested', 'time'], ['date provided', 'time'], ['other details', 'text']] -- Table: things columns : [['thing id', 'number'], ['organization id', 'number'], ['type of thing code', 'text'], ['service type code', 'text'], ['service details', 'text']] -- Table: customer events columns : [['customer event id', 'number'], ['customer id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['resident id', 'number'], ['thing id', 'number']] -- Table: customer event notes columns : [['customer event note id', 'number'], ['customer event id', 'number'], ['service type code', 'text'], ['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time']] -- Table: timed status of things columns : [['thing id', 'number'], ['date and date', 'time'], ['status of thing code', 'text']] -- Table: timed locations of things columns : [['thing id', 'number'], ['date and time', 'time'], ['location code', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many distinct locations have the things with service detail 'Unsatisfied' been located in?` to a syntactically-correct PostgreSQL query.
SELECT count(DISTINCT T2.Location_Code) FROM Things AS T1 JOIN Timed_Locations_of_Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.service_details = 'Unsatisfied'
How many different status codes of things are there?
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer details', 'text']] -- Table: properties columns : [['property id', 'number'], ['property type code', 'text'], ['property address', 'text'], ['other details', 'text']] -- Table: residents columns : [['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time'], ['date moved out', 'time'], ['other details', 'text']] -- Table: organizations columns : [['organization id', 'number'], ['parent organization id', 'number'], ['organization details', 'text']] -- Table: services columns : [['service id', 'number'], ['organization id', 'number'], ['service type code', 'text'], ['service details', 'text']] -- Table: residents services columns : [['resident id', 'number'], ['service id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['date requested', 'time'], ['date provided', 'time'], ['other details', 'text']] -- Table: things columns : [['thing id', 'number'], ['organization id', 'number'], ['type of thing code', 'text'], ['service type code', 'text'], ['service details', 'text']] -- Table: customer events columns : [['customer event id', 'number'], ['customer id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['resident id', 'number'], ['thing id', 'number']] -- Table: customer event notes columns : [['customer event note id', 'number'], ['customer event id', 'number'], ['service type code', 'text'], ['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time']] -- Table: timed status of things columns : [['thing id', 'number'], ['date and date', 'time'], ['status of thing code', 'text']] -- Table: timed locations of things columns : [['thing id', 'number'], ['date and time', 'time'], ['location code', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many different status codes of things are there?` to a syntactically-correct PostgreSQL query.
SELECT count(DISTINCT Status_of_Thing_Code) FROM Timed_Status_of_Things
Which organizations are not a parent organization of others? List the organization id.
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer details', 'text']] -- Table: properties columns : [['property id', 'number'], ['property type code', 'text'], ['property address', 'text'], ['other details', 'text']] -- Table: residents columns : [['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time'], ['date moved out', 'time'], ['other details', 'text']] -- Table: organizations columns : [['organization id', 'number'], ['parent organization id', 'number'], ['organization details', 'text']] -- Table: services columns : [['service id', 'number'], ['organization id', 'number'], ['service type code', 'text'], ['service details', 'text']] -- Table: residents services columns : [['resident id', 'number'], ['service id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['date requested', 'time'], ['date provided', 'time'], ['other details', 'text']] -- Table: things columns : [['thing id', 'number'], ['organization id', 'number'], ['type of thing code', 'text'], ['service type code', 'text'], ['service details', 'text']] -- Table: customer events columns : [['customer event id', 'number'], ['customer id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['resident id', 'number'], ['thing id', 'number']] -- Table: customer event notes columns : [['customer event note id', 'number'], ['customer event id', 'number'], ['service type code', 'text'], ['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time']] -- Table: timed status of things columns : [['thing id', 'number'], ['date and date', 'time'], ['status of thing code', 'text']] -- Table: timed locations of things columns : [['thing id', 'number'], ['date and time', 'time'], ['location code', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Which organizations are not a parent organization of others? List the organization id.` to a syntactically-correct PostgreSQL query.
SELECT organization_id FROM organizations EXCEPT SELECT parent_organization_id FROM organizations
When is the last day any resident moved in?
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer details', 'text']] -- Table: properties columns : [['property id', 'number'], ['property type code', 'text'], ['property address', 'text'], ['other details', 'text']] -- Table: residents columns : [['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time'], ['date moved out', 'time'], ['other details', 'text']] -- Table: organizations columns : [['organization id', 'number'], ['parent organization id', 'number'], ['organization details', 'text']] -- Table: services columns : [['service id', 'number'], ['organization id', 'number'], ['service type code', 'text'], ['service details', 'text']] -- Table: residents services columns : [['resident id', 'number'], ['service id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['date requested', 'time'], ['date provided', 'time'], ['other details', 'text']] -- Table: things columns : [['thing id', 'number'], ['organization id', 'number'], ['type of thing code', 'text'], ['service type code', 'text'], ['service details', 'text']] -- Table: customer events columns : [['customer event id', 'number'], ['customer id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['resident id', 'number'], ['thing id', 'number']] -- Table: customer event notes columns : [['customer event note id', 'number'], ['customer event id', 'number'], ['service type code', 'text'], ['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time']] -- Table: timed status of things columns : [['thing id', 'number'], ['date and date', 'time'], ['status of thing code', 'text']] -- Table: timed locations of things columns : [['thing id', 'number'], ['date and time', 'time'], ['location code', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `When is the last day any resident moved in?` to a syntactically-correct PostgreSQL query.
SELECT max(date_moved_in) FROM Residents
What are the resident details containing the substring 'Miss'?
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer details', 'text']] -- Table: properties columns : [['property id', 'number'], ['property type code', 'text'], ['property address', 'text'], ['other details', 'text']] -- Table: residents columns : [['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time'], ['date moved out', 'time'], ['other details', 'text']] -- Table: organizations columns : [['organization id', 'number'], ['parent organization id', 'number'], ['organization details', 'text']] -- Table: services columns : [['service id', 'number'], ['organization id', 'number'], ['service type code', 'text'], ['service details', 'text']] -- Table: residents services columns : [['resident id', 'number'], ['service id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['date requested', 'time'], ['date provided', 'time'], ['other details', 'text']] -- Table: things columns : [['thing id', 'number'], ['organization id', 'number'], ['type of thing code', 'text'], ['service type code', 'text'], ['service details', 'text']] -- Table: customer events columns : [['customer event id', 'number'], ['customer id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['resident id', 'number'], ['thing id', 'number']] -- Table: customer event notes columns : [['customer event note id', 'number'], ['customer event id', 'number'], ['service type code', 'text'], ['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time']] -- Table: timed status of things columns : [['thing id', 'number'], ['date and date', 'time'], ['status of thing code', 'text']] -- Table: timed locations of things columns : [['thing id', 'number'], ['date and time', 'time'], ['location code', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the resident details containing the substring 'Miss'?` to a syntactically-correct PostgreSQL query.
SELECT other_details FROM Residents WHERE other_details LIKE '%Miss%'
List the customer event id and the corresponding move in date and property id.
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer details', 'text']] -- Table: properties columns : [['property id', 'number'], ['property type code', 'text'], ['property address', 'text'], ['other details', 'text']] -- Table: residents columns : [['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time'], ['date moved out', 'time'], ['other details', 'text']] -- Table: organizations columns : [['organization id', 'number'], ['parent organization id', 'number'], ['organization details', 'text']] -- Table: services columns : [['service id', 'number'], ['organization id', 'number'], ['service type code', 'text'], ['service details', 'text']] -- Table: residents services columns : [['resident id', 'number'], ['service id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['date requested', 'time'], ['date provided', 'time'], ['other details', 'text']] -- Table: things columns : [['thing id', 'number'], ['organization id', 'number'], ['type of thing code', 'text'], ['service type code', 'text'], ['service details', 'text']] -- Table: customer events columns : [['customer event id', 'number'], ['customer id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['resident id', 'number'], ['thing id', 'number']] -- Table: customer event notes columns : [['customer event note id', 'number'], ['customer event id', 'number'], ['service type code', 'text'], ['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time']] -- Table: timed status of things columns : [['thing id', 'number'], ['date and date', 'time'], ['status of thing code', 'text']] -- Table: timed locations of things columns : [['thing id', 'number'], ['date and time', 'time'], ['location code', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List the customer event id and the corresponding move in date and property id.` to a syntactically-correct PostgreSQL query.
SELECT customer_event_id , date_moved_in , property_id FROM customer_events
How many customers did not have any event?
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer details', 'text']] -- Table: properties columns : [['property id', 'number'], ['property type code', 'text'], ['property address', 'text'], ['other details', 'text']] -- Table: residents columns : [['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time'], ['date moved out', 'time'], ['other details', 'text']] -- Table: organizations columns : [['organization id', 'number'], ['parent organization id', 'number'], ['organization details', 'text']] -- Table: services columns : [['service id', 'number'], ['organization id', 'number'], ['service type code', 'text'], ['service details', 'text']] -- Table: residents services columns : [['resident id', 'number'], ['service id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['date requested', 'time'], ['date provided', 'time'], ['other details', 'text']] -- Table: things columns : [['thing id', 'number'], ['organization id', 'number'], ['type of thing code', 'text'], ['service type code', 'text'], ['service details', 'text']] -- Table: customer events columns : [['customer event id', 'number'], ['customer id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['resident id', 'number'], ['thing id', 'number']] -- Table: customer event notes columns : [['customer event note id', 'number'], ['customer event id', 'number'], ['service type code', 'text'], ['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time']] -- Table: timed status of things columns : [['thing id', 'number'], ['date and date', 'time'], ['status of thing code', 'text']] -- Table: timed locations of things columns : [['thing id', 'number'], ['date and time', 'time'], ['location code', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many customers did not have any event?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM customers WHERE customer_id NOT IN ( SELECT customer_id FROM customer_events )
What are the distinct move in dates of the residents?
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer details', 'text']] -- Table: properties columns : [['property id', 'number'], ['property type code', 'text'], ['property address', 'text'], ['other details', 'text']] -- Table: residents columns : [['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time'], ['date moved out', 'time'], ['other details', 'text']] -- Table: organizations columns : [['organization id', 'number'], ['parent organization id', 'number'], ['organization details', 'text']] -- Table: services columns : [['service id', 'number'], ['organization id', 'number'], ['service type code', 'text'], ['service details', 'text']] -- Table: residents services columns : [['resident id', 'number'], ['service id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['date requested', 'time'], ['date provided', 'time'], ['other details', 'text']] -- Table: things columns : [['thing id', 'number'], ['organization id', 'number'], ['type of thing code', 'text'], ['service type code', 'text'], ['service details', 'text']] -- Table: customer events columns : [['customer event id', 'number'], ['customer id', 'number'], ['date moved in', 'time'], ['property id', 'number'], ['resident id', 'number'], ['thing id', 'number']] -- Table: customer event notes columns : [['customer event note id', 'number'], ['customer event id', 'number'], ['service type code', 'text'], ['resident id', 'number'], ['property id', 'number'], ['date moved in', 'time']] -- Table: timed status of things columns : [['thing id', 'number'], ['date and date', 'time'], ['status of thing code', 'text']] -- Table: timed locations of things columns : [['thing id', 'number'], ['date and time', 'time'], ['location code', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the distinct move in dates of the residents?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT date_moved_in FROM residents
How many schools are there?
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `How many schools are there?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM school
Count the number of schools.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `Count the number of schools.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM school
List the locations of schools in ascending order of enrollment.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `List the locations of schools in ascending order of enrollment.` to a syntactically-correct PostgreSQL query.
SELECT LOCATION FROM school ORDER BY Enrollment ASC
What is the list of school locations sorted in ascending order of school enrollment?
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `What is the list of school locations sorted in ascending order of school enrollment?` to a syntactically-correct PostgreSQL query.
SELECT LOCATION FROM school ORDER BY Enrollment ASC
List the locations of schools in descending order of founded year.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `List the locations of schools in descending order of founded year.` to a syntactically-correct PostgreSQL query.
SELECT LOCATION FROM school ORDER BY Founded DESC
What is the list of school locations sorted in descending order of school foundation year?
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `What is the list of school locations sorted in descending order of school foundation year?` to a syntactically-correct PostgreSQL query.
SELECT LOCATION FROM school ORDER BY Founded DESC
What are the enrollments of schools whose denomination is not "Catholic"?
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `What are the enrollments of schools whose denomination is not "Catholic"?` to a syntactically-correct PostgreSQL query.
SELECT Enrollment FROM school WHERE Denomination != "Catholic"
List the enrollment for each school that does not have "Catholic" as denomination.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `List the enrollment for each school that does not have "Catholic" as denomination.` to a syntactically-correct PostgreSQL query.
SELECT Enrollment FROM school WHERE Denomination != "Catholic"
What is the average enrollment of schools?
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `What is the average enrollment of schools?` to a syntactically-correct PostgreSQL query.
SELECT avg(Enrollment) FROM school
Take the average of the school enrollment.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `Take the average of the school enrollment.` to a syntactically-correct PostgreSQL query.
SELECT avg(Enrollment) FROM school
What are the teams of the players, sorted in ascending alphabetical order?
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `What are the teams of the players, sorted in ascending alphabetical order?` to a syntactically-correct PostgreSQL query.
SELECT Team FROM player ORDER BY Team ASC
Find the team of each player and sort them in ascending alphabetical order.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `Find the team of each player and sort them in ascending alphabetical order.` to a syntactically-correct PostgreSQL query.
SELECT Team FROM player ORDER BY Team ASC
How many different positions of players are there?
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `How many different positions of players are there?` to a syntactically-correct PostgreSQL query.
SELECT count(DISTINCT POSITION) FROM player
Count the number of distinct player positions.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `Count the number of distinct player positions.` to a syntactically-correct PostgreSQL query.
SELECT count(DISTINCT POSITION) FROM player
Find the team of the player of the highest age.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `Find the team of the player of the highest age.` to a syntactically-correct PostgreSQL query.
SELECT Team FROM player ORDER BY Age DESC LIMIT 1
Which team has the oldest player?
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `Which team has the oldest player?` to a syntactically-correct PostgreSQL query.
SELECT Team FROM player ORDER BY Age DESC LIMIT 1
List the teams of the players with the top 5 largest ages.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `List the teams of the players with the top 5 largest ages.` to a syntactically-correct PostgreSQL query.
SELECT Team FROM player ORDER BY Age DESC LIMIT 5
What are the teams that have the 5 oldest players?
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `What are the teams that have the 5 oldest players?` to a syntactically-correct PostgreSQL query.
SELECT Team FROM player ORDER BY Age DESC LIMIT 5
For each player, show the team and the location of school they belong to.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `For each player, show the team and the location of school they belong to.` to a syntactically-correct PostgreSQL query.
SELECT T1.Team , T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID
What are the team and the location of school each player belongs to?
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `What are the team and the location of school each player belongs to?` to a syntactically-correct PostgreSQL query.
SELECT T1.Team , T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID
Show the locations of schools that have more than 1 player.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `Show the locations of schools that have more than 1 player.` to a syntactically-correct PostgreSQL query.
SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*) > 1
Which schools have more than 1 player? Give me the school locations.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `Which schools have more than 1 player? Give me the school locations.` to a syntactically-correct PostgreSQL query.
SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*) > 1
Show the denomination of the school that has the most players.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `Show the denomination of the school that has the most players.` to a syntactically-correct PostgreSQL query.
SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1
What is the denomination of the school the most players belong to?
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `What is the denomination of the school the most players belong to?` to a syntactically-correct PostgreSQL query.
SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1
Show locations and nicknames of schools.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `Show locations and nicknames of schools.` to a syntactically-correct PostgreSQL query.
SELECT T1.Location , T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID = T2.School_ID
What are the location and nickname of each school?
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `What are the location and nickname of each school?` to a syntactically-correct PostgreSQL query.
SELECT T1.Location , T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID = T2.School_ID
Please show different denominations and the corresponding number of schools.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `Please show different denominations and the corresponding number of schools.` to a syntactically-correct PostgreSQL query.
SELECT Denomination , COUNT(*) FROM school GROUP BY Denomination
For each denomination, return the denomination and the count of schools with that denomination.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `For each denomination, return the denomination and the count of schools with that denomination.` to a syntactically-correct PostgreSQL query.
SELECT Denomination , COUNT(*) FROM school GROUP BY Denomination
Please show different denominations and the corresponding number of schools in descending order.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `Please show different denominations and the corresponding number of schools in descending order.` to a syntactically-correct PostgreSQL query.
SELECT Denomination , COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC
Order denominations in descending order of the count of schools with the denomination. Return each denomination with the count of schools.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `Order denominations in descending order of the count of schools with the denomination. Return each denomination with the count of schools.` to a syntactically-correct PostgreSQL query.
SELECT Denomination , COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC
List the school color of the school that has the largest enrollment.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `List the school color of the school that has the largest enrollment.` to a syntactically-correct PostgreSQL query.
SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1
What is the school color of the school with the largest enrollment?
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `What is the school color of the school with the largest enrollment?` to a syntactically-correct PostgreSQL query.
SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1
List the locations of schools that do not have any player.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `List the locations of schools that do not have any player.` to a syntactically-correct PostgreSQL query.
SELECT LOCATION FROM school WHERE School_ID NOT IN (SELECT School_ID FROM Player)
Which schools do not have any player? Give me the school locations.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `Which schools do not have any player? Give me the school locations.` to a syntactically-correct PostgreSQL query.
SELECT LOCATION FROM school WHERE School_ID NOT IN (SELECT School_ID FROM Player)
Show the denomination shared by schools founded before 1890 and schools founded after 1900
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `Show the denomination shared by schools founded before 1890 and schools founded after 1900` to a syntactically-correct PostgreSQL query.
SELECT Denomination FROM school WHERE Founded < 1890 INTERSECT SELECT Denomination FROM school WHERE Founded > 1900
What are the denominations used by both schools founded before 1890 and schools founded after 1900?
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `What are the denominations used by both schools founded before 1890 and schools founded after 1900?` to a syntactically-correct PostgreSQL query.
SELECT Denomination FROM school WHERE Founded < 1890 INTERSECT SELECT Denomination FROM school WHERE Founded > 1900
Show the nicknames of schools that are not in division 1.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `Show the nicknames of schools that are not in division 1.` to a syntactically-correct PostgreSQL query.
SELECT Nickname FROM school_details WHERE Division != "Division 1"
What are the nicknames of schools whose division is not 1?
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `What are the nicknames of schools whose division is not 1?` to a syntactically-correct PostgreSQL query.
SELECT Nickname FROM school_details WHERE Division != "Division 1"
Show the denomination shared by more than one school.
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `Show the denomination shared by more than one school.` to a syntactically-correct PostgreSQL query.
SELECT Denomination FROM school GROUP BY Denomination HAVING COUNT(*) > 1
What are the denomination more than one school have?
-- Language PostgreSQL -- Tables: -- Table: school columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['enrollment', 'number'], ['founded', 'number'], ['denomination', 'text'], ['boys or girls', 'text'], ['day or boarding', 'text'], ['year entered competition', 'number'], ['school colors', 'text']] -- Table: school details columns : [['school id', 'number'], ['nickname', 'text'], ['colors', 'text'], ['league', 'text'], ['class', 'text'], ['division', 'text']] -- Table: school performance columns : [['school id', 'number'], ['school year', 'text'], ['class a', 'text'], ['class aa', 'text']] -- Table: player columns : [['player id', 'number'], ['player', 'text'], ['team', 'text'], ['age', 'number'], ['position', 'text'], ['school 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. Translate `What are the denomination more than one school have?` to a syntactically-correct PostgreSQL query.
SELECT Denomination FROM school GROUP BY Denomination HAVING COUNT(*) > 1