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