answer
stringlengths
18
557
context
stringlengths
27
489
question
stringlengths
12
244
text
stringlengths
275
1.7k
SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = "Female"
CREATE TABLE Apartment_Bookings (booking_start_date VARCHAR, guest_id VARCHAR); CREATE TABLE Guests (guest_id VARCHAR, gender_code VARCHAR)
Show the start dates and end dates of all the apartment bookings made by guests with gender code "Female".
<s>[INST] Given the following SQL query and context: Query: SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = "Female" Context: CREATE TABLE Apartment_Bookings (booking_start_date VARCHAR, guest_id VARCHAR); CREATE TAB...
SELECT T2.guest_first_name, T2.guest_last_name FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T1.booking_status_code = "Confirmed"
CREATE TABLE Apartment_Bookings (guest_id VARCHAR, booking_status_code VARCHAR); CREATE TABLE Guests (guest_first_name VARCHAR, guest_last_name VARCHAR, guest_id VARCHAR)
Show the first names and last names of all the guests that have apartment bookings with status code "Confirmed".
<s>[INST] Given the following SQL query and context: Query: SELECT T2.guest_first_name, T2.guest_last_name FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T1.booking_status_code = "Confirmed" Context: CREATE TABLE Apartment_Bookings (guest_id VARCHAR, booking_status_code VARCHAR); CRE...
SELECT T1.facility_code FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4
CREATE TABLE Apartment_Facilities (facility_code VARCHAR, apt_id VARCHAR); CREATE TABLE Apartments (apt_id VARCHAR, bedroom_count INTEGER)
Show the facility codes of apartments with more than 4 bedrooms.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.facility_code FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 Context: CREATE TABLE Apartment_Facilities (facility_code VARCHAR, apt_id VARCHAR); CREATE TABLE Apartments (apt_id VARCHAR, bedro...
SELECT SUM(T2.room_count) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.facility_code = "Gym"
CREATE TABLE Apartments (room_count INTEGER, apt_id VARCHAR); CREATE TABLE Apartment_Facilities (apt_id VARCHAR, facility_code VARCHAR)
Show the total number of rooms of all apartments with facility code "Gym".
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(T2.room_count) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.facility_code = "Gym" Context: CREATE TABLE Apartments (room_count INTEGER, apt_id VARCHAR); CREATE TABLE Apartment_Facilities (apt_id VARCHAR, fa...
SELECT SUM(T2.room_count) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_short_name = "Columbus Square"
CREATE TABLE Apartment_Buildings (building_id VARCHAR, building_short_name VARCHAR); CREATE TABLE Apartments (room_count INTEGER, building_id VARCHAR)
Show the total number of rooms of the apartments in the building with short name "Columbus Square".
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(T2.room_count) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_short_name = "Columbus Square" Context: CREATE TABLE Apartment_Buildings (building_id VARCHAR, building_short_name VARCHAR); CRE...
SELECT T1.building_address FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T2.bathroom_count > 2
CREATE TABLE Apartment_Buildings (building_address VARCHAR, building_id VARCHAR); CREATE TABLE Apartments (building_id VARCHAR, bathroom_count INTEGER)
Show the addresses of the buildings that have apartments with more than 2 bathrooms.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.building_address FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T2.bathroom_count > 2 Context: CREATE TABLE Apartment_Buildings (building_address VARCHAR, building_id VARCHAR); CREATE TABLE Apartments (b...
SELECT T2.apt_type_code, T2.apt_number FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = "Kyle"
CREATE TABLE Apartment_Buildings (building_id VARCHAR, building_manager VARCHAR); CREATE TABLE Apartments (apt_type_code VARCHAR, apt_number VARCHAR, building_id VARCHAR)
Show the apartment type codes and apartment numbers in the buildings managed by "Kyle".
<s>[INST] Given the following SQL query and context: Query: SELECT T2.apt_type_code, T2.apt_number FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = "Kyle" Context: CREATE TABLE Apartment_Buildings (building_id VARCHAR, building_manager VARCHAR); CREATE ...
SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code
CREATE TABLE Apartment_Bookings (booking_status_code VARCHAR)
Show the booking status code and the corresponding number of bookings.
<s>[INST] Given the following SQL query and context: Query: SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code Context: CREATE TABLE Apartment_Bookings (booking_status_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the booking status code...
SELECT apt_number FROM Apartments ORDER BY room_count
CREATE TABLE Apartments (apt_number VARCHAR, room_count VARCHAR)
Return all the apartment numbers sorted by the room count in ascending order.
<s>[INST] Given the following SQL query and context: Query: SELECT apt_number FROM Apartments ORDER BY room_count Context: CREATE TABLE Apartments (apt_number VARCHAR, room_count VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Return all the apartment numbers sorted by the room count in ...
SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1
CREATE TABLE Apartments (apt_number VARCHAR, bedroom_count VARCHAR)
Return the apartment number with the largest number of bedrooms.
<s>[INST] Given the following SQL query and context: Query: SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1 Context: CREATE TABLE Apartments (apt_number VARCHAR, bedroom_count VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Return the apartment number with the large...
SELECT apt_type_code, COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*)
CREATE TABLE Apartments (apt_type_code VARCHAR)
Show the apartment type codes and the corresponding number of apartments sorted by the number of apartments in ascending order.
<s>[INST] Given the following SQL query and context: Query: SELECT apt_type_code, COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) Context: CREATE TABLE Apartments (apt_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the apartment type codes and the corres...
SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY AVG(room_count) DESC LIMIT 3
CREATE TABLE Apartments (apt_type_code VARCHAR, room_count INTEGER)
Show the top 3 apartment type codes sorted by the average number of rooms in descending order.
<s>[INST] Given the following SQL query and context: Query: SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY AVG(room_count) DESC LIMIT 3 Context: CREATE TABLE Apartments (apt_type_code VARCHAR, room_count INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the top 3...
SELECT apt_type_code, bathroom_count, bedroom_count FROM Apartments GROUP BY apt_type_code ORDER BY SUM(room_count) DESC LIMIT 1
CREATE TABLE Apartments (apt_type_code VARCHAR, bathroom_count VARCHAR, bedroom_count VARCHAR, room_count INTEGER)
Show the apartment type code that has the largest number of total rooms, together with the number of bathrooms and number of bedrooms.
<s>[INST] Given the following SQL query and context: Query: SELECT apt_type_code, bathroom_count, bedroom_count FROM Apartments GROUP BY apt_type_code ORDER BY SUM(room_count) DESC LIMIT 1 Context: CREATE TABLE Apartments (apt_type_code VARCHAR, bathroom_count VARCHAR, bedroom_count VARCHAR, room_count INTEGER) [/INST]...
SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Apartments (apt_type_code VARCHAR)
Show the most common apartment type code.
<s>[INST] Given the following SQL query and context: Query: SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Apartments (apt_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the most common apartment type code....
SELECT apt_type_code FROM Apartments WHERE bathroom_count > 1 GROUP BY apt_type_code ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Apartments (apt_type_code VARCHAR, bathroom_count INTEGER)
Show the most common apartment type code among apartments with more than 1 bathroom.
<s>[INST] Given the following SQL query and context: Query: SELECT apt_type_code FROM Apartments WHERE bathroom_count > 1 GROUP BY apt_type_code ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Apartments (apt_type_code VARCHAR, bathroom_count INTEGER) [/INST] Based on the provided SQL query and context, your quest...
SELECT apt_type_code, MAX(room_count), MIN(room_count) FROM Apartments GROUP BY apt_type_code
CREATE TABLE Apartments (apt_type_code VARCHAR, room_count INTEGER)
Show each apartment type code, and the maximum and minimum number of rooms for each type.
<s>[INST] Given the following SQL query and context: Query: SELECT apt_type_code, MAX(room_count), MIN(room_count) FROM Apartments GROUP BY apt_type_code Context: CREATE TABLE Apartments (apt_type_code VARCHAR, room_count INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show each apartmen...
SELECT gender_code, COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC
CREATE TABLE Guests (gender_code VARCHAR)
Show each gender code and the corresponding count of guests sorted by the count in descending order.
<s>[INST] Given the following SQL query and context: Query: SELECT gender_code, COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC Context: CREATE TABLE Guests (gender_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show each gender code and the corresponding count of ...
SELECT COUNT(*) FROM Apartments WHERE NOT apt_id IN (SELECT apt_id FROM Apartment_Facilities)
CREATE TABLE Apartment_Facilities (apt_id VARCHAR); CREATE TABLE Apartments (apt_id VARCHAR)
How many apartments do not have any facility?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Apartments WHERE NOT apt_id IN (SELECT apt_id FROM Apartment_Facilities) Context: CREATE TABLE Apartment_Facilities (apt_id VARCHAR); CREATE TABLE Apartments (apt_id VARCHAR) [/INST] Based on the provided SQL query and context, your questi...
SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Confirmed" INTERSECT SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Provisional"
CREATE TABLE Apartments (apt_number VARCHAR, apt_id VARCHAR); CREATE TABLE Apartment_Bookings (apt_id VARCHAR, booking_status_code VARCHAR)
Show the apartment numbers of apartments with bookings that have status code both "Provisional" and "Confirmed"
<s>[INST] Given the following SQL query and context: Query: SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Confirmed" INTERSECT SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.bo...
SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 0 INTERSECT SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 1
CREATE TABLE View_Unit_Status (apt_id VARCHAR, available_yn VARCHAR); CREATE TABLE Apartments (apt_number VARCHAR, apt_id VARCHAR)
Show the apartment numbers of apartments with unit status availability of both 0 and 1.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 0 INTERSECT SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 1 Contex...
SELECT COUNT(*) FROM game WHERE season > 2007
CREATE TABLE game (season INTEGER)
How many games are held after season 2007?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM game WHERE season > 2007 Context: CREATE TABLE game (season INTEGER) [/INST] Based on the provided SQL query and context, your question is: How many games are held after season 2007? The answer to your question is: SELECT COUNT(*) FROM gam...
SELECT Date FROM game ORDER BY home_team DESC
CREATE TABLE game (Date VARCHAR, home_team VARCHAR)
List the dates of games by the home team name in descending order.
<s>[INST] Given the following SQL query and context: Query: SELECT Date FROM game ORDER BY home_team DESC Context: CREATE TABLE game (Date VARCHAR, home_team VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the dates of games by the home team name in descending order. The answer to y...
SELECT season, home_team, away_team FROM game
CREATE TABLE game (season VARCHAR, home_team VARCHAR, away_team VARCHAR)
List the season, home team, away team of all the games.
<s>[INST] Given the following SQL query and context: Query: SELECT season, home_team, away_team FROM game Context: CREATE TABLE game (season VARCHAR, home_team VARCHAR, away_team VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the season, home team, away team of all the games. The a...
SELECT MAX(home_games), MIN(home_games), AVG(home_games) FROM stadium
CREATE TABLE stadium (home_games INTEGER)
What are the maximum, minimum and average home games each stadium held?
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(home_games), MIN(home_games), AVG(home_games) FROM stadium Context: CREATE TABLE stadium (home_games INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the maximum, minimum and average home games each stadium he...
SELECT average_attendance FROM stadium WHERE capacity_percentage > 100
CREATE TABLE stadium (average_attendance VARCHAR, capacity_percentage INTEGER)
What is the average attendance of stadiums with capacity percentage higher than 100%?
<s>[INST] Given the following SQL query and context: Query: SELECT average_attendance FROM stadium WHERE capacity_percentage > 100 Context: CREATE TABLE stadium (average_attendance VARCHAR, capacity_percentage INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average attendance...
SELECT player, number_of_matches, SOURCE FROM injury_accident WHERE injury <> 'Knee problem'
CREATE TABLE injury_accident (player VARCHAR, number_of_matches VARCHAR, SOURCE VARCHAR, injury VARCHAR)
What are the player name, number of matches, and information source for players who do not suffer from injury of 'Knee problem'?
<s>[INST] Given the following SQL query and context: Query: SELECT player, number_of_matches, SOURCE FROM injury_accident WHERE injury <> 'Knee problem' Context: CREATE TABLE injury_accident (player VARCHAR, number_of_matches VARCHAR, SOURCE VARCHAR, injury VARCHAR) [/INST] Based on the provided SQL query and context, ...
SELECT T1.season FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id WHERE T2.player = 'Walter Samuel'
CREATE TABLE injury_accident (game_id VARCHAR, player VARCHAR); CREATE TABLE game (season VARCHAR, id VARCHAR)
What is the season of the game which causes the player 'Walter Samuel' to get injured?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.season FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id WHERE T2.player = 'Walter Samuel' Context: CREATE TABLE injury_accident (game_id VARCHAR, player VARCHAR); CREATE TABLE game (season VARCHAR, id VARCHAR) [/INST] Based on the pro...
SELECT T1.id, T1.score, T1.date FROM game AS T1 JOIN injury_accident AS T2 ON T2.game_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2
CREATE TABLE game (id VARCHAR, score VARCHAR, date VARCHAR); CREATE TABLE injury_accident (game_id VARCHAR)
What are the ids, scores, and dates of the games which caused at least two injury accidents?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.id, T1.score, T1.date FROM game AS T1 JOIN injury_accident AS T2 ON T2.game_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2 Context: CREATE TABLE game (id VARCHAR, score VARCHAR, date VARCHAR); CREATE TABLE injury_accident (game_id VARCHAR) [/INST] Ba...
SELECT T1.id, T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id JOIN injury_accident AS T3 ON T2.id = T3.game_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE stadium (id VARCHAR, name VARCHAR); CREATE TABLE injury_accident (game_id VARCHAR); CREATE TABLE game (stadium_id VARCHAR, id VARCHAR)
What are the id and name of the stadium where the most injury accidents happened?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.id, T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id JOIN injury_accident AS T3 ON T2.id = T3.game_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE stadium (id VARCHAR, name VARCHAR); CREATE TABLE injury_accid...
SELECT T1.season, T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.injury = 'Foot injury' OR T3.injury = 'Knee problem'
CREATE TABLE stadium (name VARCHAR, id VARCHAR); CREATE TABLE injury_accident (game_id VARCHAR, injury VARCHAR); CREATE TABLE game (season VARCHAR, stadium_id VARCHAR, id VARCHAR)
In which season and which stadium did any player have an injury of 'Foot injury' or 'Knee problem'?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.season, T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.injury = 'Foot injury' OR T3.injury = 'Knee problem' Context: CREATE TABLE stadium (name VARCHAR, id VARCHAR); CREAT...
SELECT COUNT(DISTINCT SOURCE) FROM injury_accident
CREATE TABLE injury_accident (SOURCE VARCHAR)
How many different kinds of information sources are there for injury accidents?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT SOURCE) FROM injury_accident Context: CREATE TABLE injury_accident (SOURCE VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different kinds of information sources are there for injury accidents? The...
SELECT COUNT(*) FROM game WHERE NOT id IN (SELECT game_id FROM injury_accident)
CREATE TABLE injury_accident (id VARCHAR, game_id VARCHAR); CREATE TABLE game (id VARCHAR, game_id VARCHAR)
How many games are free of injury accidents?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM game WHERE NOT id IN (SELECT game_id FROM injury_accident) Context: CREATE TABLE injury_accident (id VARCHAR, game_id VARCHAR); CREATE TABLE game (id VARCHAR, game_id VARCHAR) [/INST] Based on the provided SQL query and context, your quest...
SELECT COUNT(DISTINCT T1.injury) FROM injury_accident AS T1 JOIN game AS T2 ON T1.game_id = T2.id WHERE T2.season > 2010
CREATE TABLE injury_accident (injury VARCHAR, game_id VARCHAR); CREATE TABLE game (id VARCHAR, season INTEGER)
How many distinct kinds of injuries happened after season 2010?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT T1.injury) FROM injury_accident AS T1 JOIN game AS T2 ON T1.game_id = T2.id WHERE T2.season > 2010 Context: CREATE TABLE injury_accident (injury VARCHAR, game_id VARCHAR); CREATE TABLE game (id VARCHAR, season INTEGER) [/INST] Based on th...
SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.player = 'Walter Samuel' INTERSECT SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.player = 'Thiago Mo...
CREATE TABLE stadium (name VARCHAR, id VARCHAR); CREATE TABLE game (stadium_id VARCHAR, id VARCHAR); CREATE TABLE injury_accident (game_id VARCHAR, player VARCHAR)
List the name of the stadium where both the player 'Walter Samuel' and the player 'Thiago Motta' got injured.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.player = 'Walter Samuel' INTERSECT SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accid...
SELECT name, average_attendance, total_attendance FROM stadium EXCEPT SELECT T2.name, T2.average_attendance, T2.total_attendance FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id
CREATE TABLE stadium (name VARCHAR, average_attendance VARCHAR, total_attendance VARCHAR, id VARCHAR); CREATE TABLE stadium (name VARCHAR, average_attendance VARCHAR, total_attendance VARCHAR); CREATE TABLE game (stadium_id VARCHAR, id VARCHAR); CREATE TABLE injury_accident (game_id VARCHAR)
Show the name, average attendance, total attendance for stadiums where no accidents happened.
<s>[INST] Given the following SQL query and context: Query: SELECT name, average_attendance, total_attendance FROM stadium EXCEPT SELECT T2.name, T2.average_attendance, T2.total_attendance FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id Context: CREATE TABLE ...
SELECT name FROM stadium WHERE name LIKE "%Bank%"
CREATE TABLE stadium (name VARCHAR)
Which stadium name contains the substring "Bank"?
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM stadium WHERE name LIKE "%Bank%" Context: CREATE TABLE stadium (name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which stadium name contains the substring "Bank"? The answer to your question is: SELECT name ...
SELECT T1.id, COUNT(*) FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id GROUP BY T1.id
CREATE TABLE stadium (id VARCHAR); CREATE TABLE game (stadium_id VARCHAR)
How many games has each stadium held?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.id, COUNT(*) FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id GROUP BY T1.id Context: CREATE TABLE stadium (id VARCHAR); CREATE TABLE game (stadium_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many...
SELECT T1.date, T2.player FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id ORDER BY T1.season DESC
CREATE TABLE game (date VARCHAR, id VARCHAR, season VARCHAR); CREATE TABLE injury_accident (player VARCHAR, game_id VARCHAR)
For each injury accident, find the date of the game and the name of the injured player in the game, and sort the results in descending order of game season.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.date, T2.player FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id ORDER BY T1.season DESC Context: CREATE TABLE game (date VARCHAR, id VARCHAR, season VARCHAR); CREATE TABLE injury_accident (player VARCHAR, game_id VARCHAR) [/INST] Bas...
SELECT T1.name, T2.name FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id
CREATE TABLE League (name VARCHAR, country_id VARCHAR); CREATE TABLE Country (name VARCHAR, id VARCHAR)
List all country and league names.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name, T2.name FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id Context: CREATE TABLE League (name VARCHAR, country_id VARCHAR); CREATE TABLE Country (name VARCHAR, id VARCHAR) [/INST] Based on the provided SQL query and context, your que...
SELECT COUNT(*) FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id WHERE T1.name = "England"
CREATE TABLE League (country_id VARCHAR); CREATE TABLE Country (id VARCHAR, name VARCHAR)
How many leagues are there in England?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id WHERE T1.name = "England" Context: CREATE TABLE League (country_id VARCHAR); CREATE TABLE Country (id VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your...
SELECT AVG(weight) FROM Player
CREATE TABLE Player (weight INTEGER)
What is the average weight of all players?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(weight) FROM Player Context: CREATE TABLE Player (weight INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average weight of all players? The answer to your question is: SELECT AVG(weight) FROM Player. [/s>
SELECT MAX(weight), MIN(weight) FROM Player
CREATE TABLE Player (weight INTEGER)
What is the maximum and minimum height of all players?
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(weight), MIN(weight) FROM Player Context: CREATE TABLE Player (weight INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the maximum and minimum height of all players? The answer to your question is: SELECT MAX(w...
SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.overall_rating > (SELECT AVG(overall_rating) FROM Player_Attributes)
CREATE TABLE Player (player_name VARCHAR, player_api_id VARCHAR); CREATE TABLE Player_Attributes (overall_rating INTEGER); CREATE TABLE Player_Attributes (player_api_id VARCHAR, overall_rating INTEGER)
List all player names who have an overall rating higher than the average.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.overall_rating > (SELECT AVG(overall_rating) FROM Player_Attributes) Context: CREATE TABLE Player (player_name VARCHAR, player_api_id ...
SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.dribbling = (SELECT MAX(overall_rating) FROM Player_Attributes)
CREATE TABLE Player (player_name VARCHAR, player_api_id VARCHAR); CREATE TABLE Player_Attributes (player_api_id VARCHAR, dribbling VARCHAR); CREATE TABLE Player_Attributes (overall_rating INTEGER)
What are the names of players who have the best dribbling?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.dribbling = (SELECT MAX(overall_rating) FROM Player_Attributes) Context: CREATE TABLE Player (player_name VARCHAR, player_api_id VARCH...
SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.crossing > 90 AND T2.preferred_foot = "right"
CREATE TABLE Player (player_name VARCHAR, player_api_id VARCHAR); CREATE TABLE Player_Attributes (player_api_id VARCHAR, crossing VARCHAR, preferred_foot VARCHAR)
List the names of all players who have a crossing score higher than 90 and prefer their right foot.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.crossing > 90 AND T2.preferred_foot = "right" Context: CREATE TABLE Player (player_name VARCHAR, player_api_id VARCHAR); CREATE TABLE ...
SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.preferred_foot = "left" AND T2.overall_rating >= 85 AND T2.overall_rating <= 90
CREATE TABLE Player (player_name VARCHAR, player_api_id VARCHAR); CREATE TABLE Player_Attributes (player_api_id VARCHAR, overall_rating VARCHAR, preferred_foot VARCHAR)
List the names of all left-footed players who have overall rating between 85 and 90.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.preferred_foot = "left" AND T2.overall_rating >= 85 AND T2.overall_rating <= 90 Context: CREATE TABLE Player (player_name VARCHAR, pla...
SELECT preferred_foot, AVG(overall_rating) FROM Player_Attributes GROUP BY preferred_foot
CREATE TABLE Player_Attributes (preferred_foot VARCHAR, overall_rating INTEGER)
What is the average rating for right-footed players and left-footed players?
<s>[INST] Given the following SQL query and context: Query: SELECT preferred_foot, AVG(overall_rating) FROM Player_Attributes GROUP BY preferred_foot Context: CREATE TABLE Player_Attributes (preferred_foot VARCHAR, overall_rating INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is th...
SELECT preferred_foot, COUNT(*) FROM Player_Attributes WHERE overall_rating > 80 GROUP BY preferred_foot
CREATE TABLE Player_Attributes (preferred_foot VARCHAR, overall_rating INTEGER)
Of all players with an overall rating greater than 80, how many are right-footed and left-footed?
<s>[INST] Given the following SQL query and context: Query: SELECT preferred_foot, COUNT(*) FROM Player_Attributes WHERE overall_rating > 80 GROUP BY preferred_foot Context: CREATE TABLE Player_Attributes (preferred_foot VARCHAR, overall_rating INTEGER) [/INST] Based on the provided SQL query and context, your question...
SELECT player_api_id FROM Player WHERE height >= 180 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE overall_rating > 85
CREATE TABLE Player_Attributes (player_api_id VARCHAR, height VARCHAR, overall_rating INTEGER); CREATE TABLE Player (player_api_id VARCHAR, height VARCHAR, overall_rating INTEGER)
List all of the player ids with a height of at least 180cm and an overall rating higher than 85.
<s>[INST] Given the following SQL query and context: Query: SELECT player_api_id FROM Player WHERE height >= 180 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE overall_rating > 85 Context: CREATE TABLE Player_Attributes (player_api_id VARCHAR, height VARCHAR, overall_rating INTEGER); CREATE TABLE Player (p...
SELECT player_api_id FROM Player WHERE height >= 180 AND height <= 190 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE preferred_foot = "left"
CREATE TABLE Player_Attributes (player_api_id VARCHAR, preferred_foot VARCHAR, height VARCHAR); CREATE TABLE Player (player_api_id VARCHAR, preferred_foot VARCHAR, height VARCHAR)
List all of the ids for left-footed players with a height between 180cm and 190cm.
<s>[INST] Given the following SQL query and context: Query: SELECT player_api_id FROM Player WHERE height >= 180 AND height <= 190 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE preferred_foot = "left" Context: CREATE TABLE Player_Attributes (player_api_id VARCHAR, preferred_foot VARCHAR, height VARCHAR); ...
SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY overall_rating DESC LIMIT 3
CREATE TABLE Player (player_name VARCHAR, player_api_id VARCHAR); CREATE TABLE Player_Attributes (player_api_id VARCHAR)
Who are the top 3 players in terms of overall rating?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY overall_rating DESC LIMIT 3 Context: CREATE TABLE Player (player_name VARCHAR, player_api_id VARCHAR); CREATE TABLE Player_Attributes ...
SELECT DISTINCT T1.player_name, T1.birthday FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY potential DESC LIMIT 5
CREATE TABLE Player_Attributes (player_api_id VARCHAR); CREATE TABLE Player (player_name VARCHAR, birthday VARCHAR, player_api_id VARCHAR)
List the names and birthdays of the top five players in terms of potential.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.player_name, T1.birthday FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY potential DESC LIMIT 5 Context: CREATE TABLE Player_Attributes (player_api_id VARCHAR); CREATE TABLE Player (player_name ...
SELECT COUNT(*) FROM performance
CREATE TABLE performance (Id VARCHAR)
How many performances are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM performance Context: CREATE TABLE performance (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many performances are there? The answer to your question is: SELECT COUNT(*) FROM performance. [/s>
SELECT HOST FROM performance ORDER BY Attendance
CREATE TABLE performance (HOST VARCHAR, Attendance VARCHAR)
List the hosts of performances in ascending order of attendance.
<s>[INST] Given the following SQL query and context: Query: SELECT HOST FROM performance ORDER BY Attendance Context: CREATE TABLE performance (HOST VARCHAR, Attendance VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the hosts of performances in ascending order of attendance. The an...
SELECT Date, LOCATION FROM performance
CREATE TABLE performance (Date VARCHAR, LOCATION VARCHAR)
What are the dates and locations of performances?
<s>[INST] Given the following SQL query and context: Query: SELECT Date, LOCATION FROM performance Context: CREATE TABLE performance (Date VARCHAR, LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the dates and locations of performances? The answer to your question is: S...
SELECT Attendance FROM performance WHERE LOCATION = "TD Garden" OR LOCATION = "Bell Centre"
CREATE TABLE performance (Attendance VARCHAR, LOCATION VARCHAR)
Show the attendances of the performances at location "TD Garden" or "Bell Centre"
<s>[INST] Given the following SQL query and context: Query: SELECT Attendance FROM performance WHERE LOCATION = "TD Garden" OR LOCATION = "Bell Centre" Context: CREATE TABLE performance (Attendance VARCHAR, LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the attendances of ...
SELECT AVG(Attendance) FROM performance
CREATE TABLE performance (Attendance INTEGER)
What is the average number of attendees for performances?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(Attendance) FROM performance Context: CREATE TABLE performance (Attendance INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average number of attendees for performances? The answer to your question is: SELE...
SELECT Date FROM performance ORDER BY Attendance DESC LIMIT 1
CREATE TABLE performance (Date VARCHAR, Attendance VARCHAR)
What is the date of the performance with the highest number of attendees?
<s>[INST] Given the following SQL query and context: Query: SELECT Date FROM performance ORDER BY Attendance DESC LIMIT 1 Context: CREATE TABLE performance (Date VARCHAR, Attendance VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the date of the performance with the highest numbe...
SELECT LOCATION, COUNT(*) FROM performance GROUP BY LOCATION
CREATE TABLE performance (LOCATION VARCHAR)
Show different locations and the number of performances at each location.
<s>[INST] Given the following SQL query and context: Query: SELECT LOCATION, COUNT(*) FROM performance GROUP BY LOCATION Context: CREATE TABLE performance (LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show different locations and the number of performances at each location. T...
SELECT LOCATION FROM performance GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE performance (LOCATION VARCHAR)
Show the most common location of performances.
<s>[INST] Given the following SQL query and context: Query: SELECT LOCATION FROM performance GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE performance (LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the most common location of performances. The ans...
SELECT LOCATION FROM performance GROUP BY LOCATION HAVING COUNT(*) >= 2
CREATE TABLE performance (LOCATION VARCHAR)
Show the locations that have at least two performances.
<s>[INST] Given the following SQL query and context: Query: SELECT LOCATION FROM performance GROUP BY LOCATION HAVING COUNT(*) >= 2 Context: CREATE TABLE performance (LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the locations that have at least two performances. The answ...
SELECT LOCATION FROM performance WHERE Attendance > 2000 INTERSECT SELECT LOCATION FROM performance WHERE Attendance < 1000
CREATE TABLE performance (LOCATION VARCHAR, Attendance INTEGER)
Show the locations that have both performances with more than 2000 attendees and performances with less than 1000 attendees.
<s>[INST] Given the following SQL query and context: Query: SELECT LOCATION FROM performance WHERE Attendance > 2000 INTERSECT SELECT LOCATION FROM performance WHERE Attendance < 1000 Context: CREATE TABLE performance (LOCATION VARCHAR, Attendance INTEGER) [/INST] Based on the provided SQL query and context, your quest...
SELECT T2.Name, T3.Location FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID
CREATE TABLE performance (Location VARCHAR, Performance_ID VARCHAR); CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE member_attendance (Member_ID VARCHAR, Performance_ID VARCHAR)
Show the names of members and the location of the performances they attended.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Name, T3.Location FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID Context: CREATE TABLE performance (Location VARCHAR, Performance_ID VARCHAR); CREATE TABLE...
SELECT T2.Name, T3.Location FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID ORDER BY T2.Name
CREATE TABLE performance (Location VARCHAR, Performance_ID VARCHAR); CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE member_attendance (Member_ID VARCHAR, Performance_ID VARCHAR)
Show the names of members and the location of performances they attended in ascending alphabetical order of their names.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Name, T3.Location FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID ORDER BY T2.Name Context: CREATE TABLE performance (Location VARCHAR, Performance_ID VARCH...
SELECT T3.Date FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID WHERE T2.Role = "Violin"
CREATE TABLE performance (Date VARCHAR, Performance_ID VARCHAR); CREATE TABLE member (Member_ID VARCHAR, Role VARCHAR); CREATE TABLE member_attendance (Member_ID VARCHAR, Performance_ID VARCHAR)
Show the dates of performances with attending members whose roles are "Violin".
<s>[INST] Given the following SQL query and context: Query: SELECT T3.Date FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID WHERE T2.Role = "Violin" Context: CREATE TABLE performance (Date VARCHAR, Performance_ID VARCHAR); CREA...
SELECT T2.Name, T3.Date FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID ORDER BY T3.Attendance DESC
CREATE TABLE performance (Date VARCHAR, Performance_ID VARCHAR, Attendance VARCHAR); CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE member_attendance (Member_ID VARCHAR, Performance_ID VARCHAR)
Show the names of members and the dates of performances they attended in descending order of attendance of the performances.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Name, T3.Date FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID ORDER BY T3.Attendance DESC Context: CREATE TABLE performance (Date VARCHAR, Performance_ID VA...
SELECT Name FROM member WHERE NOT Member_ID IN (SELECT Member_ID FROM member_attendance)
CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE member_attendance (Name VARCHAR, Member_ID VARCHAR)
List the names of members who did not attend any performance.
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM member WHERE NOT Member_ID IN (SELECT Member_ID FROM member_attendance) Context: CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE member_attendance (Name VARCHAR, Member_ID VARCHAR) [/INST] Based on the provided SQL query an...
SELECT DISTINCT building FROM classroom WHERE capacity > 50
CREATE TABLE classroom (building VARCHAR, capacity INTEGER)
Find the buildings which have rooms with capacity more than 50.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT building FROM classroom WHERE capacity > 50 Context: CREATE TABLE classroom (building VARCHAR, capacity INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the buildings which have rooms with capacity more than ...
SELECT COUNT(*) FROM classroom WHERE building <> 'Lamberton'
CREATE TABLE classroom (building VARCHAR)
Count the number of rooms that are not in the Lamberton building.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM classroom WHERE building <> 'Lamberton' Context: CREATE TABLE classroom (building VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Count the number of rooms that are not in the Lamberton building. The answer ...
SELECT dept_name, building FROM department WHERE budget > (SELECT AVG(budget) FROM department)
CREATE TABLE department (dept_name VARCHAR, building VARCHAR, budget INTEGER)
What is the name and building of the departments whose budget is more than the average budget?
<s>[INST] Given the following SQL query and context: Query: SELECT dept_name, building FROM department WHERE budget > (SELECT AVG(budget) FROM department) Context: CREATE TABLE department (dept_name VARCHAR, building VARCHAR, budget INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is...
SELECT building, room_number FROM classroom WHERE capacity BETWEEN 50 AND 100
CREATE TABLE classroom (building VARCHAR, room_number VARCHAR, capacity INTEGER)
Find the room number of the rooms which can sit 50 to 100 students and their buildings.
<s>[INST] Given the following SQL query and context: Query: SELECT building, room_number FROM classroom WHERE capacity BETWEEN 50 AND 100 Context: CREATE TABLE classroom (building VARCHAR, room_number VARCHAR, capacity INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the room number ...
SELECT dept_name, building FROM department ORDER BY budget DESC LIMIT 1
CREATE TABLE department (dept_name VARCHAR, building VARCHAR, budget VARCHAR)
Find the name and building of the department with the highest budget.
<s>[INST] Given the following SQL query and context: Query: SELECT dept_name, building FROM department ORDER BY budget DESC LIMIT 1 Context: CREATE TABLE department (dept_name VARCHAR, building VARCHAR, budget VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name and building of ...
SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1
CREATE TABLE student (name VARCHAR, dept_name VARCHAR, tot_cred VARCHAR)
What is the name of the student who has the highest total credits in the History department.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1 Context: CREATE TABLE student (name VARCHAR, dept_name VARCHAR, tot_cred VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of the...
SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton'
CREATE TABLE classroom (building VARCHAR)
How many rooms does the Lamberton building have?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton' Context: CREATE TABLE classroom (building VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many rooms does the Lamberton building have? The answer to your question i...
SELECT COUNT(DISTINCT s_id) FROM advisor
CREATE TABLE advisor (s_id VARCHAR)
How many students have advisors?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT s_id) FROM advisor Context: CREATE TABLE advisor (s_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many students have advisors? The answer to your question is: SELECT COUNT(DISTINCT s_id) FROM advis...
SELECT COUNT(DISTINCT dept_name) FROM course
CREATE TABLE course (dept_name VARCHAR)
How many departments offer courses?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT dept_name) FROM course Context: CREATE TABLE course (dept_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many departments offer courses? The answer to your question is: SELECT COUNT(DISTINCT dept_...
SELECT COUNT(DISTINCT course_id) FROM course WHERE dept_name = 'Physics'
CREATE TABLE course (course_id VARCHAR, dept_name VARCHAR)
How many different courses offered by Physics department?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT course_id) FROM course WHERE dept_name = 'Physics' Context: CREATE TABLE course (course_id VARCHAR, dept_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different courses offered by Physics de...
SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING COUNT(*) = 2
CREATE TABLE prereq (course_id VARCHAR); CREATE TABLE course (title VARCHAR, course_id VARCHAR)
Find the title of courses that have two prerequisites?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING COUNT(*) = 2 Context: CREATE TABLE prereq (course_id VARCHAR); CREATE TABLE course (title VARCHAR, course_id VARCHAR) [/INST] Based on the provided ...
SELECT T1.title, T1.credits, T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING COUNT(*) > 1
CREATE TABLE prereq (course_id VARCHAR); CREATE TABLE course (title VARCHAR, credits VARCHAR, dept_name VARCHAR, course_id VARCHAR)
Find the title, credit, and department name of courses that have more than one prerequisites?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.title, T1.credits, T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING COUNT(*) > 1 Context: CREATE TABLE prereq (course_id VARCHAR); CREATE TABLE course (title VARCHAR, credits VARCHAR, dept_n...
SELECT COUNT(*) FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq)
CREATE TABLE prereq (course_id VARCHAR); CREATE TABLE course (course_id VARCHAR)
How many courses that do not have prerequisite?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq) Context: CREATE TABLE prereq (course_id VARCHAR); CREATE TABLE course (course_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many courses ...
SELECT title FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq)
CREATE TABLE prereq (title VARCHAR, course_id VARCHAR); CREATE TABLE course (title VARCHAR, course_id VARCHAR)
Find the name of the courses that do not have any prerequisite?
<s>[INST] Given the following SQL query and context: Query: SELECT title FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq) Context: CREATE TABLE prereq (title VARCHAR, course_id VARCHAR); CREATE TABLE course (title VARCHAR, course_id VARCHAR) [/INST] Based on the provided SQL query and context, your que...
SELECT COUNT(DISTINCT id) FROM teaches
CREATE TABLE teaches (id VARCHAR)
How many different instructors have taught some course?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT id) FROM teaches Context: CREATE TABLE teaches (id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different instructors have taught some course? The answer to your question is: SELECT COUNT(DISTIN...
SELECT SUM(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance'
CREATE TABLE department (budget INTEGER, dept_name VARCHAR)
Find the total budgets of the Marketing or Finance department.
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance' Context: CREATE TABLE department (budget INTEGER, dept_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the total budgets of the ...
SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'
CREATE TABLE instructor (dept_name VARCHAR, name VARCHAR)
Find the department name of the instructor whose name contains 'Soisalon'.
<s>[INST] Given the following SQL query and context: Query: SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%' Context: CREATE TABLE instructor (dept_name VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the department name of the instructor whose name contai...
SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50
CREATE TABLE classroom (building VARCHAR, capacity VARCHAR)
How many rooms whose capacity is less than 50 does the Lamberton building have?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50 Context: CREATE TABLE classroom (building VARCHAR, capacity VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many rooms whose capacity is less than...
SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department)
CREATE TABLE department (dept_name VARCHAR, budget INTEGER)
Find the name and budget of departments whose budgets are more than the average budget.
<s>[INST] Given the following SQL query and context: Query: SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department) Context: CREATE TABLE department (dept_name VARCHAR, budget INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the name and budget of...
SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary LIMIT 1
CREATE TABLE instructor (name VARCHAR, dept_name VARCHAR, salary VARCHAR)
what is the name of the instructor who is in Statistics department and earns the lowest salary?
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary LIMIT 1 Context: CREATE TABLE instructor (name VARCHAR, dept_name VARCHAR, salary VARCHAR) [/INST] Based on the provided SQL query and context, your question is: what is the name of the...
SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology'
CREATE TABLE course (title VARCHAR, dept_name VARCHAR)
Find the title of course that is provided by both Statistics and Psychology departments.
<s>[INST] Given the following SQL query and context: Query: SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology' Context: CREATE TABLE course (title VARCHAR, dept_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Fin...
SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology'
CREATE TABLE course (title VARCHAR, dept_name VARCHAR)
Find the title of course that is provided by Statistics but not Psychology departments.
<s>[INST] Given the following SQL query and context: Query: SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology' Context: CREATE TABLE course (title VARCHAR, dept_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find t...
SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010
CREATE TABLE teaches (id VARCHAR, semester VARCHAR, YEAR VARCHAR)
Find the id of instructors who taught a class in Fall 2009 but not in Spring 2010.
<s>[INST] Given the following SQL query and context: Query: SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010 Context: CREATE TABLE teaches (id VARCHAR, semester VARCHAR, YEAR VARCHAR) [/INST] Based on the provided SQL query and contex...
SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010
CREATE TABLE student (name VARCHAR, id VARCHAR); CREATE TABLE takes (id VARCHAR)
Find the name of students who took any class in the years of 2009 and 2010.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010 Context: CREATE TABLE student (name VARCHAR, id VARCHAR); CREATE TABLE takes (id VARCHAR) [/INST] Based on the provided SQL query and context, your qu...
SELECT dept_name FROM course GROUP BY dept_name ORDER BY COUNT(*) DESC LIMIT 3
CREATE TABLE course (dept_name VARCHAR)
Find the names of the top 3 departments that provide the largest amount of courses?
<s>[INST] Given the following SQL query and context: Query: SELECT dept_name FROM course GROUP BY dept_name ORDER BY COUNT(*) DESC LIMIT 3 Context: CREATE TABLE course (dept_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of the top 3 departments that provide the larg...
SELECT dept_name FROM course GROUP BY dept_name ORDER BY SUM(credits) DESC LIMIT 1
CREATE TABLE course (dept_name VARCHAR, credits INTEGER)
Find the name of the department that offers the highest total credits?
<s>[INST] Given the following SQL query and context: Query: SELECT dept_name FROM course GROUP BY dept_name ORDER BY SUM(credits) DESC LIMIT 1 Context: CREATE TABLE course (dept_name VARCHAR, credits INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the name of the department that off...
SELECT title FROM course ORDER BY title, credits
CREATE TABLE course (title VARCHAR, credits VARCHAR)
List the names of all courses ordered by their titles and credits.
<s>[INST] Given the following SQL query and context: Query: SELECT title FROM course ORDER BY title, credits Context: CREATE TABLE course (title VARCHAR, credits VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of all courses ordered by their titles and credits. The answer ...
SELECT dept_name FROM department ORDER BY budget LIMIT 1
CREATE TABLE department (dept_name VARCHAR, budget VARCHAR)
Which department has the lowest budget?
<s>[INST] Given the following SQL query and context: Query: SELECT dept_name FROM department ORDER BY budget LIMIT 1 Context: CREATE TABLE department (dept_name VARCHAR, budget VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which department has the lowest budget? The answer to your ques...
SELECT dept_name, building FROM department ORDER BY budget DESC
CREATE TABLE department (dept_name VARCHAR, building VARCHAR, budget VARCHAR)
List the names and buildings of all departments sorted by the budget from large to small.
<s>[INST] Given the following SQL query and context: Query: SELECT dept_name, building FROM department ORDER BY budget DESC Context: CREATE TABLE department (dept_name VARCHAR, building VARCHAR, budget VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names and buildings of all de...
SELECT name FROM instructor ORDER BY salary DESC LIMIT 1
CREATE TABLE instructor (name VARCHAR, salary VARCHAR)
Who is the instructor with the highest salary?
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM instructor ORDER BY salary DESC LIMIT 1 Context: CREATE TABLE instructor (name VARCHAR, salary VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Who is the instructor with the highest salary? The answer to your qu...
SELECT * FROM instructor ORDER BY salary
CREATE TABLE instructor (salary VARCHAR)
List the information of all instructors ordered by their salary in ascending order.
<s>[INST] Given the following SQL query and context: Query: SELECT * FROM instructor ORDER BY salary Context: CREATE TABLE instructor (salary VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the information of all instructors ordered by their salary in ascending order. The answer to ...
SELECT name, dept_name FROM student ORDER BY tot_cred
CREATE TABLE student (name VARCHAR, dept_name VARCHAR, tot_cred VARCHAR)
Find the name of the students and their department names sorted by their total credits in ascending order.
<s>[INST] Given the following SQL query and context: Query: SELECT name, dept_name FROM student ORDER BY tot_cred Context: CREATE TABLE student (name VARCHAR, dept_name VARCHAR, tot_cred VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of the students and their department na...
SELECT T1.title, T3.name FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.id = T3.id WHERE YEAR = 2008 ORDER BY T1.title
CREATE TABLE course (title VARCHAR, course_id VARCHAR); CREATE TABLE teaches (course_id VARCHAR, id VARCHAR); CREATE TABLE instructor (name VARCHAR, id VARCHAR)
list in alphabetic order all course names and their instructors' names in year 2008.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.title, T3.name FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.id = T3.id WHERE YEAR = 2008 ORDER BY T1.title Context: CREATE TABLE course (title VARCHAR, course_id VARCHAR); CREATE TABLE teaches (cours...