answer
stringlengths
18
557
context
stringlengths
27
489
question
stringlengths
12
244
text
stringlengths
275
1.7k
SELECT title FROM Movie WHERE director = "James Cameron" OR YEAR < 1980
CREATE TABLE Movie (title VARCHAR, director VARCHAR, YEAR VARCHAR)
What are names of the movies that are either made before 1980 or directed by James Cameron?
<s>[INST] Given the following SQL query and context: Query: SELECT title FROM Movie WHERE director = "James Cameron" OR YEAR < 1980 Context: CREATE TABLE Movie (title VARCHAR, director VARCHAR, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are names of the movies that are either made before 1980 or directed by James Cameron? The answer to your question is: SELECT title FROM Movie WHERE director = "James Cameron" OR YEAR < 1980. [/s>
SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 3 INTERSECT SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 4
CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (rID VARCHAR, stars VARCHAR)
What are the names of reviewers who had rated 3 star and 4 star?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 3 INTERSECT SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 4 Context: CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (rID VARCHAR, stars VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of reviewers who had rated 3 star and 4 star? The answer to your question is: SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 3 INTERSECT SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 4. [/s>
SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 3 INTERSECT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 4
CREATE TABLE Rating (mID VARCHAR, stars VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR)
What are the names of movies that get 3 star and 4 star?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 3 INTERSECT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 4 Context: CREATE TABLE Rating (mID VARCHAR, stars VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of movies that get 3 star and 4 star? The answer to your question is: SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 3 INTERSECT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 4. [/s>
SELECT COUNT(*) FROM county_public_safety
CREATE TABLE county_public_safety (Id VARCHAR)
How many counties are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM county_public_safety Context: CREATE TABLE county_public_safety (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many counties are there? The answer to your question is: SELECT COUNT(*) FROM county_public_safety. [/s>
SELECT Name FROM county_public_safety ORDER BY Population DESC
CREATE TABLE county_public_safety (Name VARCHAR, Population VARCHAR)
List the names of counties in descending order of population.
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM county_public_safety ORDER BY Population DESC Context: CREATE TABLE county_public_safety (Name VARCHAR, Population VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of counties in descending order of population. The answer to your question is: SELECT Name FROM county_public_safety ORDER BY Population DESC. [/s>
SELECT DISTINCT Police_force FROM county_public_safety WHERE LOCATION <> "East"
CREATE TABLE county_public_safety (Police_force VARCHAR, LOCATION VARCHAR)
List the distinct police forces of counties whose location is not on east side.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT Police_force FROM county_public_safety WHERE LOCATION <> "East" Context: CREATE TABLE county_public_safety (Police_force VARCHAR, LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the distinct police forces of counties whose location is not on east side. The answer to your question is: SELECT DISTINCT Police_force FROM county_public_safety WHERE LOCATION <> "East". [/s>
SELECT MIN(Crime_rate), MAX(Crime_rate) FROM county_public_safety
CREATE TABLE county_public_safety (Crime_rate INTEGER)
What are the minimum and maximum crime rate of counties?
<s>[INST] Given the following SQL query and context: Query: SELECT MIN(Crime_rate), MAX(Crime_rate) FROM county_public_safety Context: CREATE TABLE county_public_safety (Crime_rate INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the minimum and maximum crime rate of counties? The answer to your question is: SELECT MIN(Crime_rate), MAX(Crime_rate) FROM county_public_safety. [/s>
SELECT Crime_rate FROM county_public_safety ORDER BY Police_officers
CREATE TABLE county_public_safety (Crime_rate VARCHAR, Police_officers VARCHAR)
Show the crime rates of counties in ascending order of number of police officers.
<s>[INST] Given the following SQL query and context: Query: SELECT Crime_rate FROM county_public_safety ORDER BY Police_officers Context: CREATE TABLE county_public_safety (Crime_rate VARCHAR, Police_officers VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the crime rates of counties in ascending order of number of police officers. The answer to your question is: SELECT Crime_rate FROM county_public_safety ORDER BY Police_officers. [/s>
SELECT Name FROM city ORDER BY Name
CREATE TABLE city (Name VARCHAR)
What are the names of cities in ascending alphabetical order?
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM city ORDER BY Name Context: CREATE TABLE city (Name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of cities in ascending alphabetical order? The answer to your question is: SELECT Name FROM city ORDER BY Name. [/s>
SELECT Hispanic FROM city WHERE Black > 10
CREATE TABLE city (Hispanic VARCHAR, Black INTEGER)
What are the percentage of hispanics in cities with the black percentage higher than 10?
<s>[INST] Given the following SQL query and context: Query: SELECT Hispanic FROM city WHERE Black > 10 Context: CREATE TABLE city (Hispanic VARCHAR, Black INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the percentage of hispanics in cities with the black percentage higher than 10? The answer to your question is: SELECT Hispanic FROM city WHERE Black > 10. [/s>
SELECT Name FROM county_public_safety ORDER BY Population DESC LIMIT 1
CREATE TABLE county_public_safety (Name VARCHAR, Population VARCHAR)
List the name of the county with the largest population.
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM county_public_safety ORDER BY Population DESC LIMIT 1 Context: CREATE TABLE county_public_safety (Name VARCHAR, Population VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name of the county with the largest population. The answer to your question is: SELECT Name FROM county_public_safety ORDER BY Population DESC LIMIT 1. [/s>
SELECT Name FROM city ORDER BY White DESC LIMIT 5
CREATE TABLE city (Name VARCHAR, White VARCHAR)
List the names of the city with the top 5 white percentages.
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM city ORDER BY White DESC LIMIT 5 Context: CREATE TABLE city (Name VARCHAR, White VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of the city with the top 5 white percentages. The answer to your question is: SELECT Name FROM city ORDER BY White DESC LIMIT 5. [/s>
SELECT T1.Name, T2.Name FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID
CREATE TABLE city (Name VARCHAR, County_ID VARCHAR); CREATE TABLE county_public_safety (Name VARCHAR, County_ID VARCHAR)
Show names of cities and names of counties they are in.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Name, T2.Name FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID Context: CREATE TABLE city (Name VARCHAR, County_ID VARCHAR); CREATE TABLE county_public_safety (Name VARCHAR, County_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show names of cities and names of counties they are in. The answer to your question is: SELECT T1.Name, T2.Name FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID. [/s>
SELECT T1.White, T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID
CREATE TABLE city (White VARCHAR, County_ID VARCHAR); CREATE TABLE county_public_safety (Crime_rate VARCHAR, County_ID VARCHAR)
Show white percentages of cities and the crime rates of counties they are in.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.White, T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID Context: CREATE TABLE city (White VARCHAR, County_ID VARCHAR); CREATE TABLE county_public_safety (Crime_rate VARCHAR, County_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show white percentages of cities and the crime rates of counties they are in. The answer to your question is: SELECT T1.White, T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID. [/s>
SELECT name FROM city WHERE county_ID = (SELECT county_ID FROM county_public_safety ORDER BY Police_officers DESC LIMIT 1)
CREATE TABLE city (name VARCHAR, county_ID VARCHAR, Police_officers VARCHAR); CREATE TABLE county_public_safety (name VARCHAR, county_ID VARCHAR, Police_officers VARCHAR)
Show the name of cities in the county that has the largest number of police officers.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM city WHERE county_ID = (SELECT county_ID FROM county_public_safety ORDER BY Police_officers DESC LIMIT 1) Context: CREATE TABLE city (name VARCHAR, county_ID VARCHAR, Police_officers VARCHAR); CREATE TABLE county_public_safety (name VARCHAR, county_ID VARCHAR, Police_officers VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name of cities in the county that has the largest number of police officers. The answer to your question is: SELECT name FROM city WHERE county_ID = (SELECT county_ID FROM county_public_safety ORDER BY Police_officers DESC LIMIT 1). [/s>
SELECT COUNT(*) FROM city WHERE county_ID IN (SELECT county_ID FROM county_public_safety WHERE population > 20000)
CREATE TABLE county_public_safety (county_ID VARCHAR, population INTEGER); CREATE TABLE city (county_ID VARCHAR, population INTEGER)
Show the number of cities in counties that have a population more than 20000.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM city WHERE county_ID IN (SELECT county_ID FROM county_public_safety WHERE population > 20000) Context: CREATE TABLE county_public_safety (county_ID VARCHAR, population INTEGER); CREATE TABLE city (county_ID VARCHAR, population INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the number of cities in counties that have a population more than 20000. The answer to your question is: SELECT COUNT(*) FROM city WHERE county_ID IN (SELECT county_ID FROM county_public_safety WHERE population > 20000). [/s>
SELECT T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID WHERE T1.White > 90
CREATE TABLE county_public_safety (Crime_rate VARCHAR, County_ID VARCHAR); CREATE TABLE city (County_ID VARCHAR, White INTEGER)
Show the crime rate of counties with a city having white percentage more than 90.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID WHERE T1.White > 90 Context: CREATE TABLE county_public_safety (Crime_rate VARCHAR, County_ID VARCHAR); CREATE TABLE city (County_ID VARCHAR, White INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the crime rate of counties with a city having white percentage more than 90. The answer to your question is: SELECT T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID WHERE T1.White > 90. [/s>
SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force
CREATE TABLE county_public_safety (Police_force VARCHAR)
Please show the police forces and the number of counties with each police force.
<s>[INST] Given the following SQL query and context: Query: SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force Context: CREATE TABLE county_public_safety (Police_force VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Please show the police forces and the number of counties with each police force. The answer to your question is: SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force. [/s>
SELECT LOCATION FROM county_public_safety GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE county_public_safety (LOCATION VARCHAR)
What is the location shared by most counties?
<s>[INST] Given the following SQL query and context: Query: SELECT LOCATION FROM county_public_safety GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE county_public_safety (LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the location shared by most counties? The answer to your question is: SELECT LOCATION FROM county_public_safety GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT Name FROM county_public_safety WHERE NOT County_ID IN (SELECT County_ID FROM city)
CREATE TABLE city (Name VARCHAR, County_ID VARCHAR); CREATE TABLE county_public_safety (Name VARCHAR, County_ID VARCHAR)
List the names of counties that do not have any cities.
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM county_public_safety WHERE NOT County_ID IN (SELECT County_ID FROM city) Context: CREATE TABLE city (Name VARCHAR, County_ID VARCHAR); CREATE TABLE county_public_safety (Name VARCHAR, County_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of counties that do not have any cities. The answer to your question is: SELECT Name FROM county_public_safety WHERE NOT County_ID IN (SELECT County_ID FROM city). [/s>
SELECT Police_force FROM county_public_safety WHERE LOCATION = "East" INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION = "West"
CREATE TABLE county_public_safety (Police_force VARCHAR, LOCATION VARCHAR)
Show the police force shared by counties with location on the east and west.
<s>[INST] Given the following SQL query and context: Query: SELECT Police_force FROM county_public_safety WHERE LOCATION = "East" INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION = "West" Context: CREATE TABLE county_public_safety (Police_force VARCHAR, LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the police force shared by counties with location on the east and west. The answer to your question is: SELECT Police_force FROM county_public_safety WHERE LOCATION = "East" INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION = "West". [/s>
SELECT name FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE Crime_rate < 100)
CREATE TABLE county_public_safety (name VARCHAR, county_id VARCHAR, Crime_rate INTEGER); CREATE TABLE city (name VARCHAR, county_id VARCHAR, Crime_rate INTEGER)
Show the names of cities in counties that have a crime rate less than 100.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE Crime_rate < 100) Context: CREATE TABLE county_public_safety (name VARCHAR, county_id VARCHAR, Crime_rate INTEGER); CREATE TABLE city (name VARCHAR, county_id VARCHAR, Crime_rate INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the names of cities in counties that have a crime rate less than 100. The answer to your question is: SELECT name FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE Crime_rate < 100). [/s>
SELECT Case_burden FROM county_public_safety ORDER BY Population DESC
CREATE TABLE county_public_safety (Case_burden VARCHAR, Population VARCHAR)
Show the case burden of counties in descending order of population.
<s>[INST] Given the following SQL query and context: Query: SELECT Case_burden FROM county_public_safety ORDER BY Population DESC Context: CREATE TABLE county_public_safety (Case_burden VARCHAR, Population VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the case burden of counties in descending order of population. The answer to your question is: SELECT Case_burden FROM county_public_safety ORDER BY Population DESC. [/s>
SELECT roomName FROM Rooms WHERE basePrice < 160 AND beds = 2 AND decor = 'modern'
CREATE TABLE Rooms (roomName VARCHAR, decor VARCHAR, basePrice VARCHAR, beds VARCHAR)
Find the names of all modern rooms with a base price below $160 and two beds.
<s>[INST] Given the following SQL query and context: Query: SELECT roomName FROM Rooms WHERE basePrice < 160 AND beds = 2 AND decor = 'modern' Context: CREATE TABLE Rooms (roomName VARCHAR, decor VARCHAR, basePrice VARCHAR, beds VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of all modern rooms with a base price below $160 and two beds. The answer to your question is: SELECT roomName FROM Rooms WHERE basePrice < 160 AND beds = 2 AND decor = 'modern'. [/s>
SELECT roomName, RoomId FROM Rooms WHERE basePrice > 160 AND maxOccupancy > 2
CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR, basePrice VARCHAR, maxOccupancy VARCHAR)
Find all the rooms that have a price higher than 160 and can accommodate more than 2 people. Report room names and ids.
<s>[INST] Given the following SQL query and context: Query: SELECT roomName, RoomId FROM Rooms WHERE basePrice > 160 AND maxOccupancy > 2 Context: CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR, basePrice VARCHAR, maxOccupancy VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find all the rooms that have a price higher than 160 and can accommodate more than 2 people. Report room names and ids. The answer to your question is: SELECT roomName, RoomId FROM Rooms WHERE basePrice > 160 AND maxOccupancy > 2. [/s>
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
CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR)
Find the most popular room in the hotel. The most popular room is the room that had seen the largest number of reservations.
<s>[INST] Given the following SQL query and context: Query: 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 Context: CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the most popular room in the hotel. The most popular room is the room that had seen the largest number of reservations. The answer to your question is: 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. [/s>
SELECT kids FROM Reservations WHERE FirstName = "ROY" AND LastName = "SWEAZY"
CREATE TABLE Reservations (kids VARCHAR, FirstName VARCHAR, LastName VARCHAR)
How many kids stay in the rooms reserved by ROY SWEAZY?
<s>[INST] Given the following SQL query and context: Query: SELECT kids FROM Reservations WHERE FirstName = "ROY" AND LastName = "SWEAZY" Context: CREATE TABLE Reservations (kids VARCHAR, FirstName VARCHAR, LastName VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many kids stay in the rooms reserved by ROY SWEAZY? The answer to your question is: SELECT kids FROM Reservations WHERE FirstName = "ROY" AND LastName = "SWEAZY". [/s>
SELECT COUNT(*) FROM Reservations WHERE FirstName = "ROY" AND LastName = "SWEAZY"
CREATE TABLE Reservations (FirstName VARCHAR, LastName VARCHAR)
How many times does ROY SWEAZY has reserved a room.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Reservations WHERE FirstName = "ROY" AND LastName = "SWEAZY" Context: CREATE TABLE Reservations (FirstName VARCHAR, LastName VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many times does ROY SWEAZY has reserved a room. The answer to your question is: SELECT COUNT(*) FROM Reservations WHERE FirstName = "ROY" AND LastName = "SWEAZY". [/s>
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
CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR); CREATE TABLE Reservations (Rate VARCHAR, CheckIn VARCHAR, CheckOut VARCHAR, Room VARCHAR)
Which room has the highest rate? List the room's full name, rate, check in and check out date.
<s>[INST] Given the following SQL query and context: Query: 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 Context: CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR); CREATE TABLE Reservations (Rate VARCHAR, CheckIn VARCHAR, CheckOut VARCHAR, Room VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which room has the highest rate? List the room's full name, rate, check in and check out date. The answer to your question is: 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. [/s>
SELECT Adults FROM Reservations WHERE CheckIn = "2010-10-23" AND FirstName = "CONRAD" AND LastName = "SELBIG"
CREATE TABLE Reservations (Adults VARCHAR, LastName VARCHAR, CheckIn VARCHAR, FirstName VARCHAR)
How many adults stay in the room CONRAD SELBIG checked in on Oct 23, 2010?
<s>[INST] Given the following SQL query and context: Query: SELECT Adults FROM Reservations WHERE CheckIn = "2010-10-23" AND FirstName = "CONRAD" AND LastName = "SELBIG" Context: CREATE TABLE Reservations (Adults VARCHAR, LastName VARCHAR, CheckIn VARCHAR, FirstName VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many adults stay in the room CONRAD SELBIG checked in on Oct 23, 2010? The answer to your question is: SELECT Adults FROM Reservations WHERE CheckIn = "2010-10-23" AND FirstName = "CONRAD" AND LastName = "SELBIG". [/s>
SELECT Kids FROM Reservations WHERE CheckIn = "2010-09-21" AND FirstName = "DAMIEN" AND LastName = "TRACHSEL"
CREATE TABLE Reservations (Kids VARCHAR, LastName VARCHAR, CheckIn VARCHAR, FirstName VARCHAR)
How many kids stay in the room DAMIEN TRACHSEL checked in on Sep 21, 2010?
<s>[INST] Given the following SQL query and context: Query: SELECT Kids FROM Reservations WHERE CheckIn = "2010-09-21" AND FirstName = "DAMIEN" AND LastName = "TRACHSEL" Context: CREATE TABLE Reservations (Kids VARCHAR, LastName VARCHAR, CheckIn VARCHAR, FirstName VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many kids stay in the room DAMIEN TRACHSEL checked in on Sep 21, 2010? The answer to your question is: SELECT Kids FROM Reservations WHERE CheckIn = "2010-09-21" AND FirstName = "DAMIEN" AND LastName = "TRACHSEL". [/s>
SELECT SUM(beds) FROM Rooms WHERE bedtype = 'King'
CREATE TABLE Rooms (beds INTEGER, bedtype VARCHAR)
How many king beds are there?
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(beds) FROM Rooms WHERE bedtype = 'King' Context: CREATE TABLE Rooms (beds INTEGER, bedtype VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many king beds are there? The answer to your question is: SELECT SUM(beds) FROM Rooms WHERE bedtype = 'King'. [/s>
SELECT roomName, decor FROM Rooms WHERE bedtype = 'King' ORDER BY basePrice
CREATE TABLE Rooms (roomName VARCHAR, decor VARCHAR, bedtype VARCHAR, basePrice VARCHAR)
List the names and decor of rooms that have a king bed. Sort the list by their price.
<s>[INST] Given the following SQL query and context: Query: SELECT roomName, decor FROM Rooms WHERE bedtype = 'King' ORDER BY basePrice Context: CREATE TABLE Rooms (roomName VARCHAR, decor VARCHAR, bedtype VARCHAR, basePrice VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names and decor of rooms that have a king bed. Sort the list by their price. The answer to your question is: SELECT roomName, decor FROM Rooms WHERE bedtype = 'King' ORDER BY basePrice. [/s>
SELECT roomName, basePrice FROM Rooms ORDER BY basePrice LIMIT 1
CREATE TABLE Rooms (roomName VARCHAR, basePrice VARCHAR)
Which room has cheapest base price? List the room's name and the base price.
<s>[INST] Given the following SQL query and context: Query: SELECT roomName, basePrice FROM Rooms ORDER BY basePrice LIMIT 1 Context: CREATE TABLE Rooms (roomName VARCHAR, basePrice VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which room has cheapest base price? List the room's name and the base price. The answer to your question is: SELECT roomName, basePrice FROM Rooms ORDER BY basePrice LIMIT 1. [/s>
SELECT decor FROM Rooms WHERE roomName = "Recluse and defiance"
CREATE TABLE Rooms (decor VARCHAR, roomName VARCHAR)
What is the decor of room Recluse and defiance?
<s>[INST] Given the following SQL query and context: Query: SELECT decor FROM Rooms WHERE roomName = "Recluse and defiance" Context: CREATE TABLE Rooms (decor VARCHAR, roomName VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the decor of room Recluse and defiance? The answer to your question is: SELECT decor FROM Rooms WHERE roomName = "Recluse and defiance". [/s>
SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType
CREATE TABLE Rooms (bedType VARCHAR, basePrice INTEGER)
What is the average base price of different bed type? List bed type and average base price.
<s>[INST] Given the following SQL query and context: Query: SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType Context: CREATE TABLE Rooms (bedType VARCHAR, basePrice INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average base price of different bed type? List bed type and average base price. The answer to your question is: SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType. [/s>
SELECT SUM(maxOccupancy) FROM Rooms WHERE decor = 'modern'
CREATE TABLE Rooms (maxOccupancy INTEGER, decor VARCHAR)
What is the total number of people who could stay in the modern rooms in this inn?
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(maxOccupancy) FROM Rooms WHERE decor = 'modern' Context: CREATE TABLE Rooms (maxOccupancy INTEGER, decor VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the total number of people who could stay in the modern rooms in this inn? The answer to your question is: SELECT SUM(maxOccupancy) FROM Rooms WHERE decor = 'modern'. [/s>
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) LIMIT 1
CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (decor VARCHAR, RoomId VARCHAR)
What kind of decor has the least number of reservations?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.decor FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T2.decor ORDER BY COUNT(T2.decor) LIMIT 1 Context: CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (decor VARCHAR, RoomId VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What kind of decor has the least number of reservations? The answer to your question is: 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) LIMIT 1. [/s>
SELECT COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T2.maxOccupancy = T1.Adults + T1.Kids
CREATE TABLE Rooms (RoomId VARCHAR, maxOccupancy VARCHAR); CREATE TABLE Reservations (Room VARCHAR, Adults VARCHAR, Kids VARCHAR)
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.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T2.maxOccupancy = T1.Adults + T1.Kids Context: CREATE TABLE Rooms (RoomId VARCHAR, maxOccupancy VARCHAR); CREATE TABLE Reservations (Room VARCHAR, Adults VARCHAR, Kids VARCHAR) [/INST] Based on the provided SQL query and context, your question is: 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. The answer to your question is: SELECT COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T2.maxOccupancy = T1.Adults + T1.Kids. [/s>
SELECT T1.firstname, T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T1.Rate - T2.basePrice > 0
CREATE TABLE Reservations (firstname VARCHAR, lastname VARCHAR, Room VARCHAR, Rate VARCHAR); CREATE TABLE Rooms (RoomId VARCHAR, basePrice VARCHAR)
Find the first and last names of people who payed more than the rooms' base prices.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.firstname, T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T1.Rate - T2.basePrice > 0 Context: CREATE TABLE Reservations (firstname VARCHAR, lastname VARCHAR, Room VARCHAR, Rate VARCHAR); CREATE TABLE Rooms (RoomId VARCHAR, basePrice VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the first and last names of people who payed more than the rooms' base prices. The answer to your question is: SELECT T1.firstname, T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T1.Rate - T2.basePrice > 0. [/s>
SELECT COUNT(*) FROM Rooms
CREATE TABLE Rooms (Id VARCHAR)
How many rooms are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Rooms Context: CREATE TABLE Rooms (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many rooms are there? The answer to your question is: SELECT COUNT(*) FROM Rooms. [/s>
SELECT COUNT(*) FROM Rooms WHERE bedType = "King"
CREATE TABLE Rooms (bedType VARCHAR)
Find the number of rooms with a king bed.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Rooms WHERE bedType = "King" Context: CREATE TABLE Rooms (bedType VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of rooms with a king bed. The answer to your question is: SELECT COUNT(*) FROM Rooms WHERE bedType = "King". [/s>
SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType
CREATE TABLE Rooms (bedType VARCHAR)
Find the number of rooms for each bed type.
<s>[INST] Given the following SQL query and context: Query: SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType Context: CREATE TABLE Rooms (bedType VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of rooms for each bed type. The answer to your question is: SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType. [/s>
SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1
CREATE TABLE Rooms (roomName VARCHAR, maxOccupancy VARCHAR)
Find the name of the room with the maximum occupancy.
<s>[INST] Given the following SQL query and context: Query: SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1 Context: CREATE TABLE Rooms (roomName VARCHAR, maxOccupancy VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of the room with the maximum occupancy. The answer to your question is: SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1. [/s>
SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1
CREATE TABLE Rooms (RoomId VARCHAR, roomName VARCHAR, basePrice VARCHAR)
Find the id and name of the most expensive base price room.
<s>[INST] Given the following SQL query and context: Query: SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1 Context: CREATE TABLE Rooms (RoomId VARCHAR, roomName VARCHAR, basePrice VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the id and name of the most expensive base price room. The answer to your question is: SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1. [/s>
SELECT roomName, bedType FROM Rooms WHERE decor = "traditional"
CREATE TABLE Rooms (roomName VARCHAR, bedType VARCHAR, decor VARCHAR)
List the type of bed and name of all traditional rooms.
<s>[INST] Given the following SQL query and context: Query: SELECT roomName, bedType FROM Rooms WHERE decor = "traditional" Context: CREATE TABLE Rooms (roomName VARCHAR, bedType VARCHAR, decor VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the type of bed and name of all traditional rooms. The answer to your question is: SELECT roomName, bedType FROM Rooms WHERE decor = "traditional". [/s>
SELECT decor, COUNT(*) FROM Rooms WHERE bedType = "King" GROUP BY decor
CREATE TABLE Rooms (decor VARCHAR, bedType VARCHAR)
Find the number of rooms with king bed for each decor type.
<s>[INST] Given the following SQL query and context: Query: SELECT decor, COUNT(*) FROM Rooms WHERE bedType = "King" GROUP BY decor Context: CREATE TABLE Rooms (decor VARCHAR, bedType VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of rooms with king bed for each decor type. The answer to your question is: SELECT decor, COUNT(*) FROM Rooms WHERE bedType = "King" GROUP BY decor. [/s>
SELECT decor, AVG(basePrice), MIN(basePrice) FROM Rooms GROUP BY decor
CREATE TABLE Rooms (decor VARCHAR, basePrice INTEGER)
Find the average and minimum price of the rooms in different decor.
<s>[INST] Given the following SQL query and context: Query: SELECT decor, AVG(basePrice), MIN(basePrice) FROM Rooms GROUP BY decor Context: CREATE TABLE Rooms (decor VARCHAR, basePrice INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the average and minimum price of the rooms in different decor. The answer to your question is: SELECT decor, AVG(basePrice), MIN(basePrice) FROM Rooms GROUP BY decor. [/s>
SELECT roomName FROM Rooms ORDER BY basePrice
CREATE TABLE Rooms (roomName VARCHAR, basePrice VARCHAR)
List the name of all rooms sorted by their prices.
<s>[INST] Given the following SQL query and context: Query: SELECT roomName FROM Rooms ORDER BY basePrice Context: CREATE TABLE Rooms (roomName VARCHAR, basePrice VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name of all rooms sorted by their prices. The answer to your question is: SELECT roomName FROM Rooms ORDER BY basePrice. [/s>
SELECT decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor
CREATE TABLE Rooms (decor VARCHAR, basePrice INTEGER)
Find the number of rooms with price higher than 120 for different decor.
<s>[INST] Given the following SQL query and context: Query: SELECT decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor Context: CREATE TABLE Rooms (decor VARCHAR, basePrice INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the number of rooms with price higher than 120 for different decor. The answer to your question is: SELECT decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor. [/s>
SELECT roomName FROM Rooms WHERE bedType = "King" OR bedType = "Queen"
CREATE TABLE Rooms (roomName VARCHAR, bedType VARCHAR)
List the name of rooms with king or queen bed.
<s>[INST] Given the following SQL query and context: Query: SELECT roomName FROM Rooms WHERE bedType = "King" OR bedType = "Queen" Context: CREATE TABLE Rooms (roomName VARCHAR, bedType VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name of rooms with king or queen bed. The answer to your question is: SELECT roomName FROM Rooms WHERE bedType = "King" OR bedType = "Queen". [/s>
SELECT COUNT(DISTINCT bedType) FROM Rooms
CREATE TABLE Rooms (bedType VARCHAR)
How many different types of beds are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT bedType) FROM Rooms Context: CREATE TABLE Rooms (bedType VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different types of beds are there? The answer to your question is: SELECT COUNT(DISTINCT bedType) FROM Rooms. [/s>
SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3
CREATE TABLE Rooms (RoomId VARCHAR, roomName VARCHAR, basePrice VARCHAR)
Find the name and id of the top 3 expensive rooms.
<s>[INST] Given the following SQL query and context: Query: SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3 Context: CREATE TABLE Rooms (RoomId VARCHAR, roomName VARCHAR, basePrice VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name and id of the top 3 expensive rooms. The answer to your question is: SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3. [/s>
SELECT roomName FROM Rooms WHERE basePrice > (SELECT AVG(basePrice) FROM Rooms)
CREATE TABLE Rooms (roomName VARCHAR, basePrice INTEGER)
Find the name of rooms whose price is higher than the average price.
<s>[INST] Given the following SQL query and context: Query: SELECT roomName FROM Rooms WHERE basePrice > (SELECT AVG(basePrice) FROM Rooms) Context: CREATE TABLE Rooms (roomName VARCHAR, basePrice INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the name of rooms whose price is higher than the average price. The answer to your question is: SELECT roomName FROM Rooms WHERE basePrice > (SELECT AVG(basePrice) FROM Rooms). [/s>
SELECT COUNT(*) FROM rooms WHERE NOT roomid IN (SELECT DISTINCT room FROM reservations)
CREATE TABLE rooms (roomid VARCHAR, room VARCHAR); CREATE TABLE reservations (roomid VARCHAR, room VARCHAR)
Find the number of rooms that do not have any reservation.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM rooms WHERE NOT roomid IN (SELECT DISTINCT room FROM reservations) Context: CREATE TABLE rooms (roomid VARCHAR, room VARCHAR); CREATE TABLE reservations (roomid VARCHAR, room VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of rooms that do not have any reservation. The answer to your question is: SELECT COUNT(*) FROM rooms WHERE NOT roomid IN (SELECT DISTINCT room FROM reservations). [/s>
SELECT T2.roomName, COUNT(*), T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room
CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR)
Return the name and number of reservations made for each of the rooms.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.roomName, COUNT(*), T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room Context: CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Return the name and number of reservations made for each of the rooms. The answer to your question is: SELECT T2.roomName, COUNT(*), T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room. [/s>
SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room HAVING COUNT(*) > 60
CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR)
Find the names of rooms that have been reserved for more than 60 times.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room HAVING COUNT(*) > 60 Context: CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of rooms that have been reserved for more than 60 times. The answer to your question is: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room HAVING COUNT(*) > 60. [/s>
SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150
CREATE TABLE rooms (roomname VARCHAR, baseprice INTEGER)
Find the name of rooms whose base price is between 120 and 150.
<s>[INST] Given the following SQL query and context: Query: SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150 Context: CREATE TABLE rooms (roomname VARCHAR, baseprice INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the name of rooms whose base price is between 120 and 150. The answer to your question is: SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150. [/s>
SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname LIKE '%ROY%'
CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR)
Find the name of rooms booked by some customers whose first name contains ROY.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname LIKE '%ROY%' Context: CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of rooms booked by some customers whose first name contains ROY. The answer to your question is: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname LIKE '%ROY%'. [/s>
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'
CREATE TABLE CMI_Cross_References (master_customer_id VARCHAR, source_system_code VARCHAR); CREATE TABLE Customer_Master_Index (cmi_details VARCHAR, master_customer_id VARCHAR)
what are the details of the cmi masters that have the cross reference code 'Tax'?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.cmi_details FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T2.source_system_code = 'Tax' Context: CREATE TABLE CMI_Cross_References (master_customer_id VARCHAR, source_system_code VARCHAR); CREATE TABLE Customer_Master_Index (cmi_details VARCHAR, master_customer_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: what are the details of the cmi masters that have the cross reference code 'Tax'? The answer to your question is: 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'. [/s>
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
CREATE TABLE Council_Tax (cmi_cross_ref_id VARCHAR); CREATE TABLE CMI_Cross_References (cmi_cross_ref_id VARCHAR, source_system_code VARCHAR)
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.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.cmi_cross_ref_id, T1.source_system_code FROM CMI_Cross_References AS T1 JOIN Council_Tax AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T1.cmi_cross_ref_id HAVING COUNT(*) >= 1 Context: CREATE TABLE Council_Tax (cmi_cross_ref_id VARCHAR); CREATE TABLE CMI_Cross_References (cmi_cross_ref_id VARCHAR, source_system_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: 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. The answer to your question is: 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. [/s>
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
CREATE TABLE CMI_Cross_References (cmi_cross_ref_id VARCHAR, master_customer_id VARCHAR); CREATE TABLE Business_Rates (cmi_cross_ref_id VARCHAR)
How many business rates are related to each cmi cross reference? List cross reference id, master customer id and the n
<s>[INST] Given the following SQL query and context: Query: SELECT T2.cmi_cross_ref_id, T2.master_customer_id, COUNT(*) FROM Business_Rates AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T2.cmi_cross_ref_id Context: CREATE TABLE CMI_Cross_References (cmi_cross_ref_id VARCHAR, master_customer_id VARCHAR); CREATE TABLE Business_Rates (cmi_cross_ref_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many business rates are related to each cmi cross reference? List cross reference id, master customer id and the n The answer to your question is: 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. [/s>
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
CREATE TABLE CMI_Cross_References (source_system_code VARCHAR, cmi_cross_ref_id VARCHAR); CREATE TABLE Benefits_Overpayments (council_tax_id VARCHAR, cmi_cross_ref_id VARCHAR)
What is the tax source system code related to the benefits and overpayments? List the code and the benifit id, order by benifit id.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.source_system_code, T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Benefits_Overpayments AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id ORDER BY T2.council_tax_id Context: CREATE TABLE CMI_Cross_References (source_system_code VARCHAR, cmi_cross_ref_id VARCHAR); CREATE TABLE Benefits_Overpayments (council_tax_id VARCHAR, cmi_cross_ref_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the tax source system code related to the benefits and overpayments? List the code and the benifit id, order by benifit id. The answer to your question is: 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. [/s>
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
CREATE TABLE CMI_Cross_References (source_system_code VARCHAR, master_customer_id VARCHAR, cmi_cross_ref_id VARCHAR); CREATE TABLE Parking_Fines (council_tax_id VARCHAR, cmi_cross_ref_id VARCHAR)
Wat is the tax source system code and master customer id of the taxes related to each parking fine id?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.source_system_code, T1.master_customer_id, T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Parking_Fines AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id Context: CREATE TABLE CMI_Cross_References (source_system_code VARCHAR, master_customer_id VARCHAR, cmi_cross_ref_id VARCHAR); CREATE TABLE Parking_Fines (council_tax_id VARCHAR, cmi_cross_ref_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Wat is the tax source system code and master customer id of the taxes related to each parking fine id? The answer to your question is: 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. [/s>
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'
CREATE TABLE Rent_Arrears (council_tax_id VARCHAR, cmi_cross_ref_id VARCHAR); CREATE TABLE Customer_Master_Index (master_customer_id VARCHAR, cmi_details VARCHAR); CREATE TABLE CMI_Cross_References (cmi_cross_ref_id VARCHAR, master_customer_id VARCHAR)
What are the renting arrears tax ids related to the customer master index whose detail is not 'Schmidt, Kertzmann and Lubowitz'?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.council_tax_id FROM Rent_Arrears AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id JOIN Customer_Master_Index AS T3 ON T3.master_customer_id = T2.master_customer_id WHERE T3.cmi_details <> 'Schmidt , Kertzmann and Lubowitz' Context: CREATE TABLE Rent_Arrears (council_tax_id VARCHAR, cmi_cross_ref_id VARCHAR); CREATE TABLE Customer_Master_Index (master_customer_id VARCHAR, cmi_details VARCHAR); CREATE TABLE CMI_Cross_References (cmi_cross_ref_id VARCHAR, master_customer_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the renting arrears tax ids related to the customer master index whose detail is not 'Schmidt, Kertzmann and Lubowitz'? The answer to your question is: 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'. [/s>
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'
CREATE TABLE Electoral_Register (electoral_register_id VARCHAR, cmi_cross_ref_id VARCHAR); CREATE TABLE CMI_Cross_References (cmi_cross_ref_id VARCHAR, source_system_code VARCHAR)
What are the register ids of electoral registries that have the cross reference source system code 'Electoral' or 'Tax'?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.electoral_register_id FROM Electoral_Register AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id WHERE T2.source_system_code = 'Electoral' OR T2.source_system_code = 'Tax' Context: CREATE TABLE Electoral_Register (electoral_register_id VARCHAR, cmi_cross_ref_id VARCHAR); CREATE TABLE CMI_Cross_References (cmi_cross_ref_id VARCHAR, source_system_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the register ids of electoral registries that have the cross reference source system code 'Electoral' or 'Tax'? The answer to your question is: 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'. [/s>
SELECT COUNT(DISTINCT source_system_code) FROM CMI_cross_references
CREATE TABLE CMI_cross_references (source_system_code VARCHAR)
How many different source system code for the cmi cross references are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT source_system_code) FROM CMI_cross_references Context: CREATE TABLE CMI_cross_references (source_system_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different source system code for the cmi cross references are there? The answer to your question is: SELECT COUNT(DISTINCT source_system_code) FROM CMI_cross_references. [/s>
SELECT * FROM customer_master_index ORDER BY cmi_details DESC
CREATE TABLE customer_master_index (cmi_details VARCHAR)
List all information about customer master index, and sort them by details in descending order.
<s>[INST] Given the following SQL query and context: Query: SELECT * FROM customer_master_index ORDER BY cmi_details DESC Context: CREATE TABLE customer_master_index (cmi_details VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all information about customer master index, and sort them by details in descending order. The answer to your question is: SELECT * FROM customer_master_index ORDER BY cmi_details DESC. [/s>
SELECT council_tax_id, cmi_cross_ref_id FROM parking_fines
CREATE TABLE parking_fines (council_tax_id VARCHAR, cmi_cross_ref_id VARCHAR)
List the council tax ids and their related cmi cross references of all the parking fines.
<s>[INST] Given the following SQL query and context: Query: SELECT council_tax_id, cmi_cross_ref_id FROM parking_fines Context: CREATE TABLE parking_fines (council_tax_id VARCHAR, cmi_cross_ref_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the council tax ids and their related cmi cross references of all the parking fines. The answer to your question is: SELECT council_tax_id, cmi_cross_ref_id FROM parking_fines. [/s>
SELECT COUNT(*) FROM rent_arrears
CREATE TABLE rent_arrears (Id VARCHAR)
How many council taxes are collected for renting arrears ?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM rent_arrears Context: CREATE TABLE rent_arrears (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many council taxes are collected for renting arrears ? The answer to your question is: SELECT COUNT(*) FROM rent_arrears. [/s>
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'
CREATE TABLE customer_master_index (master_customer_id VARCHAR, cmi_details VARCHAR); CREATE TABLE cmi_cross_references (source_system_code VARCHAR, master_customer_id VARCHAR)
What are the distinct cross reference source system codes which are related to the master customer details 'Gottlieb, Becker and Wyman'?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T2.source_system_code FROM customer_master_index AS T1 JOIN cmi_cross_references AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T1.cmi_details = 'Gottlieb , Becker and Wyman' Context: CREATE TABLE customer_master_index (master_customer_id VARCHAR, cmi_details VARCHAR); CREATE TABLE cmi_cross_references (source_system_code VARCHAR, master_customer_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the distinct cross reference source system codes which are related to the master customer details 'Gottlieb, Becker and Wyman'? The answer to your question is: 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'. [/s>
SELECT cmi_cross_ref_id FROM cmi_cross_references EXCEPT SELECT cmi_cross_ref_id FROM parking_fines
CREATE TABLE parking_fines (cmi_cross_ref_id VARCHAR); CREATE TABLE cmi_cross_references (cmi_cross_ref_id VARCHAR)
Which cmi cross reference id is not related to any parking taxes?
<s>[INST] Given the following SQL query and context: Query: SELECT cmi_cross_ref_id FROM cmi_cross_references EXCEPT SELECT cmi_cross_ref_id FROM parking_fines Context: CREATE TABLE parking_fines (cmi_cross_ref_id VARCHAR); CREATE TABLE cmi_cross_references (cmi_cross_ref_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which cmi cross reference id is not related to any parking taxes? The answer to your question is: SELECT cmi_cross_ref_id FROM cmi_cross_references EXCEPT SELECT cmi_cross_ref_id FROM parking_fines. [/s>
SELECT DISTINCT source_system_code FROM cmi_cross_references WHERE source_system_code LIKE '%en%'
CREATE TABLE cmi_cross_references (source_system_code VARCHAR)
Which distinct source system code includes the substring 'en'?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT source_system_code FROM cmi_cross_references WHERE source_system_code LIKE '%en%' Context: CREATE TABLE cmi_cross_references (source_system_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which distinct source system code includes the substring 'en'? The answer to your question is: SELECT DISTINCT source_system_code FROM cmi_cross_references WHERE source_system_code LIKE '%en%'. [/s>
SELECT COUNT(*) FROM party
CREATE TABLE party (Id VARCHAR)
How many parties are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM party Context: CREATE TABLE party (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many parties are there? The answer to your question is: SELECT COUNT(*) FROM party. [/s>
SELECT Party_Theme FROM party ORDER BY Number_of_hosts
CREATE TABLE party (Party_Theme VARCHAR, Number_of_hosts VARCHAR)
List the themes of parties in ascending order of number of hosts.
<s>[INST] Given the following SQL query and context: Query: SELECT Party_Theme FROM party ORDER BY Number_of_hosts Context: CREATE TABLE party (Party_Theme VARCHAR, Number_of_hosts VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the themes of parties in ascending order of number of hosts. The answer to your question is: SELECT Party_Theme FROM party ORDER BY Number_of_hosts. [/s>
SELECT Party_Theme, LOCATION FROM party
CREATE TABLE party (Party_Theme VARCHAR, LOCATION VARCHAR)
What are the themes and locations of parties?
<s>[INST] Given the following SQL query and context: Query: SELECT Party_Theme, LOCATION FROM party Context: CREATE TABLE party (Party_Theme VARCHAR, LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the themes and locations of parties? The answer to your question is: SELECT Party_Theme, LOCATION FROM party. [/s>
SELECT First_year, Last_year FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology"
CREATE TABLE party (First_year VARCHAR, Last_year VARCHAR, Party_Theme VARCHAR)
Show the first year and last year of parties with theme "Spring" or "Teqnology".
<s>[INST] Given the following SQL query and context: Query: SELECT First_year, Last_year FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" Context: CREATE TABLE party (First_year VARCHAR, Last_year VARCHAR, Party_Theme VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the first year and last year of parties with theme "Spring" or "Teqnology". The answer to your question is: SELECT First_year, Last_year FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology". [/s>
SELECT AVG(Number_of_hosts) FROM party
CREATE TABLE party (Number_of_hosts INTEGER)
What is the average number of hosts for parties?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(Number_of_hosts) FROM party Context: CREATE TABLE party (Number_of_hosts INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average number of hosts for parties? The answer to your question is: SELECT AVG(Number_of_hosts) FROM party. [/s>
SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1
CREATE TABLE party (LOCATION VARCHAR, Number_of_hosts VARCHAR)
What is the location of the party with the most hosts?
<s>[INST] Given the following SQL query and context: Query: SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1 Context: CREATE TABLE party (LOCATION VARCHAR, Number_of_hosts VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the location of the party with the most hosts? The answer to your question is: SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1. [/s>
SELECT Nationality, COUNT(*) FROM HOST GROUP BY Nationality
CREATE TABLE HOST (Nationality VARCHAR)
Show different nationalities along with the number of hosts of each nationality.
<s>[INST] Given the following SQL query and context: Query: SELECT Nationality, COUNT(*) FROM HOST GROUP BY Nationality Context: CREATE TABLE HOST (Nationality VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show different nationalities along with the number of hosts of each nationality. The answer to your question is: SELECT Nationality, COUNT(*) FROM HOST GROUP BY Nationality. [/s>
SELECT Nationality FROM HOST GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE HOST (Nationality VARCHAR)
Show the most common nationality of hosts.
<s>[INST] Given the following SQL query and context: Query: SELECT Nationality FROM HOST GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE HOST (Nationality VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the most common nationality of hosts. The answer to your question is: SELECT Nationality FROM HOST GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT Nationality FROM HOST WHERE Age > 45 INTERSECT SELECT Nationality FROM HOST WHERE Age < 35
CREATE TABLE HOST (Nationality VARCHAR, Age INTEGER)
Show the nations that have both hosts older than 45 and hosts younger than 35.
<s>[INST] Given the following SQL query and context: Query: SELECT Nationality FROM HOST WHERE Age > 45 INTERSECT SELECT Nationality FROM HOST WHERE Age < 35 Context: CREATE TABLE HOST (Nationality VARCHAR, Age INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the nations that have both hosts older than 45 and hosts younger than 35. The answer to your question is: SELECT Nationality FROM HOST WHERE Age > 45 INTERSECT SELECT Nationality FROM HOST WHERE Age < 35. [/s>
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
CREATE TABLE HOST (Name VARCHAR, Host_ID VARCHAR); CREATE TABLE party_host (Host_ID VARCHAR, Party_ID VARCHAR); CREATE TABLE party (Party_Theme VARCHAR, Party_ID VARCHAR)
Show the themes of parties and the names of the party hosts.
<s>[INST] Given the following SQL query and context: Query: SELECT T3.Party_Theme, T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID Context: CREATE TABLE HOST (Name VARCHAR, Host_ID VARCHAR); CREATE TABLE party_host (Host_ID VARCHAR, Party_ID VARCHAR); CREATE TABLE party (Party_Theme VARCHAR, Party_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the themes of parties and the names of the party hosts. The answer to your question is: 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. [/s>
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
CREATE TABLE party (Location VARCHAR, Party_ID VARCHAR); CREATE TABLE HOST (Name VARCHAR, Host_ID VARCHAR, Age VARCHAR); CREATE TABLE party_host (Host_ID VARCHAR, Party_ID VARCHAR)
Show the locations of parties and the names of the party hosts in ascending order of the age of the host.
<s>[INST] Given the following SQL query and context: Query: SELECT T3.Location, T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID ORDER BY T2.Age Context: CREATE TABLE party (Location VARCHAR, Party_ID VARCHAR); CREATE TABLE HOST (Name VARCHAR, Host_ID VARCHAR, Age VARCHAR); CREATE TABLE party_host (Host_ID VARCHAR, Party_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the locations of parties and the names of the party hosts in ascending order of the age of the host. The answer to your question is: 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. [/s>
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
CREATE TABLE party (Location VARCHAR, Party_ID VARCHAR); CREATE TABLE party_host (Host_ID VARCHAR, Party_ID VARCHAR); CREATE TABLE HOST (Host_ID VARCHAR, Age INTEGER)
Show the locations of parties with hosts older than 50.
<s>[INST] Given the following SQL query and context: Query: SELECT T3.Location FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T2.Age > 50 Context: CREATE TABLE party (Location VARCHAR, Party_ID VARCHAR); CREATE TABLE party_host (Host_ID VARCHAR, Party_ID VARCHAR); CREATE TABLE HOST (Host_ID VARCHAR, Age INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the locations of parties with hosts older than 50. The answer to your question is: 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. [/s>
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
CREATE TABLE HOST (Name VARCHAR, Host_ID VARCHAR); CREATE TABLE party_host (Host_ID VARCHAR, Party_ID VARCHAR); CREATE TABLE party (Party_ID VARCHAR, Number_of_hosts INTEGER)
Show the host names for parties with number of hosts greater than 20.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T3.Number_of_hosts > 20 Context: CREATE TABLE HOST (Name VARCHAR, Host_ID VARCHAR); CREATE TABLE party_host (Host_ID VARCHAR, Party_ID VARCHAR); CREATE TABLE party (Party_ID VARCHAR, Number_of_hosts INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the host names for parties with number of hosts greater than 20. The answer to your question is: 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. [/s>
SELECT Name, Nationality FROM HOST ORDER BY Age DESC LIMIT 1
CREATE TABLE HOST (Name VARCHAR, Nationality VARCHAR, Age VARCHAR)
Show the name and the nationality of the oldest host.
<s>[INST] Given the following SQL query and context: Query: SELECT Name, Nationality FROM HOST ORDER BY Age DESC LIMIT 1 Context: CREATE TABLE HOST (Name VARCHAR, Nationality VARCHAR, Age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name and the nationality of the oldest host. The answer to your question is: SELECT Name, Nationality FROM HOST ORDER BY Age DESC LIMIT 1. [/s>
SELECT Name FROM HOST WHERE NOT Host_ID IN (SELECT Host_ID FROM party_host)
CREATE TABLE HOST (Name VARCHAR, Host_ID VARCHAR); CREATE TABLE party_host (Name VARCHAR, Host_ID VARCHAR)
List the names of hosts who did not serve as a host of any party in our record.
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM HOST WHERE NOT Host_ID IN (SELECT Host_ID FROM party_host) Context: CREATE TABLE HOST (Name VARCHAR, Host_ID VARCHAR); CREATE TABLE party_host (Name VARCHAR, Host_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of hosts who did not serve as a host of any party in our record. The answer to your question is: SELECT Name FROM HOST WHERE NOT Host_ID IN (SELECT Host_ID FROM party_host). [/s>
SELECT region_code, region_name FROM region ORDER BY region_code
CREATE TABLE region (region_code VARCHAR, region_name VARCHAR)
Show all region code and region name sorted by the codes.
<s>[INST] Given the following SQL query and context: Query: SELECT region_code, region_name FROM region ORDER BY region_code Context: CREATE TABLE region (region_code VARCHAR, region_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all region code and region name sorted by the codes. The answer to your question is: SELECT region_code, region_name FROM region ORDER BY region_code. [/s>
SELECT region_name FROM region ORDER BY region_name
CREATE TABLE region (region_name VARCHAR)
List all region names in alphabetical order.
<s>[INST] Given the following SQL query and context: Query: SELECT region_name FROM region ORDER BY region_name Context: CREATE TABLE region (region_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all region names in alphabetical order. The answer to your question is: SELECT region_name FROM region ORDER BY region_name. [/s>
SELECT region_name FROM region WHERE region_name <> 'Denmark'
CREATE TABLE region (region_name VARCHAR)
Show names for all regions except for Denmark.
<s>[INST] Given the following SQL query and context: Query: SELECT region_name FROM region WHERE region_name <> 'Denmark' Context: CREATE TABLE region (region_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show names for all regions except for Denmark. The answer to your question is: SELECT region_name FROM region WHERE region_name <> 'Denmark'. [/s>
SELECT COUNT(*) FROM storm WHERE Number_Deaths > 0
CREATE TABLE storm (Number_Deaths INTEGER)
How many storms had death records?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM storm WHERE Number_Deaths > 0 Context: CREATE TABLE storm (Number_Deaths INTEGER) [/INST] Based on the provided SQL query and context, your question is: How many storms had death records? The answer to your question is: SELECT COUNT(*) FROM storm WHERE Number_Deaths > 0. [/s>
SELECT name, dates_active, number_deaths FROM storm WHERE number_deaths >= 1
CREATE TABLE storm (name VARCHAR, dates_active VARCHAR, number_deaths VARCHAR)
List name, dates active, and number of deaths for all storms with at least 1 death.
<s>[INST] Given the following SQL query and context: Query: SELECT name, dates_active, number_deaths FROM storm WHERE number_deaths >= 1 Context: CREATE TABLE storm (name VARCHAR, dates_active VARCHAR, number_deaths VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List name, dates active, and number of deaths for all storms with at least 1 death. The answer to your question is: SELECT name, dates_active, number_deaths FROM storm WHERE number_deaths >= 1. [/s>
SELECT AVG(damage_millions_USD), MAX(damage_millions_USD) FROM storm WHERE max_speed > 1000
CREATE TABLE storm (damage_millions_USD INTEGER, max_speed INTEGER)
Show the average and maximum damage for all storms with max speed higher than 1000.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(damage_millions_USD), MAX(damage_millions_USD) FROM storm WHERE max_speed > 1000 Context: CREATE TABLE storm (damage_millions_USD INTEGER, max_speed INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the average and maximum damage for all storms with max speed higher than 1000. The answer to your question is: SELECT AVG(damage_millions_USD), MAX(damage_millions_USD) FROM storm WHERE max_speed > 1000. [/s>
SELECT SUM(number_deaths), SUM(damage_millions_USD) FROM storm WHERE max_speed > (SELECT AVG(max_speed) FROM storm)
CREATE TABLE storm (number_deaths INTEGER, damage_millions_USD INTEGER, max_speed INTEGER)
What is the total number of deaths and damage for all storms with a max speed greater than the average?
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(number_deaths), SUM(damage_millions_USD) FROM storm WHERE max_speed > (SELECT AVG(max_speed) FROM storm) Context: CREATE TABLE storm (number_deaths INTEGER, damage_millions_USD INTEGER, max_speed INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the total number of deaths and damage for all storms with a max speed greater than the average? The answer to your question is: SELECT SUM(number_deaths), SUM(damage_millions_USD) FROM storm WHERE max_speed > (SELECT AVG(max_speed) FROM storm). [/s>
SELECT name, damage_millions_USD FROM storm ORDER BY max_speed DESC
CREATE TABLE storm (name VARCHAR, damage_millions_USD VARCHAR, max_speed VARCHAR)
List name and damage for all storms in a descending order of max speed.
<s>[INST] Given the following SQL query and context: Query: SELECT name, damage_millions_USD FROM storm ORDER BY max_speed DESC Context: CREATE TABLE storm (name VARCHAR, damage_millions_USD VARCHAR, max_speed VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List name and damage for all storms in a descending order of max speed. The answer to your question is: SELECT name, damage_millions_USD FROM storm ORDER BY max_speed DESC. [/s>
SELECT COUNT(DISTINCT region_id) FROM affected_region
CREATE TABLE affected_region (region_id VARCHAR)
How many regions are affected?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT region_id) FROM affected_region Context: CREATE TABLE affected_region (region_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many regions are affected? The answer to your question is: SELECT COUNT(DISTINCT region_id) FROM affected_region. [/s>
SELECT region_name FROM region WHERE NOT region_id IN (SELECT region_id FROM affected_region)
CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_name VARCHAR, region_id VARCHAR)
Show the name for regions not affected.
<s>[INST] Given the following SQL query and context: Query: SELECT region_name FROM region WHERE NOT region_id IN (SELECT region_id FROM affected_region) Context: CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_name VARCHAR, region_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name for regions not affected. The answer to your question is: SELECT region_name FROM region WHERE NOT region_id IN (SELECT region_id FROM affected_region). [/s>
SELECT T1.region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id
CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR)
Show the name for regions and the number of storms for each region.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id Context: CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name for regions and the number of storms for each region. The answer to your question is: SELECT T1.region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id. [/s>
SELECT T1.name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id
CREATE TABLE affected_region (storm_id VARCHAR); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR)
List the name for storms and the number of affected regions for each storm.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id Context: CREATE TABLE affected_region (storm_id VARCHAR); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name for storms and the number of affected regions for each storm. The answer to your question is: SELECT T1.name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id. [/s>