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