brief_instruction
stringlengths
16
224
instruction
stringlengths
687
8.77k
output
stringlengths
18
577
What kind of decor has the least number of reservations?
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 kind of decor has the least number of reservations?` to a syntactically-correct PostgreSQL query.
SELECT T2.decor FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T2.decor ORDER BY count(T2.decor) ASC LIMIT 1;
What is the least popular kind of decor?
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 least popular kind of decor?` to a syntactically-correct PostgreSQL query.
SELECT T2.decor FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T2.decor ORDER BY count(T2.decor) ASC LIMIT 1;
List how many times the number of people in the room reached the maximum occupancy of the room. The number of people include adults and kids.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 how many times the number of people in the room reached the maximum occupancy of the room. The number of people include adults and kids.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T2.maxOccupancy = T1.Adults + T1.Kids;
How many times the number of adults and kids staying in a room reached the maximum capacity of the room?
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 times the number of adults and kids staying in a room reached the maximum capacity of the room?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T2.maxOccupancy = T1.Adults + T1.Kids;
Find the first and last names of people who payed more than the rooms' base prices.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 names of people who payed more than the rooms' base prices.` to a syntactically-correct PostgreSQL query.
SELECT T1.firstname , T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T1.Rate - T2.basePrice > 0
What are the first and last names of people who payed more than the rooms' base prices?
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 people who payed more than the rooms' base prices?` to a syntactically-correct PostgreSQL query.
SELECT T1.firstname , T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T1.Rate - T2.basePrice > 0
How many rooms are there?
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms are there?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Rooms;
What is the total number of rooms available in this inn?
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 total number of rooms available in this inn?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Rooms;
Find the number of rooms with a king bed.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms with a king bed.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Rooms WHERE bedType = "King";
How many rooms have a king bed?
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms have a king bed?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Rooms WHERE bedType = "King";
Find the number of rooms for each bed type.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms for each bed type.` to a syntactically-correct PostgreSQL query.
SELECT bedType , count(*) FROM Rooms GROUP BY bedType;
What are the number of rooms for each bed type?
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms for each bed type?` to a syntactically-correct PostgreSQL query.
SELECT bedType , count(*) FROM Rooms GROUP BY bedType;
Find the name of the room with the maximum occupancy.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 room with the maximum occupancy.` to a syntactically-correct PostgreSQL query.
SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1;
What is the name of the room that can accommodate the most people?
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 room that can accommodate the most people?` to a syntactically-correct PostgreSQL query.
SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1;
Find the id and name of the most expensive base price room.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 id and name of the most expensive base price room.` to a syntactically-correct PostgreSQL query.
SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1;
Which room has the highest base price?
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 room has the highest base price?` to a syntactically-correct PostgreSQL query.
SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1;
List the type of bed and name of all traditional rooms.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 type of bed and name of all traditional rooms.` to a syntactically-correct PostgreSQL query.
SELECT roomName , bedType FROM Rooms WHERE decor = "traditional";
What are the bed type and name of all the rooms with traditional decor?
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 bed type and name of all the rooms with traditional decor?` to a syntactically-correct PostgreSQL query.
SELECT roomName , bedType FROM Rooms WHERE decor = "traditional";
Find the number of rooms with king bed for each decor type.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms with king bed for each decor type.` to a syntactically-correct PostgreSQL query.
SELECT decor , count(*) FROM Rooms WHERE bedType = "King" GROUP BY decor;
How many rooms have king beds? Report the number for each decor type.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms have king beds? Report the number for each decor type.` to a syntactically-correct PostgreSQL query.
SELECT decor , count(*) FROM Rooms WHERE bedType = "King" GROUP BY decor;
Find the average and minimum price of the rooms in different decor.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 average and minimum price of the rooms in different decor.` to a syntactically-correct PostgreSQL query.
SELECT decor , avg(basePrice) , min(basePrice) FROM Rooms GROUP BY decor;
What is the average minimum and price of the rooms for each different decor.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 minimum and price of the rooms for each different decor.` to a syntactically-correct PostgreSQL query.
SELECT decor , avg(basePrice) , min(basePrice) FROM Rooms GROUP BY decor;
List the name of all rooms sorted by their prices.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 all rooms sorted by their prices.` to a syntactically-correct PostgreSQL query.
SELECT roomName FROM Rooms ORDER BY basePrice;
Sort all the rooms according to the price. Just report the room names.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 `Sort all the rooms according to the price. Just report the room names.` to a syntactically-correct PostgreSQL query.
SELECT roomName FROM Rooms ORDER BY basePrice;
Find the number of rooms with price higher than 120 for different decor.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms with price higher than 120 for different decor.` to a syntactically-correct PostgreSQL query.
SELECT decor , count(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor;
How many rooms cost more than 120, for each different decor?
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms cost more than 120, for each different decor?` to a syntactically-correct PostgreSQL query.
SELECT decor , count(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor;
For each bed type, find the average room price.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 bed type, find the average room price.` to a syntactically-correct PostgreSQL query.
SELECT bedType , avg(basePrice) FROM Rooms GROUP BY bedType;
What is the average base price of rooms, for each bed type?
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 base price of rooms, for each bed type?` to a syntactically-correct PostgreSQL query.
SELECT bedType , avg(basePrice) FROM Rooms GROUP BY bedType;
List the name of rooms with king or queen bed.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms with king or queen bed.` to a syntactically-correct PostgreSQL query.
SELECT roomName FROM Rooms WHERE bedType = "King" OR bedType = "Queen";
What are the names of rooms that have either king or queen bed?
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms that have either king or queen bed?` to a syntactically-correct PostgreSQL query.
SELECT roomName FROM Rooms WHERE bedType = "King" OR bedType = "Queen";
How many different types of beds are there?
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 types of beds are there?` to a syntactically-correct PostgreSQL query.
SELECT count(DISTINCT bedType) FROM Rooms;
Find the number of distinct bed types available in this inn.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 distinct bed types available in this inn.` to a syntactically-correct PostgreSQL query.
SELECT count(DISTINCT bedType) FROM Rooms;
Find the name and id of the top 3 expensive rooms.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 id of the top 3 expensive rooms.` to a syntactically-correct PostgreSQL query.
SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3;
What are the name and id of the three highest priced rooms?
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 and id of the three highest priced rooms?` to a syntactically-correct PostgreSQL query.
SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3;
Find the name of rooms whose price is higher than the average price.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms whose price is higher than the average price.` to a syntactically-correct PostgreSQL query.
SELECT roomName FROM Rooms WHERE basePrice > ( SELECT avg(basePrice) FROM Rooms );
What are the name of rooms that cost more than the average.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms that cost more than the average.` to a syntactically-correct PostgreSQL query.
SELECT roomName FROM Rooms WHERE basePrice > ( SELECT avg(basePrice) FROM Rooms );
Find the number of rooms that do not have any reservation.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms that do not have any reservation.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM rooms WHERE roomid NOT IN (SELECT DISTINCT room FROM reservations)
How many rooms have not had any reservation yet?
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms have not had any reservation yet?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM rooms WHERE roomid NOT IN (SELECT DISTINCT room FROM reservations)
Return the name and number of reservations made for each of the rooms.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 `Return the name and number of reservations made for each of the rooms.` to a syntactically-correct PostgreSQL query.
SELECT T2.roomName , count(*) , T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room
For each room, find its name and the number of times reservations were made for it.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 room, find its name and the number of times reservations were made for it.` to a syntactically-correct PostgreSQL query.
SELECT T2.roomName , count(*) , T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room
Find the names of rooms that have been reserved for more than 60 times.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 names of rooms that have been reserved for more than 60 times.` to a syntactically-correct PostgreSQL query.
SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room HAVING count(*) > 60
What are the names of rooms whose reservation frequency exceeds 60 times?
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms whose reservation frequency exceeds 60 times?` to a syntactically-correct PostgreSQL query.
SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room HAVING count(*) > 60
Find the name of rooms whose base price is between 120 and 150.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms whose base price is between 120 and 150.` to a syntactically-correct PostgreSQL query.
SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150
Which rooms cost between 120 and 150? Give me the room names.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms cost between 120 and 150? Give me the room names.` to a syntactically-correct PostgreSQL query.
SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150
Find the name of rooms booked by some customers whose first name contains ROY.
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms booked by some customers whose first name contains ROY.` to a syntactically-correct PostgreSQL query.
SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname LIKE '%ROY%'
What are the name of rooms booked by customers whose first name has "ROY" in part?
-- Language PostgreSQL -- Tables: -- Table: rooms columns : [['room id', 'text'], ['room name', 'text'], ['beds', 'number'], ['bed type', 'text'], ['max occupancy', 'number'], ['base price', 'number'], ['decor', 'text']] -- Table: reservations columns : [['code', 'number'], ['room', 'text'], ['check in', 'text'], ['check out', 'text'], ['rate', 'number'], ['last name', 'text'], ['first name', 'text'], ['adults', 'number'], ['kids', '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 rooms booked by customers whose first name has "ROY" in part?` to a syntactically-correct PostgreSQL query.
SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname LIKE '%ROY%'
what are the details of the cmi masters that have the cross reference code 'Tax'?
-- Language PostgreSQL -- Tables: -- Table: customer master index columns : [['master customer id', 'number'], ['cmi details', 'text']] -- Table: cmi cross references columns : [['cmi cross reference id', 'number'], ['master customer id', 'number'], ['source system code', 'text']] -- Table: council tax columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: business rates columns : [['business rates id', 'number'], ['cmi cross reference id', 'number']] -- Table: benefits overpayments columns : [['council tax id', 'number'], ['cmi cross ref id', 'number']] -- Table: parking fines columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: rent arrears columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: electoral register columns : [['electoral register id', 'number'], ['cmi cross reference 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 details of the cmi masters that have the cross reference code 'Tax'?` to a syntactically-correct PostgreSQL query.
SELECT T1.cmi_details FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T2.source_system_code = 'Tax'
What is the cmi cross reference id that is related to at least one council tax entry? List the cross reference id and source system code.
-- Language PostgreSQL -- Tables: -- Table: customer master index columns : [['master customer id', 'number'], ['cmi details', 'text']] -- Table: cmi cross references columns : [['cmi cross reference id', 'number'], ['master customer id', 'number'], ['source system code', 'text']] -- Table: council tax columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: business rates columns : [['business rates id', 'number'], ['cmi cross reference id', 'number']] -- Table: benefits overpayments columns : [['council tax id', 'number'], ['cmi cross ref id', 'number']] -- Table: parking fines columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: rent arrears columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: electoral register columns : [['electoral register id', 'number'], ['cmi cross reference 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 cmi cross reference id that is related to at least one council tax entry? List the cross reference id and source system code.` to a syntactically-correct PostgreSQL query.
SELECT T1.cmi_cross_ref_id , T1.source_system_code FROM CMI_Cross_References AS T1 JOIN Council_Tax AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T1.cmi_cross_ref_id HAVING count(*) >= 1
How many business rates are related to each cmi cross reference? List cross reference id, master customer id and the n
-- Language PostgreSQL -- Tables: -- Table: customer master index columns : [['master customer id', 'number'], ['cmi details', 'text']] -- Table: cmi cross references columns : [['cmi cross reference id', 'number'], ['master customer id', 'number'], ['source system code', 'text']] -- Table: council tax columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: business rates columns : [['business rates id', 'number'], ['cmi cross reference id', 'number']] -- Table: benefits overpayments columns : [['council tax id', 'number'], ['cmi cross ref id', 'number']] -- Table: parking fines columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: rent arrears columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: electoral register columns : [['electoral register id', 'number'], ['cmi cross reference 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 business rates are related to each cmi cross reference? List cross reference id, master customer id and the n` to a syntactically-correct PostgreSQL query.
SELECT T2.cmi_cross_ref_id , T2.master_customer_id , count(*) FROM Business_Rates AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T2.cmi_cross_ref_id
What is the tax source system code related to the benefits and overpayments? List the code and the benifit id, order by benifit id.
-- Language PostgreSQL -- Tables: -- Table: customer master index columns : [['master customer id', 'number'], ['cmi details', 'text']] -- Table: cmi cross references columns : [['cmi cross reference id', 'number'], ['master customer id', 'number'], ['source system code', 'text']] -- Table: council tax columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: business rates columns : [['business rates id', 'number'], ['cmi cross reference id', 'number']] -- Table: benefits overpayments columns : [['council tax id', 'number'], ['cmi cross ref id', 'number']] -- Table: parking fines columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: rent arrears columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: electoral register columns : [['electoral register id', 'number'], ['cmi cross reference 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 tax source system code related to the benefits and overpayments? List the code and the benifit id, order by benifit id.` to a syntactically-correct PostgreSQL query.
SELECT T1.source_system_code , T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Benefits_Overpayments AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id ORDER BY T2.council_tax_id
Wat is the tax source system code and master customer id of the taxes related to each parking fine id?
-- Language PostgreSQL -- Tables: -- Table: customer master index columns : [['master customer id', 'number'], ['cmi details', 'text']] -- Table: cmi cross references columns : [['cmi cross reference id', 'number'], ['master customer id', 'number'], ['source system code', 'text']] -- Table: council tax columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: business rates columns : [['business rates id', 'number'], ['cmi cross reference id', 'number']] -- Table: benefits overpayments columns : [['council tax id', 'number'], ['cmi cross ref id', 'number']] -- Table: parking fines columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: rent arrears columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: electoral register columns : [['electoral register id', 'number'], ['cmi cross reference 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 `Wat is the tax source system code and master customer id of the taxes related to each parking fine id?` to a syntactically-correct PostgreSQL query.
SELECT T1.source_system_code , T1.master_customer_id , T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Parking_Fines AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id
What are the renting arrears tax ids related to the customer master index whose detail is not 'Schmidt, Kertzmann and Lubowitz'?
-- Language PostgreSQL -- Tables: -- Table: customer master index columns : [['master customer id', 'number'], ['cmi details', 'text']] -- Table: cmi cross references columns : [['cmi cross reference id', 'number'], ['master customer id', 'number'], ['source system code', 'text']] -- Table: council tax columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: business rates columns : [['business rates id', 'number'], ['cmi cross reference id', 'number']] -- Table: benefits overpayments columns : [['council tax id', 'number'], ['cmi cross ref id', 'number']] -- Table: parking fines columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: rent arrears columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: electoral register columns : [['electoral register id', 'number'], ['cmi cross reference 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 renting arrears tax ids related to the customer master index whose detail is not 'Schmidt, Kertzmann and Lubowitz'?` to a syntactically-correct PostgreSQL query.
SELECT T1.council_tax_id FROM Rent_Arrears AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id JOIN Customer_Master_Index AS T3 ON T3.master_customer_id = T2.master_customer_id WHERE T3.cmi_details != 'Schmidt , Kertzmann and Lubowitz'
What are the register ids of electoral registries that have the cross reference source system code 'Electoral' or 'Tax'?
-- Language PostgreSQL -- Tables: -- Table: customer master index columns : [['master customer id', 'number'], ['cmi details', 'text']] -- Table: cmi cross references columns : [['cmi cross reference id', 'number'], ['master customer id', 'number'], ['source system code', 'text']] -- Table: council tax columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: business rates columns : [['business rates id', 'number'], ['cmi cross reference id', 'number']] -- Table: benefits overpayments columns : [['council tax id', 'number'], ['cmi cross ref id', 'number']] -- Table: parking fines columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: rent arrears columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: electoral register columns : [['electoral register id', 'number'], ['cmi cross reference 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 register ids of electoral registries that have the cross reference source system code 'Electoral' or 'Tax'?` to a syntactically-correct PostgreSQL query.
SELECT T1.electoral_register_id FROM Electoral_Register AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id WHERE T2.source_system_code = 'Electoral' OR T2.source_system_code = 'Tax'
How many different source system code for the cmi cross references are there?
-- Language PostgreSQL -- Tables: -- Table: customer master index columns : [['master customer id', 'number'], ['cmi details', 'text']] -- Table: cmi cross references columns : [['cmi cross reference id', 'number'], ['master customer id', 'number'], ['source system code', 'text']] -- Table: council tax columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: business rates columns : [['business rates id', 'number'], ['cmi cross reference id', 'number']] -- Table: benefits overpayments columns : [['council tax id', 'number'], ['cmi cross ref id', 'number']] -- Table: parking fines columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: rent arrears columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: electoral register columns : [['electoral register id', 'number'], ['cmi cross reference 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 source system code for the cmi cross references are there?` to a syntactically-correct PostgreSQL query.
SELECT count(DISTINCT source_system_code) FROM CMI_cross_references
List all information about customer master index, and sort them by details in descending order.
-- Language PostgreSQL -- Tables: -- Table: customer master index columns : [['master customer id', 'number'], ['cmi details', 'text']] -- Table: cmi cross references columns : [['cmi cross reference id', 'number'], ['master customer id', 'number'], ['source system code', 'text']] -- Table: council tax columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: business rates columns : [['business rates id', 'number'], ['cmi cross reference id', 'number']] -- Table: benefits overpayments columns : [['council tax id', 'number'], ['cmi cross ref id', 'number']] -- Table: parking fines columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: rent arrears columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: electoral register columns : [['electoral register id', 'number'], ['cmi cross reference 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 information about customer master index, and sort them by details in descending order.` to a syntactically-correct PostgreSQL query.
SELECT * FROM customer_master_index ORDER BY cmi_details DESC
List the council tax ids and their related cmi cross references of all the parking fines.
-- Language PostgreSQL -- Tables: -- Table: customer master index columns : [['master customer id', 'number'], ['cmi details', 'text']] -- Table: cmi cross references columns : [['cmi cross reference id', 'number'], ['master customer id', 'number'], ['source system code', 'text']] -- Table: council tax columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: business rates columns : [['business rates id', 'number'], ['cmi cross reference id', 'number']] -- Table: benefits overpayments columns : [['council tax id', 'number'], ['cmi cross ref id', 'number']] -- Table: parking fines columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: rent arrears columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: electoral register columns : [['electoral register id', 'number'], ['cmi cross reference 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 council tax ids and their related cmi cross references of all the parking fines.` to a syntactically-correct PostgreSQL query.
SELECT council_tax_id , cmi_cross_ref_id FROM parking_fines
How many council taxes are collected for renting arrears ?
-- Language PostgreSQL -- Tables: -- Table: customer master index columns : [['master customer id', 'number'], ['cmi details', 'text']] -- Table: cmi cross references columns : [['cmi cross reference id', 'number'], ['master customer id', 'number'], ['source system code', 'text']] -- Table: council tax columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: business rates columns : [['business rates id', 'number'], ['cmi cross reference id', 'number']] -- Table: benefits overpayments columns : [['council tax id', 'number'], ['cmi cross ref id', 'number']] -- Table: parking fines columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: rent arrears columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: electoral register columns : [['electoral register id', 'number'], ['cmi cross reference 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 council taxes are collected for renting arrears ?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM rent_arrears
What are the distinct cross reference source system codes which are related to the master customer details 'Gottlieb, Becker and Wyman'?
-- Language PostgreSQL -- Tables: -- Table: customer master index columns : [['master customer id', 'number'], ['cmi details', 'text']] -- Table: cmi cross references columns : [['cmi cross reference id', 'number'], ['master customer id', 'number'], ['source system code', 'text']] -- Table: council tax columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: business rates columns : [['business rates id', 'number'], ['cmi cross reference id', 'number']] -- Table: benefits overpayments columns : [['council tax id', 'number'], ['cmi cross ref id', 'number']] -- Table: parking fines columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: rent arrears columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: electoral register columns : [['electoral register id', 'number'], ['cmi cross reference 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 distinct cross reference source system codes which are related to the master customer details 'Gottlieb, Becker and Wyman'?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T2.source_system_code FROM customer_master_index AS T1 JOIN cmi_cross_references AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T1.cmi_details = 'Gottlieb , Becker and Wyman'
Which cmi cross reference id is not related to any parking taxes?
-- Language PostgreSQL -- Tables: -- Table: customer master index columns : [['master customer id', 'number'], ['cmi details', 'text']] -- Table: cmi cross references columns : [['cmi cross reference id', 'number'], ['master customer id', 'number'], ['source system code', 'text']] -- Table: council tax columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: business rates columns : [['business rates id', 'number'], ['cmi cross reference id', 'number']] -- Table: benefits overpayments columns : [['council tax id', 'number'], ['cmi cross ref id', 'number']] -- Table: parking fines columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: rent arrears columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: electoral register columns : [['electoral register id', 'number'], ['cmi cross reference 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 cmi cross reference id is not related to any parking taxes?` to a syntactically-correct PostgreSQL query.
SELECT cmi_cross_ref_id FROM cmi_cross_references EXCEPT SELECT cmi_cross_ref_id FROM parking_fines
Which distinct source system code includes the substring 'en'?
-- Language PostgreSQL -- Tables: -- Table: customer master index columns : [['master customer id', 'number'], ['cmi details', 'text']] -- Table: cmi cross references columns : [['cmi cross reference id', 'number'], ['master customer id', 'number'], ['source system code', 'text']] -- Table: council tax columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: business rates columns : [['business rates id', 'number'], ['cmi cross reference id', 'number']] -- Table: benefits overpayments columns : [['council tax id', 'number'], ['cmi cross ref id', 'number']] -- Table: parking fines columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: rent arrears columns : [['council tax id', 'number'], ['cmi cross reference id', 'number']] -- Table: electoral register columns : [['electoral register id', 'number'], ['cmi cross reference 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 distinct source system code includes the substring 'en'?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT source_system_code FROM cmi_cross_references WHERE source_system_code LIKE '%en%'
How many parties are there?
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 parties are there?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM party
Count the number of parties.
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 parties.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM party
List the themes of parties in ascending order of number of hosts.
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 themes of parties in ascending order of number of hosts.` to a syntactically-correct PostgreSQL query.
SELECT Party_Theme FROM party ORDER BY Number_of_hosts ASC
What are the themes of parties ordered by the number of hosts in ascending manner?
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 themes of parties ordered by the number of hosts in ascending manner?` to a syntactically-correct PostgreSQL query.
SELECT Party_Theme FROM party ORDER BY Number_of_hosts ASC
What are the themes and locations of parties?
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 themes and locations of parties?` to a syntactically-correct PostgreSQL query.
SELECT Party_Theme , LOCATION FROM party
Give me the theme and location of each party.
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 `Give me the theme and location of each party.` to a syntactically-correct PostgreSQL query.
SELECT Party_Theme , LOCATION FROM party
Show the first year and last year of parties with theme "Spring" or "Teqnology".
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 first year and last year of parties with theme "Spring" or "Teqnology".` to a syntactically-correct PostgreSQL query.
SELECT First_year , Last_year FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology"
What are the first year and last year of the parties whose theme is "Spring" or "Teqnology"?
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 year and last year of the parties whose theme is "Spring" or "Teqnology"?` to a syntactically-correct PostgreSQL query.
SELECT First_year , Last_year FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology"
What is the average number of hosts for parties?
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 hosts for parties?` to a syntactically-correct PostgreSQL query.
SELECT avg(Number_of_hosts) FROM party
Compute the average number of hosts for parties.
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 `Compute the average number of hosts for parties.` to a syntactically-correct PostgreSQL query.
SELECT avg(Number_of_hosts) FROM party
What is the location of the party with the most hosts?
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 of the party with the most hosts?` to a syntactically-correct PostgreSQL query.
SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1
Which party had the most hosts? Give me the party location.
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 party had the most hosts? Give me the party location.` to a syntactically-correct PostgreSQL query.
SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1
Show different nationalities along with the number of hosts of each nationality.
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 nationalities along with the number of hosts of each nationality.` to a syntactically-correct PostgreSQL query.
SELECT Nationality , COUNT(*) FROM HOST GROUP BY Nationality
How many hosts does each nationality have? List the nationality and the count.
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 hosts does each nationality have? List the nationality and the count.` to a syntactically-correct PostgreSQL query.
SELECT Nationality , COUNT(*) FROM HOST GROUP BY Nationality
Show the most common nationality of hosts.
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 most common nationality of hosts.` to a syntactically-correct PostgreSQL query.
SELECT Nationality FROM HOST GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1
Which nationality has the most hosts?
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 nationality has the most hosts?` to a syntactically-correct PostgreSQL query.
SELECT Nationality FROM HOST GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1
Show the nations that have both hosts older than 45 and hosts younger than 35.
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 nations that have both hosts older than 45 and hosts younger than 35.` to a syntactically-correct PostgreSQL query.
SELECT Nationality FROM HOST WHERE Age > 45 INTERSECT SELECT Nationality FROM HOST WHERE Age < 35
Which nations have both hosts of age above 45 and hosts of age below 35?
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 nations have both hosts of age above 45 and hosts of age below 35?` to a syntactically-correct PostgreSQL query.
SELECT Nationality FROM HOST WHERE Age > 45 INTERSECT SELECT Nationality FROM HOST WHERE Age < 35
Show the themes of parties and the names of the party hosts.
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 themes of parties and the names of the party hosts.` to a syntactically-correct PostgreSQL query.
SELECT T3.Party_Theme , T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID
For each party, return its theme and the name of its host.
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 party, return its theme and the name of its host.` to a syntactically-correct PostgreSQL query.
SELECT T3.Party_Theme , T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID
Show the locations of parties and the names of the party hosts in ascending order of the age of the host.
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 parties and the names of the party hosts in ascending order of the age of the host.` to a syntactically-correct PostgreSQL query.
SELECT T3.Location , T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID ORDER BY T2.Age
For each party, find its location and the name of its host. Sort the result in ascending order of the age of the host.
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 party, find its location and the name of its host. Sort the result in ascending order of the age of the host.` to a syntactically-correct PostgreSQL query.
SELECT T3.Location , T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID ORDER BY T2.Age
Show the locations of parties with hosts older than 50.
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 parties with hosts older than 50.` to a syntactically-correct PostgreSQL query.
SELECT T3.Location FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T2.Age > 50
Which parties have hosts of age above 50? Give me the party locations.
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 parties have hosts of age above 50? Give me the party locations.` to a syntactically-correct PostgreSQL query.
SELECT T3.Location FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T2.Age > 50
Show the host names for parties with number of hosts greater than 20.
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 host names for parties with number of hosts greater than 20.` to a syntactically-correct PostgreSQL query.
SELECT T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T3.Number_of_hosts > 20
Which parties have more than 20 hosts? Give me the host names for these parties.
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 parties have more than 20 hosts? Give me the host names for these parties.` to a syntactically-correct PostgreSQL query.
SELECT T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T3.Number_of_hosts > 20
Show the name and the nationality of the oldest host.
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 and the nationality of the oldest host.` to a syntactically-correct PostgreSQL query.
SELECT Name , Nationality FROM HOST ORDER BY Age DESC LIMIT 1
What are the name and the nationality of the host of the highest age?
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 and the nationality of the host of the highest age?` to a syntactically-correct PostgreSQL query.
SELECT Name , Nationality FROM HOST ORDER BY Age DESC LIMIT 1
List the names of hosts who did not serve as a host of any party in our record.
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 hosts who did not serve as a host of any party in our record.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM HOST WHERE Host_ID NOT IN (SELECT Host_ID FROM party_host)
What are the names of hosts who did not host any party in our record?
-- Language PostgreSQL -- Tables: -- Table: party columns : [['party id', 'number'], ['party theme', 'text'], ['location', 'text'], ['first year', 'text'], ['last year', 'text'], ['number of hosts', 'number']] -- Table: host columns : [['host id', 'number'], ['name', 'text'], ['nationality', 'text'], ['age', 'text']] -- Table: party host columns : [['party id', 'number'], ['host id', 'number'], ['is main in charge', 'others']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the 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 hosts who did not host any party in our record?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM HOST WHERE Host_ID NOT IN (SELECT Host_ID FROM party_host)
How many regions do we have?
-- Language PostgreSQL -- Tables: -- Table: storm columns : [['storm id', 'number'], ['name', 'text'], ['dates active', 'text'], ['max speed', 'number'], ['damage millions usd', 'number'], ['number deaths', 'number']] -- Table: region columns : [['region id', 'number'], ['region code', 'text'], ['region name', 'text']] -- Table: affected region columns : [['region id', 'number'], ['storm id', 'number'], ['number city affected', '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 regions do we have?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM region
Count the number of regions.
-- Language PostgreSQL -- Tables: -- Table: storm columns : [['storm id', 'number'], ['name', 'text'], ['dates active', 'text'], ['max speed', 'number'], ['damage millions usd', 'number'], ['number deaths', 'number']] -- Table: region columns : [['region id', 'number'], ['region code', 'text'], ['region name', 'text']] -- Table: affected region columns : [['region id', 'number'], ['storm id', 'number'], ['number city affected', '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 regions.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM region
Show all region code and region name sorted by the codes.
-- Language PostgreSQL -- Tables: -- Table: storm columns : [['storm id', 'number'], ['name', 'text'], ['dates active', 'text'], ['max speed', 'number'], ['damage millions usd', 'number'], ['number deaths', 'number']] -- Table: region columns : [['region id', 'number'], ['region code', 'text'], ['region name', 'text']] -- Table: affected region columns : [['region id', 'number'], ['storm id', 'number'], ['number city affected', '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 region code and region name sorted by the codes.` to a syntactically-correct PostgreSQL query.
SELECT region_code , region_name FROM region ORDER BY region_code
What are the codes and names for all regions, sorted by codes?
-- Language PostgreSQL -- Tables: -- Table: storm columns : [['storm id', 'number'], ['name', 'text'], ['dates active', 'text'], ['max speed', 'number'], ['damage millions usd', 'number'], ['number deaths', 'number']] -- Table: region columns : [['region id', 'number'], ['region code', 'text'], ['region name', 'text']] -- Table: affected region columns : [['region id', 'number'], ['storm id', 'number'], ['number city affected', '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 codes and names for all regions, sorted by codes?` to a syntactically-correct PostgreSQL query.
SELECT region_code , region_name FROM region ORDER BY region_code
List all region names in alphabetical order.
-- Language PostgreSQL -- Tables: -- Table: storm columns : [['storm id', 'number'], ['name', 'text'], ['dates active', 'text'], ['max speed', 'number'], ['damage millions usd', 'number'], ['number deaths', 'number']] -- Table: region columns : [['region id', 'number'], ['region code', 'text'], ['region name', 'text']] -- Table: affected region columns : [['region id', 'number'], ['storm id', 'number'], ['number city affected', '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 region names in alphabetical order.` to a syntactically-correct PostgreSQL query.
SELECT region_name FROM region ORDER BY region_name
What are the names of the regions in alphabetical order?
-- Language PostgreSQL -- Tables: -- Table: storm columns : [['storm id', 'number'], ['name', 'text'], ['dates active', 'text'], ['max speed', 'number'], ['damage millions usd', 'number'], ['number deaths', 'number']] -- Table: region columns : [['region id', 'number'], ['region code', 'text'], ['region name', 'text']] -- Table: affected region columns : [['region id', 'number'], ['storm id', 'number'], ['number city affected', '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 regions in alphabetical order?` to a syntactically-correct PostgreSQL query.
SELECT region_name FROM region ORDER BY region_name
Show names for all regions except for Denmark.
-- Language PostgreSQL -- Tables: -- Table: storm columns : [['storm id', 'number'], ['name', 'text'], ['dates active', 'text'], ['max speed', 'number'], ['damage millions usd', 'number'], ['number deaths', 'number']] -- Table: region columns : [['region id', 'number'], ['region code', 'text'], ['region name', 'text']] -- Table: affected region columns : [['region id', 'number'], ['storm id', 'number'], ['number city affected', '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 for all regions except for Denmark.` to a syntactically-correct PostgreSQL query.
SELECT region_name FROM region WHERE region_name != 'Denmark'
Return the names of all regions other than Denmark.
-- Language PostgreSQL -- Tables: -- Table: storm columns : [['storm id', 'number'], ['name', 'text'], ['dates active', 'text'], ['max speed', 'number'], ['damage millions usd', 'number'], ['number deaths', 'number']] -- Table: region columns : [['region id', 'number'], ['region code', 'text'], ['region name', 'text']] -- Table: affected region columns : [['region id', 'number'], ['storm id', 'number'], ['number city affected', '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 `Return the names of all regions other than Denmark.` to a syntactically-correct PostgreSQL query.
SELECT region_name FROM region WHERE region_name != 'Denmark'
How many storms had death records?
-- Language PostgreSQL -- Tables: -- Table: storm columns : [['storm id', 'number'], ['name', 'text'], ['dates active', 'text'], ['max speed', 'number'], ['damage millions usd', 'number'], ['number deaths', 'number']] -- Table: region columns : [['region id', 'number'], ['region code', 'text'], ['region name', 'text']] -- Table: affected region columns : [['region id', 'number'], ['storm id', 'number'], ['number city affected', '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 storms had death records?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM storm WHERE Number_Deaths > 0
Count the number of storms in which at least 1 person died.
-- Language PostgreSQL -- Tables: -- Table: storm columns : [['storm id', 'number'], ['name', 'text'], ['dates active', 'text'], ['max speed', 'number'], ['damage millions usd', 'number'], ['number deaths', 'number']] -- Table: region columns : [['region id', 'number'], ['region code', 'text'], ['region name', 'text']] -- Table: affected region columns : [['region id', 'number'], ['storm id', 'number'], ['number city affected', '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 storms in which at least 1 person died.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM storm WHERE Number_Deaths > 0