instruction
stringlengths 12
244
| input
stringlengths 27
489
| output
stringlengths 18
557
| text
stringlengths 194
1.14k
|
---|---|---|---|
What are the official languages of the countries of players from Maryland or Duke college? | CREATE TABLE country (Official_native_language VARCHAR, Country_id VARCHAR); CREATE TABLE match_season (Country VARCHAR, College VARCHAR) | SELECT T1.Official_native_language FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.College = "Maryland" OR T2.College = "Duke" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE country (Official_native_language VARCHAR, Country_id VARCHAR); CREATE TABLE match_season (Country VARCHAR, College VARCHAR) Question: What are the official languages of the countries of players from Maryland or Duke college? [/INST] SELECT T1.Official_native_language FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.College = "Maryland" OR T2.College = "Duke" </s> |
How many distinct official languages are there among countries of players whose positions are defenders. | CREATE TABLE country (Official_native_language VARCHAR, Country_id VARCHAR); CREATE TABLE match_season (Country VARCHAR, Position VARCHAR) | SELECT COUNT(DISTINCT T1.Official_native_language) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Defender" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE country (Official_native_language VARCHAR, Country_id VARCHAR); CREATE TABLE match_season (Country VARCHAR, Position VARCHAR) Question: How many distinct official languages are there among countries of players whose positions are defenders. [/INST] SELECT COUNT(DISTINCT T1.Official_native_language) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Defender" </s> |
Show the season, the player, and the name of the team that players belong to. | CREATE TABLE team (Name VARCHAR, Team_id VARCHAR); CREATE TABLE match_season (Season VARCHAR, Player VARCHAR, Team VARCHAR) | SELECT T1.Season, T1.Player, T2.Name FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE team (Name VARCHAR, Team_id VARCHAR); CREATE TABLE match_season (Season VARCHAR, Player VARCHAR, Team VARCHAR) Question: Show the season, the player, and the name of the team that players belong to. [/INST] SELECT T1.Season, T1.Player, T2.Name FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id </s> |
Show the positions of the players from the team with name "Ryley Goldner". | CREATE TABLE match_season (Position VARCHAR, Team VARCHAR); CREATE TABLE team (Team_id VARCHAR, Name VARCHAR) | SELECT T1.Position FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Ryley Goldner" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE match_season (Position VARCHAR, Team VARCHAR); CREATE TABLE team (Team_id VARCHAR, Name VARCHAR) Question: Show the positions of the players from the team with name "Ryley Goldner". [/INST] SELECT T1.Position FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Ryley Goldner" </s> |
How many distinct colleges are associated with players from the team with name "Columbus Crew". | CREATE TABLE match_season (College VARCHAR, Team VARCHAR); CREATE TABLE team (Team_id VARCHAR, Name VARCHAR) | SELECT COUNT(DISTINCT T1.College) FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Columbus Crew" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE match_season (College VARCHAR, Team VARCHAR); CREATE TABLE team (Team_id VARCHAR, Name VARCHAR) Question: How many distinct colleges are associated with players from the team with name "Columbus Crew". [/INST] SELECT COUNT(DISTINCT T1.College) FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Columbus Crew" </s> |
Show the players and years played for players from team "Columbus Crew". | CREATE TABLE player (Player VARCHAR, Years_Played VARCHAR, Team VARCHAR); CREATE TABLE team (Team_id VARCHAR, Name VARCHAR) | SELECT T1.Player, T1.Years_Played FROM player AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Columbus Crew" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE player (Player VARCHAR, Years_Played VARCHAR, Team VARCHAR); CREATE TABLE team (Team_id VARCHAR, Name VARCHAR) Question: Show the players and years played for players from team "Columbus Crew". [/INST] SELECT T1.Player, T1.Years_Played FROM player AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Columbus Crew" </s> |
Show the position of players and the corresponding number of players. | CREATE TABLE match_season (POSITION VARCHAR) | SELECT POSITION, COUNT(*) FROM match_season GROUP BY POSITION | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE match_season (POSITION VARCHAR) Question: Show the position of players and the corresponding number of players. [/INST] SELECT POSITION, COUNT(*) FROM match_season GROUP BY POSITION </s> |
Show the country names and the corresponding number of players. | CREATE TABLE match_season (Country VARCHAR); CREATE TABLE country (Country_name VARCHAR, Country_id VARCHAR) | SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE match_season (Country VARCHAR); CREATE TABLE country (Country_name VARCHAR, Country_id VARCHAR) Question: Show the country names and the corresponding number of players. [/INST] SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name </s> |
Return all players sorted by college in ascending alphabetical order. | CREATE TABLE match_season (player VARCHAR, College VARCHAR) | SELECT player FROM match_season ORDER BY College | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE match_season (player VARCHAR, College VARCHAR) Question: Return all players sorted by college in ascending alphabetical order. [/INST] SELECT player FROM match_season ORDER BY College </s> |
Show the most common position of players in match seasons. | CREATE TABLE match_season (POSITION VARCHAR) | SELECT TOP 1 POSITION FROM match_season GROUP BY POSITION ORDER BY COUNT(*) DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE match_season (POSITION VARCHAR) Question: Show the most common position of players in match seasons. [/INST] SELECT TOP 1 POSITION FROM match_season GROUP BY POSITION ORDER BY COUNT(*) DESC </s> |
Show the top 3 most common colleges of players in match seasons. | CREATE TABLE match_season (College VARCHAR) | SELECT TOP 3 College FROM match_season GROUP BY College ORDER BY COUNT(*) DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE match_season (College VARCHAR) Question: Show the top 3 most common colleges of players in match seasons. [/INST] SELECT TOP 3 College FROM match_season GROUP BY College ORDER BY COUNT(*) DESC </s> |
Show the name of colleges that have at least two players. | CREATE TABLE match_season (College VARCHAR) | SELECT College FROM match_season GROUP BY College HAVING COUNT(*) >= 2 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE match_season (College VARCHAR) Question: Show the name of colleges that have at least two players. [/INST] SELECT College FROM match_season GROUP BY College HAVING COUNT(*) >= 2 </s> |
Show the name of colleges that have at least two players in descending alphabetical order. | CREATE TABLE match_season (College VARCHAR) | SELECT College FROM match_season GROUP BY College HAVING COUNT(*) >= 2 ORDER BY College DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE match_season (College VARCHAR) Question: Show the name of colleges that have at least two players in descending alphabetical order. [/INST] SELECT College FROM match_season GROUP BY College HAVING COUNT(*) >= 2 ORDER BY College DESC </s> |
What are the names of teams that do no have match season record? | CREATE TABLE match_season (Name VARCHAR, Team_id VARCHAR, Team VARCHAR); CREATE TABLE team (Name VARCHAR, Team_id VARCHAR, Team VARCHAR) | SELECT Name FROM team WHERE NOT Team_id IN (SELECT Team FROM match_season) | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE match_season (Name VARCHAR, Team_id VARCHAR, Team VARCHAR); CREATE TABLE team (Name VARCHAR, Team_id VARCHAR, Team VARCHAR) Question: What are the names of teams that do no have match season record? [/INST] SELECT Name FROM team WHERE NOT Team_id IN (SELECT Team FROM match_season) </s> |
What are the names of countries that have both players with position forward and players with position defender? | CREATE TABLE country (Country_name VARCHAR, Country_id VARCHAR); CREATE TABLE match_season (Country VARCHAR, Position VARCHAR) | SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Forward" INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Defender" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE country (Country_name VARCHAR, Country_id VARCHAR); CREATE TABLE match_season (Country VARCHAR, Position VARCHAR) Question: What are the names of countries that have both players with position forward and players with position defender? [/INST] SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Forward" INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Defender" </s> |
Which college have both players with position midfielder and players with position defender? | CREATE TABLE match_season (College VARCHAR, POSITION VARCHAR) | SELECT College FROM match_season WHERE POSITION = "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION = "Defender" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE match_season (College VARCHAR, POSITION VARCHAR) Question: Which college have both players with position midfielder and players with position defender? [/INST] SELECT College FROM match_season WHERE POSITION = "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION = "Defender" </s> |
How many climbers are there? | CREATE TABLE climber (Id VARCHAR) | SELECT COUNT(*) FROM climber | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE climber (Id VARCHAR) Question: How many climbers are there? [/INST] SELECT COUNT(*) FROM climber </s> |
List the names of climbers in descending order of points. | CREATE TABLE climber (Name VARCHAR, Points VARCHAR) | SELECT Name FROM climber ORDER BY Points DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE climber (Name VARCHAR, Points VARCHAR) Question: List the names of climbers in descending order of points. [/INST] SELECT Name FROM climber ORDER BY Points DESC </s> |
List the names of climbers whose country is not Switzerland. | CREATE TABLE climber (Name VARCHAR, Country VARCHAR) | SELECT Name FROM climber WHERE Country <> "Switzerland" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE climber (Name VARCHAR, Country VARCHAR) Question: List the names of climbers whose country is not Switzerland. [/INST] SELECT Name FROM climber WHERE Country <> "Switzerland" </s> |
What is the maximum point for climbers whose country is United Kingdom? | CREATE TABLE climber (Points INTEGER, Country VARCHAR) | SELECT MAX(Points) FROM climber WHERE Country = "United Kingdom" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE climber (Points INTEGER, Country VARCHAR) Question: What is the maximum point for climbers whose country is United Kingdom? [/INST] SELECT MAX(Points) FROM climber WHERE Country = "United Kingdom" </s> |
How many distinct countries are the climbers from? | CREATE TABLE climber (Country VARCHAR) | SELECT COUNT(DISTINCT Country) FROM climber | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE climber (Country VARCHAR) Question: How many distinct countries are the climbers from? [/INST] SELECT COUNT(DISTINCT Country) FROM climber </s> |
What are the names of mountains in ascending alphabetical order? | CREATE TABLE mountain (Name VARCHAR) | SELECT Name FROM mountain ORDER BY Name | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE mountain (Name VARCHAR) Question: What are the names of mountains in ascending alphabetical order? [/INST] SELECT Name FROM mountain ORDER BY Name </s> |
What are the countries of mountains with height bigger than 5000? | CREATE TABLE mountain (Country VARCHAR, Height INTEGER) | SELECT Country FROM mountain WHERE Height > 5000 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE mountain (Country VARCHAR, Height INTEGER) Question: What are the countries of mountains with height bigger than 5000? [/INST] SELECT Country FROM mountain WHERE Height > 5000 </s> |
What is the name of the highest mountain? | CREATE TABLE mountain (Name VARCHAR, Height VARCHAR) | SELECT TOP 1 Name FROM mountain ORDER BY Height DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE mountain (Name VARCHAR, Height VARCHAR) Question: What is the name of the highest mountain? [/INST] SELECT TOP 1 Name FROM mountain ORDER BY Height DESC </s> |
List the distinct ranges of the mountains with the top 3 prominence. | CREATE TABLE mountain (Range VARCHAR, Prominence VARCHAR) | SELECT DISTINCT TOP 3 Range FROM mountain ORDER BY Prominence DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE mountain (Range VARCHAR, Prominence VARCHAR) Question: List the distinct ranges of the mountains with the top 3 prominence. [/INST] SELECT DISTINCT TOP 3 Range FROM mountain ORDER BY Prominence DESC </s> |
Show names of climbers and the names of mountains they climb. | CREATE TABLE mountain (Name VARCHAR, Mountain_ID VARCHAR); CREATE TABLE climber (Name VARCHAR, Mountain_ID VARCHAR) | SELECT T1.Name, T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE mountain (Name VARCHAR, Mountain_ID VARCHAR); CREATE TABLE climber (Name VARCHAR, Mountain_ID VARCHAR) Question: Show names of climbers and the names of mountains they climb. [/INST] SELECT T1.Name, T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID </s> |
Show the names of climbers and the heights of mountains they climb. | CREATE TABLE mountain (Height VARCHAR, Mountain_ID VARCHAR); CREATE TABLE climber (Name VARCHAR, Mountain_ID VARCHAR) | SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE mountain (Height VARCHAR, Mountain_ID VARCHAR); CREATE TABLE climber (Name VARCHAR, Mountain_ID VARCHAR) Question: Show the names of climbers and the heights of mountains they climb. [/INST] SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID </s> |
Show the height of the mountain climbed by the climber with the maximum points. | CREATE TABLE climber (Mountain_ID VARCHAR, Points VARCHAR); CREATE TABLE mountain (Height VARCHAR, Mountain_ID VARCHAR) | SELECT TOP 1 T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Points DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE climber (Mountain_ID VARCHAR, Points VARCHAR); CREATE TABLE mountain (Height VARCHAR, Mountain_ID VARCHAR) Question: Show the height of the mountain climbed by the climber with the maximum points. [/INST] SELECT TOP 1 T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Points DESC </s> |
Show the distinct names of mountains climbed by climbers from country "West Germany". | CREATE TABLE mountain (Name VARCHAR, Mountain_ID VARCHAR); CREATE TABLE climber (Mountain_ID VARCHAR, Country VARCHAR) | SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = "West Germany" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE mountain (Name VARCHAR, Mountain_ID VARCHAR); CREATE TABLE climber (Mountain_ID VARCHAR, Country VARCHAR) Question: Show the distinct names of mountains climbed by climbers from country "West Germany". [/INST] SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = "West Germany" </s> |
Show the times used by climbers to climb mountains in Country Uganda. | CREATE TABLE mountain (Mountain_ID VARCHAR, Country VARCHAR); CREATE TABLE climber (Time VARCHAR, Mountain_ID VARCHAR) | SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = "Uganda" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE mountain (Mountain_ID VARCHAR, Country VARCHAR); CREATE TABLE climber (Time VARCHAR, Mountain_ID VARCHAR) Question: Show the times used by climbers to climb mountains in Country Uganda. [/INST] SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = "Uganda" </s> |
Please show the countries and the number of climbers from each country. | CREATE TABLE climber (Country VARCHAR) | SELECT Country, COUNT(*) FROM climber GROUP BY Country | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE climber (Country VARCHAR) Question: Please show the countries and the number of climbers from each country. [/INST] SELECT Country, COUNT(*) FROM climber GROUP BY Country </s> |
List the countries that have more than one mountain. | CREATE TABLE mountain (Country VARCHAR) | SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE mountain (Country VARCHAR) Question: List the countries that have more than one mountain. [/INST] SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1 </s> |
List the names of mountains that do not have any climber. | CREATE TABLE mountain (Name VARCHAR, Mountain_ID VARCHAR); CREATE TABLE climber (Name VARCHAR, Mountain_ID VARCHAR) | SELECT Name FROM mountain WHERE NOT Mountain_ID IN (SELECT Mountain_ID FROM climber) | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE mountain (Name VARCHAR, Mountain_ID VARCHAR); CREATE TABLE climber (Name VARCHAR, Mountain_ID VARCHAR) Question: List the names of mountains that do not have any climber. [/INST] SELECT Name FROM mountain WHERE NOT Mountain_ID IN (SELECT Mountain_ID FROM climber) </s> |
Show the countries that have mountains with height more than 5600 stories and mountains with height less than 5200. | CREATE TABLE mountain (Country VARCHAR, Height INTEGER) | SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE mountain (Country VARCHAR, Height INTEGER) Question: Show the countries that have mountains with height more than 5600 stories and mountains with height less than 5200. [/INST] SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200 </s> |
Show the range that has the most number of mountains. | CREATE TABLE mountain (Range VARCHAR) | SELECT TOP 1 Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE mountain (Range VARCHAR) Question: Show the range that has the most number of mountains. [/INST] SELECT TOP 1 Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC </s> |
Show the names of mountains with height more than 5000 or prominence more than 1000. | CREATE TABLE mountain (Name VARCHAR, Height VARCHAR, Prominence VARCHAR) | SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE mountain (Name VARCHAR, Height VARCHAR, Prominence VARCHAR) Question: Show the names of mountains with height more than 5000 or prominence more than 1000. [/INST] SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000 </s> |
How many body builders are there? | CREATE TABLE body_builder (Id VARCHAR) | SELECT COUNT(*) FROM body_builder | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE body_builder (Id VARCHAR) Question: How many body builders are there? [/INST] SELECT COUNT(*) FROM body_builder </s> |
List the total scores of body builders in ascending order. | CREATE TABLE body_builder (Total VARCHAR) | SELECT Total FROM body_builder ORDER BY Total | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE body_builder (Total VARCHAR) Question: List the total scores of body builders in ascending order. [/INST] SELECT Total FROM body_builder ORDER BY Total </s> |
List the snatch score and clean jerk score of body builders in ascending order of snatch score. | CREATE TABLE body_builder (Snatch VARCHAR, Clean_Jerk VARCHAR) | SELECT Snatch, Clean_Jerk FROM body_builder ORDER BY Snatch | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE body_builder (Snatch VARCHAR, Clean_Jerk VARCHAR) Question: List the snatch score and clean jerk score of body builders in ascending order of snatch score. [/INST] SELECT Snatch, Clean_Jerk FROM body_builder ORDER BY Snatch </s> |
What is the average snatch score of body builders? | CREATE TABLE body_builder (Snatch INTEGER) | SELECT AVG(Snatch) FROM body_builder | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE body_builder (Snatch INTEGER) Question: What is the average snatch score of body builders? [/INST] SELECT AVG(Snatch) FROM body_builder </s> |
What are the clean and jerk score of the body builder with the highest total score? | CREATE TABLE body_builder (Clean_Jerk VARCHAR, Total VARCHAR) | SELECT TOP 1 Clean_Jerk FROM body_builder ORDER BY Total DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE body_builder (Clean_Jerk VARCHAR, Total VARCHAR) Question: What are the clean and jerk score of the body builder with the highest total score? [/INST] SELECT TOP 1 Clean_Jerk FROM body_builder ORDER BY Total DESC </s> |
What are the birthdays of people in ascending order of height? | CREATE TABLE People (Birth_Date VARCHAR, Height VARCHAR) | SELECT Birth_Date FROM People ORDER BY Height | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE People (Birth_Date VARCHAR, Height VARCHAR) Question: What are the birthdays of people in ascending order of height? [/INST] SELECT Birth_Date FROM People ORDER BY Height </s> |
What are the names of body builders? | CREATE TABLE body_builder (People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) | SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE body_builder (People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) Question: What are the names of body builders? [/INST] SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID </s> |
What are the names of body builders whose total score is higher than 300? | CREATE TABLE people (Name VARCHAR, People_ID VARCHAR); CREATE TABLE body_builder (People_ID VARCHAR, Total INTEGER) | SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total > 300 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE people (Name VARCHAR, People_ID VARCHAR); CREATE TABLE body_builder (People_ID VARCHAR, Total INTEGER) Question: What are the names of body builders whose total score is higher than 300? [/INST] SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total > 300 </s> |
What is the name of the body builder with the greatest body weight? | CREATE TABLE body_builder (People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Weight VARCHAR) | SELECT TOP 1 T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE body_builder (People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Weight VARCHAR) Question: What is the name of the body builder with the greatest body weight? [/INST] SELECT TOP 1 T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC </s> |
What are the birth date and birth place of the body builder with the highest total points? | CREATE TABLE body_builder (People_ID VARCHAR, Total VARCHAR); CREATE TABLE people (Birth_Date VARCHAR, Birth_Place VARCHAR, People_ID VARCHAR) | SELECT TOP 1 T2.Birth_Date, T2.Birth_Place FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE body_builder (People_ID VARCHAR, Total VARCHAR); CREATE TABLE people (Birth_Date VARCHAR, Birth_Place VARCHAR, People_ID VARCHAR) Question: What are the birth date and birth place of the body builder with the highest total points? [/INST] SELECT TOP 1 T2.Birth_Date, T2.Birth_Place FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC </s> |
What are the heights of body builders with total score smaller than 315? | CREATE TABLE people (Height VARCHAR, People_ID VARCHAR); CREATE TABLE body_builder (People_ID VARCHAR, Total INTEGER) | SELECT T2.Height FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total < 315 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE people (Height VARCHAR, People_ID VARCHAR); CREATE TABLE body_builder (People_ID VARCHAR, Total INTEGER) Question: What are the heights of body builders with total score smaller than 315? [/INST] SELECT T2.Height FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total < 315 </s> |
What is the average total score of body builders with height bigger than 200? | CREATE TABLE people (People_ID VARCHAR, Height INTEGER); CREATE TABLE body_builder (Total INTEGER, People_ID VARCHAR) | SELECT AVG(T1.Total) FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 200 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE people (People_ID VARCHAR, Height INTEGER); CREATE TABLE body_builder (Total INTEGER, People_ID VARCHAR) Question: What is the average total score of body builders with height bigger than 200? [/INST] SELECT AVG(T1.Total) FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 200 </s> |
What are the names of body builders in descending order of total scores? | CREATE TABLE body_builder (People_ID VARCHAR, Total VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) | SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE body_builder (People_ID VARCHAR, Total VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) Question: What are the names of body builders in descending order of total scores? [/INST] SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC </s> |
List each birth place along with the number of people from there. | CREATE TABLE people (Birth_Place VARCHAR) | SELECT Birth_Place, COUNT(*) FROM people GROUP BY Birth_Place | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE people (Birth_Place VARCHAR) Question: List each birth place along with the number of people from there. [/INST] SELECT Birth_Place, COUNT(*) FROM people GROUP BY Birth_Place </s> |
What is the most common birth place of people? | CREATE TABLE people (Birth_Place VARCHAR) | SELECT TOP 1 Birth_Place FROM people GROUP BY Birth_Place ORDER BY COUNT(*) DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE people (Birth_Place VARCHAR) Question: What is the most common birth place of people? [/INST] SELECT TOP 1 Birth_Place FROM people GROUP BY Birth_Place ORDER BY COUNT(*) DESC </s> |
What are the birth places that are shared by at least two people? | CREATE TABLE people (Birth_Place VARCHAR) | SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*) >= 2 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE people (Birth_Place VARCHAR) Question: What are the birth places that are shared by at least two people? [/INST] SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*) >= 2 </s> |
List the height and weight of people in descending order of height. | CREATE TABLE people (Height VARCHAR, Weight VARCHAR) | SELECT Height, Weight FROM people ORDER BY Height DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE people (Height VARCHAR, Weight VARCHAR) Question: List the height and weight of people in descending order of height. [/INST] SELECT Height, Weight FROM people ORDER BY Height DESC </s> |
Show all information about each body builder. | CREATE TABLE body_builder (Id VARCHAR) | SELECT * FROM body_builder | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE body_builder (Id VARCHAR) Question: Show all information about each body builder. [/INST] SELECT * FROM body_builder </s> |
List the names and origins of people who are not body builders. | CREATE TABLE people (Name VARCHAR, birth_place VARCHAR, people_id VARCHAR); CREATE TABLE body_builder (people_id VARCHAR); CREATE TABLE people (Name VARCHAR, birth_place VARCHAR) | SELECT Name, birth_place FROM people EXCEPT SELECT T1.Name, T1.birth_place FROM people AS T1 JOIN body_builder AS T2 ON T1.people_id = T2.people_id | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE people (Name VARCHAR, birth_place VARCHAR, people_id VARCHAR); CREATE TABLE body_builder (people_id VARCHAR); CREATE TABLE people (Name VARCHAR, birth_place VARCHAR) Question: List the names and origins of people who are not body builders. [/INST] SELECT Name, birth_place FROM people EXCEPT SELECT T1.Name, T1.birth_place FROM people AS T1 JOIN body_builder AS T2 ON T1.people_id = T2.people_id </s> |
How many distinct birth places are there? | CREATE TABLE people (Birth_Place VARCHAR) | SELECT COUNT(DISTINCT Birth_Place) FROM people | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE people (Birth_Place VARCHAR) Question: How many distinct birth places are there? [/INST] SELECT COUNT(DISTINCT Birth_Place) FROM people </s> |
How many persons are not body builders? | CREATE TABLE body_builder (people_id VARCHAR, People_ID VARCHAR); CREATE TABLE people (people_id VARCHAR, People_ID VARCHAR) | SELECT COUNT(*) FROM people WHERE NOT people_id IN (SELECT People_ID FROM body_builder) | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE body_builder (people_id VARCHAR, People_ID VARCHAR); CREATE TABLE people (people_id VARCHAR, People_ID VARCHAR) Question: How many persons are not body builders? [/INST] SELECT COUNT(*) FROM people WHERE NOT people_id IN (SELECT People_ID FROM body_builder) </s> |
List the weight of the body builders who have snatch score higher than 140 or have the height greater than 200. | CREATE TABLE people (weight VARCHAR, people_id VARCHAR, height VARCHAR); CREATE TABLE body_builder (people_id VARCHAR, snatch VARCHAR) | SELECT T2.weight FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T1.snatch > 140 OR T2.height > 200 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE people (weight VARCHAR, people_id VARCHAR, height VARCHAR); CREATE TABLE body_builder (people_id VARCHAR, snatch VARCHAR) Question: List the weight of the body builders who have snatch score higher than 140 or have the height greater than 200. [/INST] SELECT T2.weight FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T1.snatch > 140 OR T2.height > 200 </s> |
What are the total scores of the body builders whose birthday contains the string "January" ? | CREATE TABLE people (people_id VARCHAR, Birth_Date VARCHAR); CREATE TABLE body_builder (total VARCHAR, people_id VARCHAR) | SELECT T1.total FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T2.Birth_Date LIKE "%January%" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE people (people_id VARCHAR, Birth_Date VARCHAR); CREATE TABLE body_builder (total VARCHAR, people_id VARCHAR) Question: What are the total scores of the body builders whose birthday contains the string "January" ? [/INST] SELECT T1.total FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T2.Birth_Date LIKE "%January%" </s> |
What is the minimum snatch score? | CREATE TABLE body_builder (snatch INTEGER) | SELECT MIN(snatch) FROM body_builder | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE body_builder (snatch INTEGER) Question: What is the minimum snatch score? [/INST] SELECT MIN(snatch) FROM body_builder </s> |
How many elections are there? | CREATE TABLE election (Id VARCHAR) | SELECT COUNT(*) FROM election | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE election (Id VARCHAR) Question: How many elections are there? [/INST] SELECT COUNT(*) FROM election </s> |
List the votes of elections in descending order. | CREATE TABLE election (Votes VARCHAR) | SELECT Votes FROM election ORDER BY Votes DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE election (Votes VARCHAR) Question: List the votes of elections in descending order. [/INST] SELECT Votes FROM election ORDER BY Votes DESC </s> |
List the dates and vote percents of elections. | CREATE TABLE election (Date VARCHAR, Vote_Percent VARCHAR) | SELECT Date, Vote_Percent FROM election | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE election (Date VARCHAR, Vote_Percent VARCHAR) Question: List the dates and vote percents of elections. [/INST] SELECT Date, Vote_Percent FROM election </s> |
What are the minimum and maximum vote percents of elections? | CREATE TABLE election (Vote_Percent INTEGER) | SELECT MIN(Vote_Percent), MAX(Vote_Percent) FROM election | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE election (Vote_Percent INTEGER) Question: What are the minimum and maximum vote percents of elections? [/INST] SELECT MIN(Vote_Percent), MAX(Vote_Percent) FROM election </s> |
What are the names and parties of representatives? | CREATE TABLE representative (Name VARCHAR, Party VARCHAR) | SELECT Name, Party FROM representative | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE representative (Name VARCHAR, Party VARCHAR) Question: What are the names and parties of representatives? [/INST] SELECT Name, Party FROM representative </s> |
What are the names of representatives whose party is not "Republican"? | CREATE TABLE Representative (Name VARCHAR, Party VARCHAR) | SELECT Name FROM Representative WHERE Party <> "Republican" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Representative (Name VARCHAR, Party VARCHAR) Question: What are the names of representatives whose party is not "Republican"? [/INST] SELECT Name FROM Representative WHERE Party <> "Republican" </s> |
What are the life spans of representatives from New York state or Indiana state? | CREATE TABLE representative (Lifespan VARCHAR, State VARCHAR) | SELECT Lifespan FROM representative WHERE State = "New York" OR State = "Indiana" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE representative (Lifespan VARCHAR, State VARCHAR) Question: What are the life spans of representatives from New York state or Indiana state? [/INST] SELECT Lifespan FROM representative WHERE State = "New York" OR State = "Indiana" </s> |
What are the names of representatives and the dates of elections they participated in. | CREATE TABLE election (Date VARCHAR, Representative_ID VARCHAR); CREATE TABLE representative (Name VARCHAR, Representative_ID VARCHAR) | SELECT T2.Name, T1.Date FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE election (Date VARCHAR, Representative_ID VARCHAR); CREATE TABLE representative (Name VARCHAR, Representative_ID VARCHAR) Question: What are the names of representatives and the dates of elections they participated in. [/INST] SELECT T2.Name, T1.Date FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID </s> |
What are the names of representatives with more than 10000 votes in election? | CREATE TABLE representative (Name VARCHAR, Representative_ID VARCHAR); CREATE TABLE election (Representative_ID VARCHAR) | SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE Votes > 10000 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE representative (Name VARCHAR, Representative_ID VARCHAR); CREATE TABLE election (Representative_ID VARCHAR) Question: What are the names of representatives with more than 10000 votes in election? [/INST] SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE Votes > 10000 </s> |
What are the names of representatives in descending order of votes? | CREATE TABLE representative (Name VARCHAR, Representative_ID VARCHAR); CREATE TABLE election (Representative_ID VARCHAR) | SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE representative (Name VARCHAR, Representative_ID VARCHAR); CREATE TABLE election (Representative_ID VARCHAR) Question: What are the names of representatives in descending order of votes? [/INST] SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes DESC </s> |
What is the party of the representative that has the smallest number of votes. | CREATE TABLE representative (Party VARCHAR, Representative_ID VARCHAR); CREATE TABLE election (Representative_ID VARCHAR) | SELECT TOP 1 T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE representative (Party VARCHAR, Representative_ID VARCHAR); CREATE TABLE election (Representative_ID VARCHAR) Question: What is the party of the representative that has the smallest number of votes. [/INST] SELECT TOP 1 T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes </s> |
What are the lifespans of representatives in descending order of vote percent? | CREATE TABLE election (Representative_ID VARCHAR); CREATE TABLE representative (Lifespan VARCHAR, Representative_ID VARCHAR) | SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY Vote_Percent DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE election (Representative_ID VARCHAR); CREATE TABLE representative (Lifespan VARCHAR, Representative_ID VARCHAR) Question: What are the lifespans of representatives in descending order of vote percent? [/INST] SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY Vote_Percent DESC </s> |
What is the average number of votes of representatives from party "Republican"? | CREATE TABLE election (Votes INTEGER, Representative_ID VARCHAR); CREATE TABLE representative (Representative_ID VARCHAR, Party VARCHAR) | SELECT AVG(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE T2.Party = "Republican" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE election (Votes INTEGER, Representative_ID VARCHAR); CREATE TABLE representative (Representative_ID VARCHAR, Party VARCHAR) Question: What is the average number of votes of representatives from party "Republican"? [/INST] SELECT AVG(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE T2.Party = "Republican" </s> |
What are the different parties of representative? Show the party name and the number of representatives in each party. | CREATE TABLE representative (Party VARCHAR) | SELECT Party, COUNT(*) FROM representative GROUP BY Party | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE representative (Party VARCHAR) Question: What are the different parties of representative? Show the party name and the number of representatives in each party. [/INST] SELECT Party, COUNT(*) FROM representative GROUP BY Party </s> |
What is the party that has the largest number of representatives? | CREATE TABLE representative (Party VARCHAR) | SELECT TOP 1 Party, COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE representative (Party VARCHAR) Question: What is the party that has the largest number of representatives? [/INST] SELECT TOP 1 Party, COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC </s> |
What parties have at least three representatives? | CREATE TABLE representative (Party VARCHAR) | SELECT Party FROM representative GROUP BY Party HAVING COUNT(*) >= 3 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE representative (Party VARCHAR) Question: What parties have at least three representatives? [/INST] SELECT Party FROM representative GROUP BY Party HAVING COUNT(*) >= 3 </s> |
What states have at least two representatives? | CREATE TABLE representative (State VARCHAR) | SELECT State FROM representative GROUP BY State HAVING COUNT(*) >= 2 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE representative (State VARCHAR) Question: What states have at least two representatives? [/INST] SELECT State FROM representative GROUP BY State HAVING COUNT(*) >= 2 </s> |
List the names of representatives that have not participated in elections listed here. | CREATE TABLE election (Name VARCHAR, Representative_ID VARCHAR); CREATE TABLE representative (Name VARCHAR, Representative_ID VARCHAR) | SELECT Name FROM representative WHERE NOT Representative_ID IN (SELECT Representative_ID FROM election) | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE election (Name VARCHAR, Representative_ID VARCHAR); CREATE TABLE representative (Name VARCHAR, Representative_ID VARCHAR) Question: List the names of representatives that have not participated in elections listed here. [/INST] SELECT Name FROM representative WHERE NOT Representative_ID IN (SELECT Representative_ID FROM election) </s> |
Show the parties that have both representatives in New York state and representatives in Pennsylvania state. | CREATE TABLE representative (Party VARCHAR, State VARCHAR) | SELECT Party FROM representative WHERE State = "New York" INTERSECT SELECT Party FROM representative WHERE State = "Pennsylvania" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE representative (Party VARCHAR, State VARCHAR) Question: Show the parties that have both representatives in New York state and representatives in Pennsylvania state. [/INST] SELECT Party FROM representative WHERE State = "New York" INTERSECT SELECT Party FROM representative WHERE State = "Pennsylvania" </s> |
How many distinct parties are there for representatives? | CREATE TABLE representative (Party VARCHAR) | SELECT COUNT(DISTINCT Party) FROM representative | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE representative (Party VARCHAR) Question: How many distinct parties are there for representatives? [/INST] SELECT COUNT(DISTINCT Party) FROM representative </s> |
How many apartment bookings are there in total? | CREATE TABLE Apartment_Bookings (Id VARCHAR) | SELECT COUNT(*) FROM Apartment_Bookings | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Apartment_Bookings (Id VARCHAR) Question: How many apartment bookings are there in total? [/INST] SELECT COUNT(*) FROM Apartment_Bookings </s> |
Show the start dates and end dates of all the apartment bookings. | CREATE TABLE Apartment_Bookings (booking_start_date VARCHAR, booking_end_date VARCHAR) | SELECT booking_start_date, booking_end_date FROM Apartment_Bookings | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Apartment_Bookings (booking_start_date VARCHAR, booking_end_date VARCHAR) Question: Show the start dates and end dates of all the apartment bookings. [/INST] SELECT booking_start_date, booking_end_date FROM Apartment_Bookings </s> |
Show all distinct building descriptions. | CREATE TABLE Apartment_Buildings (building_description VARCHAR) | SELECT DISTINCT building_description FROM Apartment_Buildings | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Apartment_Buildings (building_description VARCHAR) Question: Show all distinct building descriptions. [/INST] SELECT DISTINCT building_description FROM Apartment_Buildings </s> |
Show the short names of the buildings managed by "Emma". | CREATE TABLE Apartment_Buildings (building_short_name VARCHAR, building_manager VARCHAR) | SELECT building_short_name FROM Apartment_Buildings WHERE building_manager = "Emma" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Apartment_Buildings (building_short_name VARCHAR, building_manager VARCHAR) Question: Show the short names of the buildings managed by "Emma". [/INST] SELECT building_short_name FROM Apartment_Buildings WHERE building_manager = "Emma" </s> |
Show the addresses and phones of all the buildings managed by "Brenden". | CREATE TABLE Apartment_Buildings (building_address VARCHAR, building_phone VARCHAR, building_manager VARCHAR) | SELECT building_address, building_phone FROM Apartment_Buildings WHERE building_manager = "Brenden" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Apartment_Buildings (building_address VARCHAR, building_phone VARCHAR, building_manager VARCHAR) Question: Show the addresses and phones of all the buildings managed by "Brenden". [/INST] SELECT building_address, building_phone FROM Apartment_Buildings WHERE building_manager = "Brenden" </s> |
What are the building full names that contain the word "court"? | CREATE TABLE Apartment_Buildings (building_full_name VARCHAR) | SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE "%court%" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Apartment_Buildings (building_full_name VARCHAR) Question: What are the building full names that contain the word "court"? [/INST] SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE "%court%" </s> |
What is the minimum and maximum number of bathrooms of all the apartments? | CREATE TABLE Apartments (bathroom_count INTEGER) | SELECT MIN(bathroom_count), MAX(bathroom_count) FROM Apartments | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Apartments (bathroom_count INTEGER) Question: What is the minimum and maximum number of bathrooms of all the apartments? [/INST] SELECT MIN(bathroom_count), MAX(bathroom_count) FROM Apartments </s> |
What is the average number of bedrooms of all apartments? | CREATE TABLE Apartments (bedroom_count INTEGER) | SELECT AVG(bedroom_count) FROM Apartments | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Apartments (bedroom_count INTEGER) Question: What is the average number of bedrooms of all apartments? [/INST] SELECT AVG(bedroom_count) FROM Apartments </s> |
Return the apartment number and the number of rooms for each apartment. | CREATE TABLE Apartments (apt_number VARCHAR, room_count VARCHAR) | SELECT apt_number, room_count FROM Apartments | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Apartments (apt_number VARCHAR, room_count VARCHAR) Question: Return the apartment number and the number of rooms for each apartment. [/INST] SELECT apt_number, room_count FROM Apartments </s> |
What is the average number of rooms of apartments with type code "Studio"? | CREATE TABLE Apartments (room_count INTEGER, apt_type_code VARCHAR) | SELECT AVG(room_count) FROM Apartments WHERE apt_type_code = "Studio" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Apartments (room_count INTEGER, apt_type_code VARCHAR) Question: What is the average number of rooms of apartments with type code "Studio"? [/INST] SELECT AVG(room_count) FROM Apartments WHERE apt_type_code = "Studio" </s> |
Return the apartment numbers of the apartments with type code "Flat". | CREATE TABLE Apartments (apt_number VARCHAR, apt_type_code VARCHAR) | SELECT apt_number FROM Apartments WHERE apt_type_code = "Flat" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Apartments (apt_number VARCHAR, apt_type_code VARCHAR) Question: Return the apartment numbers of the apartments with type code "Flat". [/INST] SELECT apt_number FROM Apartments WHERE apt_type_code = "Flat" </s> |
Return the first names and last names of all guests | CREATE TABLE Guests (guest_first_name VARCHAR, guest_last_name VARCHAR) | SELECT guest_first_name, guest_last_name FROM Guests | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Guests (guest_first_name VARCHAR, guest_last_name VARCHAR) Question: Return the first names and last names of all guests [/INST] SELECT guest_first_name, guest_last_name FROM Guests </s> |
Return the date of birth for all the guests with gender code "Male". | CREATE TABLE Guests (date_of_birth VARCHAR, gender_code VARCHAR) | SELECT date_of_birth FROM Guests WHERE gender_code = "Male" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Guests (date_of_birth VARCHAR, gender_code VARCHAR) Question: Return the date of birth for all the guests with gender code "Male". [/INST] SELECT date_of_birth FROM Guests WHERE gender_code = "Male" </s> |
Show the apartment numbers, start dates, and end dates of all the apartment bookings. | CREATE TABLE Apartment_Bookings (booking_start_date VARCHAR, apt_id VARCHAR); CREATE TABLE Apartments (apt_number VARCHAR, apt_id VARCHAR) | SELECT T2.apt_number, T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Apartment_Bookings (booking_start_date VARCHAR, apt_id VARCHAR); CREATE TABLE Apartments (apt_number VARCHAR, apt_id VARCHAR) Question: Show the apartment numbers, start dates, and end dates of all the apartment bookings. [/INST] SELECT T2.apt_number, T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id </s> |
What are the booking start and end dates of the apartments with type code "Duplex"? | CREATE TABLE Apartments (apt_id VARCHAR, apt_type_code VARCHAR); CREATE TABLE Apartment_Bookings (booking_start_date VARCHAR, apt_id VARCHAR) | SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = "Duplex" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Apartments (apt_id VARCHAR, apt_type_code VARCHAR); CREATE TABLE Apartment_Bookings (booking_start_date VARCHAR, apt_id VARCHAR) Question: What are the booking start and end dates of the apartments with type code "Duplex"? [/INST] SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = "Duplex" </s> |
What are the booking start and end dates of the apartments with more than 2 bedrooms? | CREATE TABLE Apartment_Bookings (booking_start_date VARCHAR, apt_id VARCHAR); CREATE TABLE Apartments (apt_id VARCHAR, bedroom_count INTEGER) | SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Apartment_Bookings (booking_start_date VARCHAR, apt_id VARCHAR); CREATE TABLE Apartments (apt_id VARCHAR, bedroom_count INTEGER) Question: What are the booking start and end dates of the apartments with more than 2 bedrooms? [/INST] SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2 </s> |
What is the booking status code of the apartment with apartment number "Suite 634"? | CREATE TABLE Apartments (apt_id VARCHAR, apt_number VARCHAR); CREATE TABLE Apartment_Bookings (booking_status_code VARCHAR, apt_id VARCHAR) | SELECT T1.booking_status_code FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_number = "Suite 634" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Apartments (apt_id VARCHAR, apt_number VARCHAR); CREATE TABLE Apartment_Bookings (booking_status_code VARCHAR, apt_id VARCHAR) Question: What is the booking status code of the apartment with apartment number "Suite 634"? [/INST] SELECT T1.booking_status_code FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_number = "Suite 634" </s> |
Show the distinct apartment numbers of the apartments that have bookings with status code "Confirmed". | CREATE TABLE Apartments (apt_number VARCHAR, apt_id VARCHAR); CREATE TABLE Apartment_Bookings (apt_id VARCHAR, booking_status_code VARCHAR) | SELECT DISTINCT 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" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Apartments (apt_number VARCHAR, apt_id VARCHAR); CREATE TABLE Apartment_Bookings (apt_id VARCHAR, booking_status_code VARCHAR) Question: Show the distinct apartment numbers of the apartments that have bookings with status code "Confirmed". [/INST] SELECT DISTINCT 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" </s> |
Show the average room count of the apartments that have booking status code "Provisional". | CREATE TABLE Apartment_Bookings (apt_id VARCHAR, booking_status_code VARCHAR); CREATE TABLE Apartments (apt_id VARCHAR) | SELECT AVG(room_count) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Provisional" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Apartment_Bookings (apt_id VARCHAR, booking_status_code VARCHAR); CREATE TABLE Apartments (apt_id VARCHAR) Question: Show the average room count of the apartments that have booking status code "Provisional". [/INST] SELECT AVG(room_count) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Provisional" </s> |
Show the guest first names, start dates, and end dates of all the apartment bookings. | CREATE TABLE Apartment_Bookings (booking_start_date VARCHAR, guest_id VARCHAR); CREATE TABLE Guests (guest_first_name VARCHAR, guest_id VARCHAR) | SELECT T2.guest_first_name, T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Apartment_Bookings (booking_start_date VARCHAR, guest_id VARCHAR); CREATE TABLE Guests (guest_first_name VARCHAR, guest_id VARCHAR) Question: Show the guest first names, start dates, and end dates of all the apartment bookings. [/INST] SELECT T2.guest_first_name, T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id </s> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.