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