brief_instruction
stringlengths
16
224
instruction
stringlengths
687
8.77k
output
stringlengths
18
577
List the name of ships in ascending order of tonnage.
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 ships in ascending order of tonnage.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM ship ORDER BY Tonnage ASC
what are the names of the ships ordered by ascending tonnage?
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 ships ordered by ascending tonnage?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM ship ORDER BY Tonnage ASC
What are the type and nationality of ships?
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 type and nationality of ships?` to a syntactically-correct PostgreSQL query.
SELECT TYPE , Nationality FROM ship
What are the types and nationalities of every ship?
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 types and nationalities of every ship?` to a syntactically-correct PostgreSQL query.
SELECT TYPE , Nationality FROM ship
List the name of ships whose nationality is not "United States".
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 ships whose nationality is not "United States".` to a syntactically-correct PostgreSQL query.
SELECT Name FROM ship WHERE Nationality != "United States"
What are the names of the ships that are not from the United States?
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 ships that are not from the United States?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM ship WHERE Nationality != "United States"
Show the name of ships whose nationality is either United States or United Kingdom.
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 name of ships whose nationality is either United States or United Kingdom.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM ship WHERE Nationality = "United States" OR Nationality = "United Kingdom"
What are the names of the ships that are from either the US or the UK?
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 ships that are from either the US or the UK?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM ship WHERE Nationality = "United States" OR Nationality = "United Kingdom"
What is the name of the ship with the largest tonnage?
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 ship with the largest tonnage?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1
What is the ship with the largest amount of tonnage called?
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 ship with the largest amount of tonnage called?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1
Show different types of ships and the number of ships of each type.
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 different types of ships and the number of ships of each type.` to a syntactically-correct PostgreSQL query.
SELECT TYPE , COUNT(*) FROM ship GROUP BY TYPE
For each type, how many ships are there?
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 type, how many ships are there?` to a syntactically-correct PostgreSQL query.
SELECT TYPE , COUNT(*) FROM ship GROUP BY TYPE
Please show the most common type of ships.
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 most common type of ships.` to a syntactically-correct PostgreSQL query.
SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
What is the most common type of ships?
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 most common type of ships?` to a syntactically-correct PostgreSQL query.
SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
List the nations that have more than two ships.
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 nations that have more than two ships.` to a syntactically-correct PostgreSQL query.
SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2
What are the nations that have more than two ships?
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 nations that have more than two ships?` to a syntactically-correct PostgreSQL query.
SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2
Show different types of ships and the average tonnage of ships of each type.
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 different types of ships and the average tonnage of ships of each type.` to a syntactically-correct PostgreSQL query.
SELECT TYPE , avg(Tonnage) FROM ship GROUP BY TYPE
For each type, what is the average tonnage?
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 type, what is the average tonnage?` to a syntactically-correct PostgreSQL query.
SELECT TYPE , avg(Tonnage) FROM ship GROUP BY TYPE
Show codes and fates of missions, and names of ships involved.
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 codes and fates of missions, and names of ships involved.` to a syntactically-correct PostgreSQL query.
SELECT T1.Code , T1.Fate , T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID
What are the mission codes, fates, and names of the ships involved?
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 mission codes, fates, and names of the ships involved?` to a syntactically-correct PostgreSQL query.
SELECT T1.Code , T1.Fate , T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID
Show names of ships involved in a mission launched after 1928.
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 names of ships involved in a mission launched after 1928.` to a syntactically-correct PostgreSQL query.
SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928
What are the names of ships that were involved in a mission launched after 1928?
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 ships that were involved in a mission launched after 1928?` to a syntactically-correct PostgreSQL query.
SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928
Show the distinct fate of missions that involve ships with nationality "United States"
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 distinct fate of missions that involve ships with nationality "United States"` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T1.Fate FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T2.Nationality = "United States"
What are the different fates of the mission that involved ships from the United States?
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 different fates of the mission that involved ships from the United States?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T1.Fate FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T2.Nationality = "United States"
List the name of ships that are not involved in any mission
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 ships that are not involved in any mission` to a syntactically-correct PostgreSQL query.
SELECT Name FROM ship WHERE Ship_ID NOT IN (SELECT Ship_ID FROM mission)
What are the names of the ships that are not involved in any missions?
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 ships that are not involved in any missions?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM ship WHERE Ship_ID NOT IN (SELECT Ship_ID FROM mission)
Show the types of ships that have both ships with tonnage larger than 6000 and ships with tonnage smaller than 4000.
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 types of ships that have both ships with tonnage larger than 6000 and ships with tonnage smaller than 4000.` to a syntactically-correct PostgreSQL query.
SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000
What are the types of the ships that have both shiips with tonnage more than 6000 and those with tonnage less than 4000?
-- Language PostgreSQL -- Tables: -- Table: mission columns : [['mission id', 'number'], ['ship id', 'number'], ['code', 'text'], ['launched year', 'number'], ['location', 'text'], ['speed knots', 'number'], ['fate', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['nationality', 'text'], ['tonnage', '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 types of the ships that have both shiips with tonnage more than 6000 and those with tonnage less than 4000?` to a syntactically-correct PostgreSQL query.
SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000
Find the number of students in total.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 number of students in total.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM list
How many students are there?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 students are there?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM list
Find the last names of students studying in room 111.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 last names of students studying in room 111.` to a syntactically-correct PostgreSQL query.
SELECT lastname FROM list WHERE classroom = 111
What are the last names of students in room 111?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 last names of students in room 111?` to a syntactically-correct PostgreSQL query.
SELECT lastname FROM list WHERE classroom = 111
Find the first names of students studying in room 108.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 first names of students studying in room 108.` to a syntactically-correct PostgreSQL query.
SELECT firstname FROM list WHERE classroom = 108
What are the first names of students in room 108?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 first names of students in room 108?` to a syntactically-correct PostgreSQL query.
SELECT firstname FROM list WHERE classroom = 108
What are the first names of students studying in room 107?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 first names of students studying in room 107?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT firstname FROM list WHERE classroom = 107
List the first names of all the students in room 107.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 first names of all the students in room 107.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT firstname FROM list WHERE classroom = 107
For each classroom report the grade that is taught in it. Report just the classroom number and the grade number.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 classroom report the grade that is taught in it. Report just the classroom number and the grade number.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT classroom , grade FROM list
What are the grade number and classroom number of each class in the list?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 grade number and classroom number of each class in the list?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT classroom , grade FROM list
Which grade is studying in classroom 103?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 grade is studying in classroom 103?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT grade FROM list WHERE classroom = 103
Find the grade taught in classroom 103.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 grade taught in classroom 103.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT grade FROM list WHERE classroom = 103
Find the grade studying in room 105.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 grade studying in room 105.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT grade FROM list WHERE classroom = 105
Which grade is studying in room 105?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 grade is studying in room 105?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT grade FROM list WHERE classroom = 105
Which classrooms are used by grade 4?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 classrooms are used by grade 4?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT classroom FROM list WHERE grade = 4
Find the classrooms in which grade 4 is studying.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 classrooms in which grade 4 is studying.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT classroom FROM list WHERE grade = 4
Which classrooms are used by grade 5?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 classrooms are used by grade 5?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT classroom FROM list WHERE grade = 5
Show me the classrooms grade 5 is using.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 me the classrooms grade 5 is using.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT classroom FROM list WHERE grade = 5
Find the last names of the teachers that teach fifth grade.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 last names of the teachers that teach fifth grade.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5
what are the last names of the teachers who teach grade 5?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 last names of the teachers who teach grade 5?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5
Find the first names of the teachers that teach first grade.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 first names of the teachers that teach first grade.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1
What are the first names of the teachers who teach grade 1?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 first names of the teachers who teach grade 1?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1
Find the first names of all the teachers that teach in classroom 110.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 first names of all the teachers that teach in classroom 110.` to a syntactically-correct PostgreSQL query.
SELECT firstname FROM teachers WHERE classroom = 110
Which teachers teach in classroom 110? Give me their first names.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 teachers teach in classroom 110? Give me their first names.` to a syntactically-correct PostgreSQL query.
SELECT firstname FROM teachers WHERE classroom = 110
Find the last names of teachers teaching in classroom 109.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 last names of teachers teaching in classroom 109.` to a syntactically-correct PostgreSQL query.
SELECT lastname FROM teachers WHERE classroom = 109
Which teachers teach in classroom 109? Give me their last names.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 teachers teach in classroom 109? Give me their last names.` to a syntactically-correct PostgreSQL query.
SELECT lastname FROM teachers WHERE classroom = 109
Report the first name and last name of all the teachers.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 `Report the first name and last name of all the teachers.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT firstname , lastname FROM teachers
What are the first name and last name of all the teachers?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 first name and last name of all the teachers?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT firstname , lastname FROM teachers
Report the first name and last name of all the students.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 `Report the first name and last name of all the students.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT firstname , lastname FROM list
Show each student's first name and last name.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 each student's first name and last name.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT firstname , lastname FROM list
Find all students taught by OTHA MOYER. Output the first and last names of the students.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 all students taught by OTHA MOYER. Output the first and last names of the students.` to a syntactically-correct PostgreSQL query.
SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "OTHA" AND T2.lastname = "MOYER"
Which students study under the teacher named OTHA MOYER? Give me the first and last names of the students.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 students study under the teacher named OTHA MOYER? Give me the first and last names of the students.` to a syntactically-correct PostgreSQL query.
SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "OTHA" AND T2.lastname = "MOYER"
Find all students taught by MARROTTE KIRK. Output first and last names of students.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 all students taught by MARROTTE KIRK. Output first and last names of students.` to a syntactically-correct PostgreSQL query.
SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "MARROTTE" AND T2.lastname = "KIRK"
Which are the first and last names of the students taught by MARROTTE KIRK?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 are the first and last names of the students taught by MARROTTE KIRK?` to a syntactically-correct PostgreSQL query.
SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "MARROTTE" AND T2.lastname = "KIRK"
Find the first and last name of all the teachers that teach EVELINA BROMLEY.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 first and last name of all the teachers that teach EVELINA BROMLEY.` to a syntactically-correct PostgreSQL query.
SELECT T2.firstname , T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "EVELINA" AND T1.lastname = "BROMLEY"
Which teachers teach the student named EVELINA BROMLEY? Give me the first and last name of the teachers.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 teachers teach the student named EVELINA BROMLEY? Give me the first and last name of the teachers.` to a syntactically-correct PostgreSQL query.
SELECT T2.firstname , T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "EVELINA" AND T1.lastname = "BROMLEY"
Find the last names of all the teachers that teach GELL TAMI.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 last names of all the teachers that teach GELL TAMI.` to a syntactically-correct PostgreSQL query.
SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "GELL" AND T1.lastname = "TAMI"
What are the last names of the teachers who teach the student called GELL TAMI?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 last names of the teachers who teach the student called GELL TAMI?` to a syntactically-correct PostgreSQL query.
SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "GELL" AND T1.lastname = "TAMI"
How many students does LORIA ONDERSMA teaches?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 students does LORIA ONDERSMA teaches?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "LORIA" AND T2.lastname = "ONDERSMA"
Count the number of students the teacher LORIA ONDERSMA teaches.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 students the teacher LORIA ONDERSMA teaches.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "LORIA" AND T2.lastname = "ONDERSMA"
How many students does KAWA GORDON teaches?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 students does KAWA GORDON teaches?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "KAWA" AND T2.lastname = "GORDON"
Find the number of students taught by the teacher KAWA GORDON.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 number of students taught by the teacher KAWA GORDON.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "KAWA" AND T2.lastname = "GORDON"
Find the number of students taught by TARRING LEIA.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 number of students taught by TARRING LEIA.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "TARRING" AND T2.lastname = "LEIA"
How many students are taught by teacher TARRING LEIA?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 students are taught by teacher TARRING LEIA?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "TARRING" AND T2.lastname = "LEIA"
How many teachers does the student named CHRISSY NABOZNY have?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 teachers does the student named CHRISSY NABOZNY have?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "CHRISSY" AND T1.lastname = "NABOZNY"
Find the number of teachers who teach the student called CHRISSY NABOZNY.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 number of teachers who teach the student called CHRISSY NABOZNY.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "CHRISSY" AND T1.lastname = "NABOZNY"
How many teachers does the student named MADLOCK RAY have?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 teachers does the student named MADLOCK RAY have?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "MADLOCK" AND T1.lastname = "RAY"
Find the number of teachers who teach the student called MADLOCK RAY.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 number of teachers who teach the student called MADLOCK RAY.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "MADLOCK" AND T1.lastname = "RAY"
Find all first-grade students who are NOT taught by OTHA MOYER. Report their first and last names.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 all first-grade students who are NOT taught by OTHA MOYER. Report their first and last names.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 1 EXCEPT SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "OTHA" AND T2.lastname = "MOYER"
What are the first and last names of the first-grade students who are NOT taught by teacher OTHA MOYER?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 first and last names of the first-grade students who are NOT taught by teacher OTHA MOYER?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 1 EXCEPT SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "OTHA" AND T2.lastname = "MOYER"
Find the last names of the students in third grade that are not taught by COVIN JEROME.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 last names of the students in third grade that are not taught by COVIN JEROME.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname != "COVIN" AND T2.lastname != "JEROME"
Which students in third grade are not taught by teacher COVIN JEROME? Give me the last names of the students.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 students in third grade are not taught by teacher COVIN JEROME? Give me the last names of the students.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname != "COVIN" AND T2.lastname != "JEROME"
For each grade, report the grade, the number of classrooms in which it is taught and the total number of students in the grade.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 grade, report the grade, the number of classrooms in which it is taught and the total number of students in the grade.` to a syntactically-correct PostgreSQL query.
SELECT grade , count(DISTINCT classroom) , count(*) FROM list GROUP BY grade
For each grade, return the grade number, the number of classrooms used for the grade, and the total number of students enrolled in the grade.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 grade, return the grade number, the number of classrooms used for the grade, and the total number of students enrolled in the grade.` to a syntactically-correct PostgreSQL query.
SELECT grade , count(DISTINCT classroom) , count(*) FROM list GROUP BY grade
For each classroom, report the classroom number and the number of grades using it.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 classroom, report the classroom number and the number of grades using it.` to a syntactically-correct PostgreSQL query.
SELECT classroom , count(DISTINCT grade) FROM list GROUP BY classroom
For each classroom, show the classroom number and count the number of distinct grades that use the room.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 classroom, show the classroom number and count the number of distinct grades that use the room.` to a syntactically-correct PostgreSQL query.
SELECT classroom , count(DISTINCT grade) FROM list GROUP BY classroom
Which classroom has the most students?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 classroom has the most students?` to a syntactically-correct PostgreSQL query.
SELECT classroom FROM list GROUP BY classroom ORDER BY count(*) DESC LIMIT 1
Find the classroom that the most students use.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 classroom that the most students use.` to a syntactically-correct PostgreSQL query.
SELECT classroom FROM list GROUP BY classroom ORDER BY count(*) DESC LIMIT 1
Report the number of students in each classroom.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 `Report the number of students in each classroom.` to a syntactically-correct PostgreSQL query.
SELECT classroom , count(*) FROM list GROUP BY classroom
For each classroom, show the classroom number and find how many students are using it.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 classroom, show the classroom number and find how many students are using it.` to a syntactically-correct PostgreSQL query.
SELECT classroom , count(*) FROM list GROUP BY classroom
For each grade 0 classroom, report the total number of students.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 grade 0 classroom, report the total number of students.` to a syntactically-correct PostgreSQL query.
SELECT classroom , count(*) FROM list WHERE grade = "0" GROUP BY classroom
For each grade 0 classroom, return the classroom number and the count of students.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 grade 0 classroom, return the classroom number and the count of students.` to a syntactically-correct PostgreSQL query.
SELECT classroom , count(*) FROM list WHERE grade = "0" GROUP BY classroom
Report the total number of students for each fourth-grade classroom.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 `Report the total number of students for each fourth-grade classroom.` to a syntactically-correct PostgreSQL query.
SELECT classroom , count(*) FROM list WHERE grade = "4" GROUP BY classroom
For each fourth-grade classroom, show the classroom number and the total number of students using it.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 fourth-grade classroom, show the classroom number and the total number of students using it.` to a syntactically-correct PostgreSQL query.
SELECT classroom , count(*) FROM list WHERE grade = "4" GROUP BY classroom
Find the name of the teacher who teaches the largest number of students.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 the teacher who teaches the largest number of students.` to a syntactically-correct PostgreSQL query.
SELECT T2.firstname , T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom GROUP BY T2.firstname , T2.lastname ORDER BY count(*) DESC LIMIT 1
Which teacher teaches the most students? Give me the first name and last name of the teacher.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 teacher teaches the most students? Give me the first name and last name of the teacher.` to a syntactically-correct PostgreSQL query.
SELECT T2.firstname , T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom GROUP BY T2.firstname , T2.lastname ORDER BY count(*) DESC LIMIT 1
Find the number of students in one classroom.
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 number of students in one classroom.` to a syntactically-correct PostgreSQL query.
SELECT count(*) , classroom FROM list GROUP BY classroom
How many students does one classroom have?
-- Language PostgreSQL -- Tables: -- Table: list columns : [['last name', 'text'], ['first name', 'text'], ['grade', 'number'], ['class room', 'number']] -- Table: teachers columns : [['last name', 'text'], ['first name', 'text'], ['class room', '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 students does one classroom have?` to a syntactically-correct PostgreSQL query.
SELECT count(*) , classroom FROM list GROUP BY classroom
How many companies are headquartered in the US?
-- Language PostgreSQL -- Tables: -- Table: people columns : [['people id', 'number'], ['age', 'number'], ['name', 'text'], ['nationality', 'text'], ['graduation college', 'text']] -- Table: company columns : [['company id', 'number'], ['name', 'text'], ['headquarters', 'text'], ['industry', 'text'], ['sales in billion', 'number'], ['profits in billion', 'number'], ['assets in billion', 'number'], ['market value in billion', 'number']] -- Table: employment columns : [['company id', 'number'], ['people id', 'number'], ['year working', '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 companies are headquartered in the US?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM company WHERE Headquarters = 'USA'
List the names of companies by ascending number of sales.
-- Language PostgreSQL -- Tables: -- Table: people columns : [['people id', 'number'], ['age', 'number'], ['name', 'text'], ['nationality', 'text'], ['graduation college', 'text']] -- Table: company columns : [['company id', 'number'], ['name', 'text'], ['headquarters', 'text'], ['industry', 'text'], ['sales in billion', 'number'], ['profits in billion', 'number'], ['assets in billion', 'number'], ['market value in billion', 'number']] -- Table: employment columns : [['company id', 'number'], ['people id', 'number'], ['year working', '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 companies by ascending number of sales.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM company ORDER BY Sales_in_Billion ASC
What are the headquarters and industries of all companies?
-- Language PostgreSQL -- Tables: -- Table: people columns : [['people id', 'number'], ['age', 'number'], ['name', 'text'], ['nationality', 'text'], ['graduation college', 'text']] -- Table: company columns : [['company id', 'number'], ['name', 'text'], ['headquarters', 'text'], ['industry', 'text'], ['sales in billion', 'number'], ['profits in billion', 'number'], ['assets in billion', 'number'], ['market value in billion', 'number']] -- Table: employment columns : [['company id', 'number'], ['people id', 'number'], ['year working', '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 headquarters and industries of all companies?` to a syntactically-correct PostgreSQL query.
SELECT Headquarters , Industry FROM company
Show the names of companies in the banking or retailing industry?
-- Language PostgreSQL -- Tables: -- Table: people columns : [['people id', 'number'], ['age', 'number'], ['name', 'text'], ['nationality', 'text'], ['graduation college', 'text']] -- Table: company columns : [['company id', 'number'], ['name', 'text'], ['headquarters', 'text'], ['industry', 'text'], ['sales in billion', 'number'], ['profits in billion', 'number'], ['assets in billion', 'number'], ['market value in billion', 'number']] -- Table: employment columns : [['company id', 'number'], ['people id', 'number'], ['year working', '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 companies in the banking or retailing industry?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM company WHERE Industry = "Banking" OR Industry = "Retailing"