aherntech/sparc huggingface dataset:
Database: apartment_rentals
Question sequence:
List all the guests' first and last names.
Also show the booking status code of each one.
What are the first names, start dates, and end dates of all the apartment bookings?
SQL query sequence:
SELECT guest_first_name, guest_last_name FROM Guests
SELECT T2.guest_first_name ,  T2.guest_last_name, T1.booking_status_code FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id  =  T2.guest_id
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
Final question: Show the guest first names, start dates, and end dates of all the apartment bookings.
Final SQL: 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
Database: apartment_rentals
Question sequence:
List all the booking start and end dates.
Show the bedroom number of each record.
Show the start and end dates of the apartment bookings made by male guests.
What about female guests?
SQL query sequence:
SELECT booking_start_date ,  booking_start_date FROM Apartment_Bookings
SELECT T1.booking_start_date ,  T1.booking_start_date, T2.bedroom_count  FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id  =  T2.apt_id
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  =  "Male"
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"
Final question: Show the start dates and end dates of all the apartment bookings made by guests with gender code "Female".
Final SQL: 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"
Database: apartment_rentals
Question sequence:
List all the guests' first and last names.
Among all the guests, which of them have "Provisional" the apartment bookings?
How about "Confirmed"?
SQL query sequence:
SELECT guest_first_name, guest_last_name FROM Guests
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  =  "Provisional"
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"
Final question: Show the first names and last names of all the guests that have apartment bookings with status code "Confirmed".
Final SQL: 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"
Database: apartment_rentals
Question sequence:
List all the unique facility codes.
List all the apartments and the facility codes of them.
How many of them have more than 3 bedrooms?
Show the facility codes of those where there are more than 4 bedrooms.
SQL query sequence:
SELECT distinct facility_code FROM Apartment_Facilities
SELECT * FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id  =  T2.apt_id
SELECT count(*) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id  =  T2.apt_id WHERE T2.bedroom_count  >  3
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
Final question: Show the facility codes of apartments with more than 4 bedrooms.
Final SQL: 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
Database: apartment_rentals
Question sequence:
List all unique facility codes.
List all the apartments and the facility codes of them.
Calculate how many rooms are there for those apartments with facility code "Gym".
SQL query sequence:
SELECT distinct facility_code FROM Apartment_Facilities
SELECT * FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id  =  T2.apt_id
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"
Final question: Show the total number of rooms of all apartments with facility code "Gym".
Final SQL: 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"
Database: apartment_rentals
Question sequence:
What is the minimum number of rooms for the apartments?
List all the short names of each building.
For each short name, show the room count.
Only keep the result of "Columbus Square".
SQL query sequence:
SELECT min(room_count) FROM Apartments
SELECT building_short_name FROM Apartment_Buildings
SELECT T1.building_short_name, T2.room_count FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id  =  T2.building_id
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"
Final question: Show the total number of rooms of the apartments in the building with short name "Columbus Square".
Final SQL: 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"
Database: apartment_rentals
Question sequence:
List all the addresses of the buildings.
Show the building address for each apartment id.
Only show the addresses of the buildings that have apartments with more than 3 bathrooms.
How about more than 2?
SQL query sequence:
SELECT building_address FROM Apartment_Buildings
SELECT T1.building_address, T2.apt_id FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id  =  T2.building_id
SELECT T1.building_address FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id  =  T2.building_id WHERE T2.bathroom_count  >  3
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
Final question: Show the addresses of the buildings that have apartments with more than 2 bathrooms.
Final SQL: 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
Database: apartment_rentals
Question sequence:
For each apartment booking, show the start date, and end date.
Also show the type code with each record.
What the apartment type codes and apartment numbers in the buildings managed by "Kyle"?
SQL query sequence:
SELECT booking_start_date ,  booking_start_date FROM Apartment_Bookings
SELECT T2.apt_type_code ,  T1.booking_start_date ,  T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id  =  T2.apt_id
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"
Final question: Show the apartment type codes and apartment numbers in the buildings managed by "Kyle".
Final SQL: 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"
Database: apartment_rentals
Question sequence:
List all the unique booking status codes.
How many apartments are there for each one?
SQL query sequence:
SELECT 	distinct booking_status_code FROM Apartment_Bookings
SELECT 	booking_status_code ,  COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code
Final question: Show the booking status code and the corresponding number of bookings.
Final SQL: SELECT 	booking_status_code ,  COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code
Database: apartment_rentals
Question sequence:
List all the apartment numbers.
Order those results by number of bedrooms in descending order.
Order them by room count in descending order.
What about in ascending order?
SQL query sequence:
SELECT apt_number FROM Apartments
SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC
SELECT apt_number FROM Apartments ORDER BY room_count ASC
SELECT apt_number FROM Apartments ORDER BY room_count ASC
Final question: Return all the apartment numbers sorted by the room count in ascending order.
Final SQL: SELECT apt_number FROM Apartments ORDER BY room_count ASC
Database: apartment_rentals
Question sequence:
List all the apartment numbers.
Order them by the number of bedrooms in descending order.
Which ones are top 4?
What about the top 1?
SQL query sequence:
SELECT apt_number FROM Apartments
SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC
SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 4
SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1
Final question: Return the apartment number with the largest number of bedrooms.
Final SQL: SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1
Database: apartment_rentals
Question sequence:
List all the apartment type codes with the counts of apartments.
Order those results by the number of apartments in ascending order.
SQL query sequence:
SELECT apt_type_code, count(*) FROM Apartments GROUP BY apt_type_code
SELECT apt_type_code ,  COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) ASC
Final question: Show the apartment type codes and the corresponding number of apartments sorted by the number of apartments in ascending order.
Final SQL: SELECT apt_type_code ,  COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) ASC
Database: apartment_rentals
Question sequence:
List all the apartment type codes with the counts of apartments.
Order the apartments by the average number of rooms in descending order.
From those results, only keep the top 5.
What about top 3?
What are the apartment type codes from those results?
SQL query sequence:
SELECT apt_type_code, count(*) FROM Apartments GROUP BY apt_type_code
SELECT * FROM Apartments GROUP BY apt_type_code ORDER BY avg(room_count) DESC
SELECT * FROM Apartments GROUP BY apt_type_code ORDER BY avg(room_count) DESC LIMIT 5
SELECT * FROM Apartments GROUP BY apt_type_code ORDER BY avg(room_count) DESC LIMIT 3
SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY avg(room_count) DESC LIMIT 3
Final question: Show the top 3 apartment type codes sorted by the average number of rooms in descending order.
Final SQL: SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY avg(room_count) DESC LIMIT 3
Database: apartment_rentals
Question sequence:
What are all the information about the apartments.
Order those records by the number of total rooms.
Which is the apartment type code that has the largest number of total rooms?
Order the apartment type code by the number of total rooms.
Add the number of bathrooms and number of bedrooms to the results.
SQL query sequence:
SELECT * FROM Apartments
SELECT * FROM Apartments ORDER BY room_count
SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY sum(room_count) DESC LIMIT 1
SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY sum(room_count) DESC
SELECT apt_type_code ,  bathroom_count ,  bedroom_count FROM Apartments GROUP BY apt_type_code ORDER BY sum(room_count) DESC LIMIT 1
Final question: Show the apartment type code that has the largest number of total rooms, together with the number of bathrooms and number of bedrooms.
Final SQL: SELECT apt_type_code ,  bathroom_count ,  bedroom_count FROM Apartments GROUP BY apt_type_code ORDER BY sum(room_count) DESC LIMIT 1
Database: apartment_rentals
Question sequence:
How many unique apartment type codes are there?
Show the number of apartments for each code.
Which are the most two common apartment type codes?
How about the top 1?
SQL query sequence:
SELECT count(distinct apt_type_code) FROM Apartments
SELECT apt_type_code, count(*) FROM Apartments GROUP BY apt_type_code
SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 2
SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1
Final question: Show the most common apartment type code.
Final SQL: SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1
Database: apartment_rentals
Question sequence:
How many unique apartment type codes are there?
What is the minimum room count for the departments?
What is the minimum bathroom count for the departments?
How many apartments have more than 2 bathrooms?
How about more than 1?
Among those apartments, which apartment type is the most popular one?
SQL query sequence:
SELECT count(distinct apt_type_code) FROM Apartments
SELECT min(room_count) FROM Apartments
SELECT min(bathroom_count) FROM Apartments
SELECT count(*) FROM Apartments WHERE bathroom_count  >  2
SELECT count(*) FROM Apartments WHERE bathroom_count  >  1
SELECT apt_type_code FROM Apartments WHERE bathroom_count  >  1 GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1
Final question: Show the most common apartment type code among apartments with more than 1 bathroom.
Final SQL: SELECT apt_type_code FROM Apartments WHERE bathroom_count  >  1 GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1
Database: apartment_rentals
Question sequence:
How many unique apartment type codes are there?
What is the minimum room count for the departments?
List the apartment type code and the maximum and minimum number of rooms for each one.
SQL query sequence:
SELECT count(distinct apt_type_code) FROM Apartments
SELECT min(room_count) FROM Apartments
SELECT apt_type_code ,  max(room_count) ,  min(room_count) FROM Apartments GROUP BY apt_type_code
Final question: Show each apartment type code, and the maximum and minimum number of rooms for each type.
Final SQL: SELECT apt_type_code ,  max(room_count) ,  min(room_count) FROM Apartments GROUP BY apt_type_code
Database: apartment_rentals
Question sequence:
Show all the guests information.
How many genders are there in total?
Has "Rebeca" ever visited, show the related information.
Count how many guests for each gender, and list them in descending order.
SQL query sequence:
SELECT * FROM Guests
SELECT count(distinct gender_code) FROM Guests
SELECT * FROM Guests where guest_first_name = "Rebeca"
SELECT gender_code ,  COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC
Final question: Show each gender code and the corresponding count of guests sorted by the count in descending order.
Final SQL: SELECT gender_code ,  COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC
Database: apartment_rentals
Question sequence:
Show all the information about the facilities.
How many records are there?
Which apartments have no facility, show ids?
How many are there?
SQL query sequence:
SELECT * FROM Apartment_Facilities
SELECT count(*) FROM Apartment_Facilities
SELECT apt_id FROM Apartments WHERE apt_id NOT IN (SELECT apt_id FROM Apartment_Facilities)
SELECT count(*) FROM Apartments WHERE apt_id NOT IN (SELECT apt_id FROM Apartment_Facilities)
Final question: How many apartments do not have any facility?
Final SQL: SELECT count(*) FROM Apartments WHERE apt_id NOT IN (SELECT apt_id FROM Apartment_Facilities)
Database: apartment_rentals
Question sequence:
How many apartments are there?
What are the status codes?
How many apartments have the status code to be "Confirmed"?
What about that of "Provisional" or "Confirmed"?
SQL query sequence:
SELECT count(apt_number) FROM Apartments
SELECT booking_status_code FROM Apartment_Bookings
SELECT count(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"
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"
Final question: Show the apartment numbers of apartments with bookings that have status code both "Provisional" and "Confirmed"
Final SQL: 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"
Database: match_season
Question sequence:
List all the country names and their languages.
How many official languages that contain the word "English"?
Which countries are they?
SQL query sequence:
SELECT Country_name, Official_native_language FROM country
SELECT count(*) FROM country WHERE Official_native_language LIKE "%English%"
SELECT Official_native_language FROM country WHERE Official_native_language LIKE "%English%"
Final question: Show all official native languages that contain the word "English".
Final SQL: SELECT Official_native_language FROM country WHERE Official_native_language LIKE "%English%"
Database: match_season
Question sequence:
Show all the information about the match season.
List the positions.
How many distinct positions are there?
What are the distinct position of players from college Virginia?
What about UCLA or Duke?
SQL query sequence:
SELECT * FROM match_season
SELECT position FROM match_season
SELECT count(distinct position) FROM match_season
SELECT DISTINCT POSITION FROM match_season WHERE College  =  "Virginia"
SELECT DISTINCT POSITION FROM match_season WHERE College  =  "UCLA" OR College  =  "Duke"
Final question: Show the distinct position of players from college UCLA or Duke.
Final SQL: SELECT DISTINCT POSITION FROM match_season WHERE College  =  "UCLA" OR College  =  "Duke"
Database: match_season
Question sequence:
Show the match season and the corresponding country.
How many distinct countries in total?
List the player names who are from Ireland.
How about Indonesia?
SQL query sequence:
SELECT  T2.season, T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country
SELECT  count(distinct T1.Country_name) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country
SELECT T2.Player FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T1.Country_name  =  "Ireland"
SELECT T2.Player FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T1.Country_name  =  "Indonesia"
Final question: Which players are from Indonesia?
Final SQL: SELECT T2.Player FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T1.Country_name  =  "Indonesia"
Database: match_season
Question sequence:
Show the country whose capital is Baghdad.
What about Dublin?
List all the positions corresponding to that country.
What about the distinct positions?
SQL query sequence:
select country_name from country where capital = 'Baghdad'
select country_name from country where capital = 'Dublin'
SELECT T2.Position FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T1.Capital  =  "Dublin"
SELECT DISTINCT T2.Position FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T1.Capital  =  "Dublin"
Final question: What are the distinct positions of the players from a country whose capital is Dublin?
Final SQL: SELECT DISTINCT T2.Position FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T1.Capital  =  "Dublin"
Database: match_season
Question sequence:
What are the distinct position of players from college Furman?
What about the players who come from college of Maryland or Duke?
What are the official languages of them?
SQL query sequence:
SELECT DISTINCT POSITION FROM match_season WHERE College  =  "Furman"
SELECT player FROM match_season WHERE College  =  "Maryland" OR College  =  "Duke"
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"
Final question: What are the official languages of the countries of players from Maryland or Duke college?
Final SQL: 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"
Database: match_season
Question sequence:
List the players and their country names.
Which ones have the position of Forward?
What about the official languages of them?
How many official languages in total for the defenders?
SQL query sequence:
SELECT T2.player,T1.country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T2.Position  =  "Defender"
SELECT T2.player,T1.country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T2.Position  =  "Defender" WHERE T2.Position  =  "Forward"
SELECT T1.Official_native_language FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T2.Position  =  "Defender"
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"
Final question: How many distinct official languages are there among countries of players whose positions are defenders.
Final SQL: 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"
Database: match_season
Question sequence:
List the player, position and the corresponding team for each player.
Which ones are from the team 'Evalyn Feil', show the positions only?
What about the team name "Ryley Goldner"?
SQL query sequence:
SELECT T1.player,T1.Position, T2.name FROM match_season AS T1 JOIN team AS T2 ON T1.Team  =  T2.Team_id
SELECT T1.Position FROM match_season AS T1 JOIN team AS T2 ON T1.Team  =  T2.Team_id where t2.name = 'Evalyn Feil'
SELECT T1.Position FROM match_season AS T1 JOIN team AS T2 ON T1.Team  =  T2.Team_id WHERE T2.Name  =  "Ryley Goldner"
Final question: Show the positions of the players from the team with name "Ryley Goldner".
Final SQL: SELECT T1.Position FROM match_season AS T1 JOIN team AS T2 ON T1.Team  =  T2.Team_id WHERE T2.Name  =  "Ryley Goldner"
Database: match_season
Question sequence:
List the college and the corresponding team name.
How many unique colleges are there for team 'Miami Fusion'?
What about the team "Columbus Crew"?
SQL query sequence:
SELECT college,name FROM match_season AS T1 JOIN team AS T2 ON T1.Team  =  T2.Team_id
SELECT count(DISTINCT College) FROM match_season AS T1 JOIN team AS T2 ON T1.Team  =  T2.Team_id WHERE T2.Name  =  'Miami Fusion'
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"
Final question: How many distinct colleges are associated with players from the team with name "Columbus Crew".
Final SQL: 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"
Database: match_season
Question sequence:
For each player, show the name and the team.
What about adding the corresponding team name for each record?
What are the players and years played for those who are from team "Brown Erdman"?
What about that of "Columbus Crew"?
SQL query sequence:
SELECT player, years_played FROM player
SELECT T1.player, T1.years_played,T2.name FROM player AS T1 JOIN team AS T2 ON T1.Team  =  T2.Team_id WHERE T2.Name  =  "Columbus Crew"
SELECT T1.Player , T1.Years_Played FROM player AS T1 JOIN team AS T2 ON T1.Team  =  T2.Team_id WHERE T2.Name  =  "Brown Erdman"
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"
Final question: Show the players and years played for players from team "Columbus Crew".
Final SQL: 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"