sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: county public safety 
columns : [['county id', 'number'], ['name', 'text'], ['population', 'number'], ['police officers', 'number'], ['residents per officer', 'number'], ['case burden', 'number'], ['crime rate', 'number'], ['police force', 'text'], ['location', 'text']]

 -- Table: city 
columns : [['city id', 'number'], ['county id', 'number'], ['name', 'text'], ['white', 'number'], ['black', 'number'], ['amerindian', 'number'], ['asian', 'number'], ['multiracial', 'number'], ['hispanic', 'number']]

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



Question: How many counties correspond to each police force?
SQL: SELECT Police_force ,  COUNT(*) FROM county_public_safety GROUP BY Police_force
-- Language PostgreSQL
        -- Tables: 
             -- Table: county public safety 
columns : [['county id', 'number'], ['name', 'text'], ['population', 'number'], ['police officers', 'number'], ['residents per officer', 'number'], ['case burden', 'number'], ['crime rate', 'number'], ['police force', 'text'], ['location', 'text']]

 -- Table: city 
columns : [['city id', 'number'], ['county id', 'number'], ['name', 'text'], ['white', 'number'], ['black', 'number'], ['amerindian', 'number'], ['asian', 'number'], ['multiracial', 'number'], ['hispanic', 'number']]

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



Question: What is the location shared by most counties?
SQL: SELECT LOCATION FROM county_public_safety GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: county public safety 
columns : [['county id', 'number'], ['name', 'text'], ['population', 'number'], ['police officers', 'number'], ['residents per officer', 'number'], ['case burden', 'number'], ['crime rate', 'number'], ['police force', 'text'], ['location', 'text']]

 -- Table: city 
columns : [['city id', 'number'], ['county id', 'number'], ['name', 'text'], ['white', 'number'], ['black', 'number'], ['amerindian', 'number'], ['asian', 'number'], ['multiracial', 'number'], ['hispanic', 'number']]

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



Question: Which location has the most corresponding counties?
SQL: SELECT LOCATION FROM county_public_safety GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: county public safety 
columns : [['county id', 'number'], ['name', 'text'], ['population', 'number'], ['police officers', 'number'], ['residents per officer', 'number'], ['case burden', 'number'], ['crime rate', 'number'], ['police force', 'text'], ['location', 'text']]

 -- Table: city 
columns : [['city id', 'number'], ['county id', 'number'], ['name', 'text'], ['white', 'number'], ['black', 'number'], ['amerindian', 'number'], ['asian', 'number'], ['multiracial', 'number'], ['hispanic', 'number']]

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



Question: List the names of counties that do not have any cities.
SQL: SELECT Name FROM county_public_safety WHERE County_ID NOT IN (SELECT County_ID FROM city)
-- Language PostgreSQL
        -- Tables: 
             -- Table: county public safety 
columns : [['county id', 'number'], ['name', 'text'], ['population', 'number'], ['police officers', 'number'], ['residents per officer', 'number'], ['case burden', 'number'], ['crime rate', 'number'], ['police force', 'text'], ['location', 'text']]

 -- Table: city 
columns : [['city id', 'number'], ['county id', 'number'], ['name', 'text'], ['white', 'number'], ['black', 'number'], ['amerindian', 'number'], ['asian', 'number'], ['multiracial', 'number'], ['hispanic', 'number']]

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



Question: What are the names of counties that do not contain any cities?
SQL: SELECT Name FROM county_public_safety WHERE County_ID NOT IN (SELECT County_ID FROM city)
-- Language PostgreSQL
        -- Tables: 
             -- Table: county public safety 
columns : [['county id', 'number'], ['name', 'text'], ['population', 'number'], ['police officers', 'number'], ['residents per officer', 'number'], ['case burden', 'number'], ['crime rate', 'number'], ['police force', 'text'], ['location', 'text']]

 -- Table: city 
columns : [['city id', 'number'], ['county id', 'number'], ['name', 'text'], ['white', 'number'], ['black', 'number'], ['amerindian', 'number'], ['asian', 'number'], ['multiracial', 'number'], ['hispanic', 'number']]

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



Question: Show the police force shared by counties with location on the east and west.
SQL: SELECT Police_force FROM county_public_safety WHERE LOCATION  =  "East" INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION  =  "West"
-- Language PostgreSQL
        -- Tables: 
             -- Table: county public safety 
columns : [['county id', 'number'], ['name', 'text'], ['population', 'number'], ['police officers', 'number'], ['residents per officer', 'number'], ['case burden', 'number'], ['crime rate', 'number'], ['police force', 'text'], ['location', 'text']]

 -- Table: city 
columns : [['city id', 'number'], ['county id', 'number'], ['name', 'text'], ['white', 'number'], ['black', 'number'], ['amerindian', 'number'], ['asian', 'number'], ['multiracial', 'number'], ['hispanic', 'number']]

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



Question: Which police forces operate in both counties that are located in the East and in the West?
SQL: SELECT Police_force FROM county_public_safety WHERE LOCATION  =  "East" INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION  =  "West"
-- Language PostgreSQL
        -- Tables: 
             -- Table: county public safety 
columns : [['county id', 'number'], ['name', 'text'], ['population', 'number'], ['police officers', 'number'], ['residents per officer', 'number'], ['case burden', 'number'], ['crime rate', 'number'], ['police force', 'text'], ['location', 'text']]

 -- Table: city 
columns : [['city id', 'number'], ['county id', 'number'], ['name', 'text'], ['white', 'number'], ['black', 'number'], ['amerindian', 'number'], ['asian', 'number'], ['multiracial', 'number'], ['hispanic', 'number']]

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



Question: Show the names of cities in counties that have a crime rate less than 100.
SQL: SELECT name FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE Crime_rate  <  100)
-- Language PostgreSQL
        -- Tables: 
             -- Table: county public safety 
columns : [['county id', 'number'], ['name', 'text'], ['population', 'number'], ['police officers', 'number'], ['residents per officer', 'number'], ['case burden', 'number'], ['crime rate', 'number'], ['police force', 'text'], ['location', 'text']]

 -- Table: city 
columns : [['city id', 'number'], ['county id', 'number'], ['name', 'text'], ['white', 'number'], ['black', 'number'], ['amerindian', 'number'], ['asian', 'number'], ['multiracial', 'number'], ['hispanic', 'number']]

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



Question: What are the names of cities that are in counties that have a crime rate below 100?
SQL: SELECT name FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE Crime_rate  <  100)
-- Language PostgreSQL
        -- Tables: 
             -- Table: county public safety 
columns : [['county id', 'number'], ['name', 'text'], ['population', 'number'], ['police officers', 'number'], ['residents per officer', 'number'], ['case burden', 'number'], ['crime rate', 'number'], ['police force', 'text'], ['location', 'text']]

 -- Table: city 
columns : [['city id', 'number'], ['county id', 'number'], ['name', 'text'], ['white', 'number'], ['black', 'number'], ['amerindian', 'number'], ['asian', 'number'], ['multiracial', 'number'], ['hispanic', 'number']]

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



Question: Show the case burden of counties in descending order of population.
SQL: SELECT Case_burden FROM county_public_safety ORDER BY Population DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: county public safety 
columns : [['county id', 'number'], ['name', 'text'], ['population', 'number'], ['police officers', 'number'], ['residents per officer', 'number'], ['case burden', 'number'], ['crime rate', 'number'], ['police force', 'text'], ['location', 'text']]

 -- Table: city 
columns : [['city id', 'number'], ['county id', 'number'], ['name', 'text'], ['white', 'number'], ['black', 'number'], ['amerindian', 'number'], ['asian', 'number'], ['multiracial', 'number'], ['hispanic', 'number']]

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



Question: What are the case burdens of counties, ordered descending by population?
SQL: SELECT Case_burden FROM county_public_safety ORDER BY Population DESC
-- 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.



Question: Find the names of all modern rooms with a base price below $160 and two beds.
SQL: SELECT roomName FROM Rooms WHERE basePrice  <  160 AND beds =  2 AND decor  =  'modern';
-- 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.



Question: What are the names of modern rooms that have a base price lower than $160 and two beds.
SQL: SELECT roomName FROM Rooms WHERE basePrice  <  160 AND beds =  2 AND decor  =  'modern';
-- 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.



Question: Find all the rooms that have a price higher than 160 and can accommodate more than 2 people. Report room names and ids.
SQL: SELECT roomName ,  RoomId FROM Rooms WHERE basePrice  >  160 AND maxOccupancy  >  2;
-- 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.



Question: What are the room names and ids of all the rooms that cost more than 160 and can accommodate more than two people.
SQL: SELECT roomName ,  RoomId FROM Rooms WHERE basePrice  >  160 AND maxOccupancy  >  2;
-- 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.



Question: Find the most popular room in the hotel. The most popular room is the room that had seen the largest number of reservations.
SQL: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T1.Room ORDER BY count(*) DESC LIMIT 1;
-- 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.



Question: Which room has the largest number of reservations?
SQL: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T1.Room ORDER BY count(*) DESC LIMIT 1;
-- 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.



Question: How many kids stay in the rooms reserved by ROY SWEAZY?
SQL: SELECT kids FROM Reservations WHERE FirstName = "ROY" AND LastName  =  "SWEAZY";
-- 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.



Question: Find the number of kids staying in the rooms reserved by a person called ROY SWEAZ.
SQL: SELECT kids FROM Reservations WHERE FirstName = "ROY" AND LastName  =  "SWEAZY";
-- 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.



Question: How many times does ROY SWEAZY has reserved a room.
SQL: SELECT count(*) FROM Reservations WHERE FirstName = "ROY" AND LastName  =  "SWEAZY";
-- 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.



Question: Find the number of times ROY SWEAZY has reserved a room.
SQL: SELECT count(*) FROM Reservations WHERE FirstName = "ROY" AND LastName  =  "SWEAZY";
-- 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.



Question: Which room has the highest rate? List the room's full name, rate, check in and check out date.
SQL: SELECT T2.roomName ,  T1.Rate ,  T1.CheckIn ,  T1.CheckOut FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T1.Room ORDER BY T1.Rate DESC LIMIT 1;
-- 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.



Question: Return the name, rate, check in and check out date for the room with the highest rate.
SQL: SELECT T2.roomName ,  T1.Rate ,  T1.CheckIn ,  T1.CheckOut FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T1.Room ORDER BY T1.Rate DESC LIMIT 1;
-- 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.



Question: How many adults stay in the room CONRAD SELBIG checked in on Oct 23, 2010?
SQL: SELECT Adults FROM Reservations WHERE CheckIn  =  "2010-10-23" AND FirstName  =  "CONRAD" AND LastName  =  "SELBIG";
-- 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.



Question: Find the number of adults for the room reserved and checked in by CONRAD SELBIG on Oct 23, 2010.
SQL: SELECT Adults FROM Reservations WHERE CheckIn  =  "2010-10-23" AND FirstName  =  "CONRAD" AND LastName  =  "SELBIG";
-- 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.



Question: How many kids stay in the room DAMIEN TRACHSEL checked in on Sep 21, 2010?
SQL: SELECT Kids FROM Reservations WHERE CheckIn  =  "2010-09-21" AND FirstName  =  "DAMIEN" AND LastName  =  "TRACHSEL";
-- 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.



Question: Return the number of kids for the room reserved and checked in by DAMIEN TRACHSEL on  Sep 21, 2010.
SQL: SELECT Kids FROM Reservations WHERE CheckIn  =  "2010-09-21" AND FirstName  =  "DAMIEN" AND LastName  =  "TRACHSEL";
-- 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.



Question: How many king beds are there?
SQL: SELECT sum(beds) FROM Rooms WHERE bedtype  =  'King';
-- 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.



Question: Find the total number of king beds available.
SQL: SELECT sum(beds) FROM Rooms WHERE bedtype  =  'King';
-- 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.



Question: List the names and decor of rooms that have a king bed. Sort the list by their price.
SQL: SELECT roomName ,  decor FROM Rooms WHERE bedtype  =  'King' ORDER BY basePrice;
-- 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.



Question: What are the names and decor of rooms with a king bed? Sort them by their price
SQL: SELECT roomName ,  decor FROM Rooms WHERE bedtype  =  'King' ORDER BY basePrice;
-- 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.



Question: Which room has cheapest base price? List the room's name and the base price.
SQL: SELECT roomName ,  basePrice FROM Rooms ORDER BY basePrice ASC LIMIT 1;
-- 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.



Question: What are the room name and base price of the room with the lowest base price?
SQL: SELECT roomName ,  basePrice FROM Rooms ORDER BY basePrice ASC LIMIT 1;
-- 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.



Question: What is the decor of room Recluse and defiance?
SQL: SELECT decor FROM Rooms WHERE roomName  =  "Recluse and defiance";
-- 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.



Question: Return the decor of the room named "Recluse and defiance".
SQL: SELECT decor FROM Rooms WHERE roomName  =  "Recluse and defiance";
-- 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.



Question: What is the average base price of different bed type? List bed type and average base price.
SQL: SELECT bedType ,  avg(basePrice) FROM Rooms GROUP BY bedType;
-- 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.



Question: For each bed type, find the average base price of different bed type.
SQL: SELECT bedType ,  avg(basePrice) FROM Rooms GROUP BY bedType;
-- 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.



Question: What is the total number of people who could stay in the modern rooms in this inn?
SQL: SELECT sum(maxOccupancy) FROM Rooms WHERE decor  =  'modern';
-- 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.



Question: How many people in total can stay in the modern rooms of this inn?
SQL: SELECT sum(maxOccupancy) FROM Rooms WHERE decor  =  'modern';
-- 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.



Question: What kind of decor has the least number of reservations?
SQL: 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;
-- 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.



Question: What is the least popular kind of decor?
SQL: 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;
-- 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.



Question: 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.
SQL: SELECT count(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId WHERE T2.maxOccupancy  =  T1.Adults + T1.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.



Question: How many times the number of adults and kids staying in a room reached the maximum capacity of the room?
SQL: SELECT count(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId WHERE T2.maxOccupancy  =  T1.Adults + T1.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.



Question: Find the first and last names of people who payed more than the rooms' base prices.
SQL: SELECT T1.firstname ,  T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId WHERE T1.Rate - T2.basePrice  >  0
-- 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.



Question: What are the first and last names of people who payed more than the rooms' base prices?
SQL: SELECT T1.firstname ,  T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId WHERE T1.Rate - T2.basePrice  >  0
-- 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.



Question: How many rooms are there?
SQL: SELECT count(*) FROM 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.



Question: What is the total number of rooms available in this inn?
SQL: SELECT count(*) FROM 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.



Question: Find the number of rooms with a king bed.
SQL: SELECT count(*) FROM Rooms WHERE bedType  =  "King";
-- 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.



Question: How many rooms have a king bed?
SQL: SELECT count(*) FROM Rooms WHERE bedType  =  "King";