cnatale/presto-athena-txt-2-sql huggingface dataset:
What are the names of all colleges that have two or more players?
Additional table information: table: match_season
SQL: SELECT College FROM match_season GROUP BY College HAVING COUNT(*) >= 2
Show the name of colleges that have at least two players in descending alphabetical order.
Additional table information: table: match_season
SQL: SELECT College FROM match_season GROUP BY College HAVING COUNT(*) >= 2 ORDER BY College DESC
What are the names of colleges that have two or more players, listed in descending alphabetical order?
Additional table information: table: match_season
SQL: SELECT College FROM match_season GROUP BY College HAVING COUNT(*) >= 2 ORDER BY College DESC
What are the names of teams that do no have match season record?
Additional table information: table: match_season
SQL: SELECT Name FROM team WHERE NOT Team_id IN (SELECT Team FROM match_season)
Return the names of teams that have no match season record.
Additional table information: table: match_season
SQL: SELECT Name FROM team WHERE NOT Team_id IN (SELECT Team FROM match_season)
What are the names of countries that have both players with position forward and players with position defender?
Additional table information: table: match_season
SQL: 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'
Return the names of countries that have players that play the Forward position, as well as players who play the Defender position.
Additional table information: table: match_season
SQL: 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'
Which college have both players with position midfielder and players with position defender?
Additional table information: table: match_season
SQL: SELECT College FROM match_season WHERE POSITION = 'Midfielder' INTERSECT SELECT College FROM match_season WHERE POSITION = 'Defender'
Return the colleges that have players who play the Midfielder position, as well as players who play the Defender position.
Additional table information: table: match_season
SQL: SELECT College FROM match_season WHERE POSITION = 'Midfielder' INTERSECT SELECT College FROM match_season WHERE POSITION = 'Defender'
How many climbers are there?
Additional table information: table: climbing
SQL: SELECT COUNT(*) FROM climber
Count the number of climbers.
Additional table information: table: climbing
SQL: SELECT COUNT(*) FROM climber
List the names of climbers in descending order of points.
Additional table information: table: climbing
SQL: SELECT Name FROM climber ORDER BY Points DESC
What are the names of the climbers, ordered by points descending?
Additional table information: table: climbing
SQL: SELECT Name FROM climber ORDER BY Points DESC
List the names of climbers whose country is not Switzerland.
Additional table information: table: climbing
SQL: SELECT Name FROM climber WHERE Country <> 'Switzerland'
What are the names of climbers who are not from the country of Switzerland?
Additional table information: table: climbing
SQL: SELECT Name FROM climber WHERE Country <> 'Switzerland'
What is the maximum point for climbers whose country is United Kingdom?
Additional table information: table: climbing
SQL: SELECT MAX(Points) FROM climber WHERE Country = 'United Kingdom'
Return the maximum number of points for climbers from the United Kingdom.
Additional table information: table: climbing
SQL: SELECT MAX(Points) FROM climber WHERE Country = 'United Kingdom'
How many distinct countries are the climbers from?
Additional table information: table: climbing
SQL: SELECT COUNT(DISTINCT Country) FROM climber
Count the number of different countries that climbers are from.
Additional table information: table: climbing
SQL: SELECT COUNT(DISTINCT Country) FROM climber
What are the names of mountains in ascending alphabetical order?
Additional table information: table: climbing
SQL: SELECT Name FROM mountain ORDER BY Name ASC NULLS FIRST
Give the names of mountains in alphabetical order.
Additional table information: table: climbing
SQL: SELECT Name FROM mountain ORDER BY Name ASC NULLS FIRST
What are the countries of mountains with height bigger than 5000?
Additional table information: table: climbing
SQL: SELECT Country FROM mountain WHERE Height > 5000
Return the countries of the mountains that have a height larger than 5000.
Additional table information: table: climbing
SQL: SELECT Country FROM mountain WHERE Height > 5000
What is the name of the highest mountain?
Additional table information: table: climbing
SQL: SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1
Return the name of the mountain with the greatest height.
Additional table information: table: climbing
SQL: SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1
List the distinct ranges of the mountains with the top 3 prominence.
Additional table information: table: climbing
SQL: SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3
What are the different ranges of the 3 mountains with the highest prominence?
Additional table information: table: climbing
SQL: SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3
Show names of climbers and the names of mountains they climb.
Additional table information: table: climbing
SQL: SELECT T1.Name, T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
What are the names of climbers and the corresponding names of mountains that they climb?
Additional table information: table: climbing
SQL: SELECT T1.Name, T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
Show the names of climbers and the heights of mountains they climb.
Additional table information: table: climbing
SQL: SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
What are the names of climbers and the corresponding heights of the mountains that they climb?
Additional table information: table: climbing
SQL: SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
Show the height of the mountain climbed by the climber with the maximum points.
Additional table information: table: climbing
SQL: 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
What is the height of the mountain climbined by the climbing who had the most points?
Additional table information: table: climbing
SQL: 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
Show the distinct names of mountains climbed by climbers from country 'West Germany'.
Additional table information: table: climbing
SQL: SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = 'West Germany'
What are the different names of mountains ascended by climbers from the country of West Germany?
Additional table information: table: climbing
SQL: SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = 'West Germany'
Show the times used by climbers to climb mountains in Country Uganda.
Additional table information: table: climbing
SQL: SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = 'Uganda'
What are the times used by climbers who climbed mountains in the country of Uganda?
Additional table information: table: climbing
SQL: SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = 'Uganda'
Please show the countries and the number of climbers from each country.
Additional table information: table: climbing
SQL: SELECT Country, COUNT(*) FROM climber GROUP BY Country
How many climbers are from each country?
Additional table information: table: climbing
SQL: SELECT Country, COUNT(*) FROM climber GROUP BY Country
List the countries that have more than one mountain.
Additional table information: table: climbing
SQL: SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1
Which countries have more than one mountain?
Additional table information: table: climbing
SQL: SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1
List the names of mountains that do not have any climber.
Additional table information: table: climbing
SQL: SELECT Name FROM mountain WHERE NOT Mountain_ID IN (SELECT Mountain_ID FROM climber)
What are the names of countains that no climber has climbed?
Additional table information: table: climbing
SQL: SELECT Name FROM mountain WHERE NOT Mountain_ID IN (SELECT Mountain_ID FROM climber)
Show the countries that have mountains with height more than 5600 stories and mountains with height less than 5200.
Additional table information: table: climbing
SQL: SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200
What are the countries that have both mountains that are higher than 5600 and lower than 5200?
Additional table information: table: climbing
SQL: SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200
Show the range that has the most number of mountains.
Additional table information: table: climbing
SQL: SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1
Which range contains the most mountains?
Additional table information: table: climbing
SQL: SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1
Show the names of mountains with height more than 5000 or prominence more than 1000.
Additional table information: table: climbing
SQL: SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000
What are the names of mountains that have a height of over 5000 or a prominence of over 1000?
Additional table information: table: climbing
SQL: SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000
How many body builders are there?
Additional table information: table: body_builder
SQL: SELECT COUNT(*) FROM body_builder
List the total scores of body builders in ascending order.
Additional table information: table: body_builder
SQL: SELECT Total FROM body_builder ORDER BY Total ASC NULLS FIRST
List the snatch score and clean jerk score of body builders in ascending order of snatch score.
Additional table information: table: body_builder
SQL: SELECT Snatch, Clean_Jerk FROM body_builder ORDER BY Snatch ASC NULLS FIRST
What is the average snatch score of body builders?
Additional table information: table: body_builder
SQL: SELECT AVG(Snatch) FROM body_builder
What are the clean and jerk score of the body builder with the highest total score?
Additional table information: table: body_builder
SQL: SELECT Clean_Jerk FROM body_builder ORDER BY Total DESC LIMIT 1
What are the birthdays of people in ascending order of height?
Additional table information: table: body_builder
SQL: SELECT Birth_Date FROM People ORDER BY Height ASC NULLS FIRST
What are the names of body builders?
Additional table information: table: body_builder
SQL: SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID
What are the names of body builders whose total score is higher than 300?
Additional table information: table: body_builder
SQL: SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total > 300
What is the name of the body builder with the greatest body weight?
Additional table information: table: body_builder
SQL: 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
What are the birth date and birth place of the body builder with the highest total points?
Additional table information: table: body_builder
SQL: 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
What are the heights of body builders with total score smaller than 315?
Additional table information: table: body_builder
SQL: SELECT T2.Height FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total < 315
What is the average total score of body builders with height bigger than 200?
Additional table information: table: body_builder
SQL: SELECT AVG(T1.Total) FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 200
What are the names of body builders in descending order of total scores?
Additional table information: table: body_builder
SQL: SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC
List each birth place along with the number of people from there.
Additional table information: table: body_builder
SQL: SELECT Birth_Place, COUNT(*) FROM people GROUP BY Birth_Place
What is the most common birth place of people?
Additional table information: table: body_builder
SQL: SELECT Birth_Place FROM people GROUP BY Birth_Place ORDER BY COUNT(*) DESC LIMIT 1
What are the birth places that are shared by at least two people?
Additional table information: table: body_builder
SQL: SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*) >= 2
List the height and weight of people in descending order of height.
Additional table information: table: body_builder
SQL: SELECT Height, Weight FROM people ORDER BY Height DESC
Show all information about each body builder.
Additional table information: table: body_builder
SQL: SELECT * FROM body_builder
List the names and origins of people who are not body builders.
Additional table information: table: body_builder
SQL: 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
How many distinct birth places are there?
Additional table information: table: body_builder
SQL: SELECT COUNT(DISTINCT Birth_Place) FROM people
How many persons are not body builders?
Additional table information: table: body_builder
SQL: SELECT COUNT(*) FROM people WHERE NOT people_id IN (SELECT People_ID FROM body_builder)
List the weight of the body builders who have snatch score higher than 140 or have the height greater than 200.
Additional table information: table: body_builder
SQL: 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
What are the total scores of the body builders whose birthday contains the string 'January' ?
Additional table information: table: body_builder
SQL: 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%'
What is the minimum snatch score?
Additional table information: table: body_builder
SQL: SELECT MIN(snatch) FROM body_builder
How many elections are there?
Additional table information: table: election_representative
SQL: SELECT COUNT(*) FROM election
List the votes of elections in descending order.
Additional table information: table: election_representative
SQL: SELECT Votes FROM election ORDER BY Votes DESC
List the dates and vote percents of elections.
Additional table information: table: election_representative
SQL: SELECT Date, Vote_Percent FROM election
What are the minimum and maximum vote percents of elections?
Additional table information: table: election_representative
SQL: SELECT MIN(Vote_Percent), MAX(Vote_Percent) FROM election
What are the names and parties of representatives?
Additional table information: table: election_representative
SQL: SELECT Name, Party FROM representative
What are the names of representatives whose party is not 'Republican'?
Additional table information: table: election_representative
SQL: SELECT Name FROM Representative WHERE Party <> 'Republican'
What are the life spans of representatives from New York state or Indiana state?
Additional table information: table: election_representative
SQL: SELECT Lifespan FROM representative WHERE State = 'New York' OR State = 'Indiana'
What are the names of representatives and the dates of elections they participated in.
Additional table information: table: election_representative
SQL: SELECT T2.Name, T1.Date FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID
What are the names of representatives with more than 10000 votes in election?
Additional table information: table: election_representative
SQL: SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE Votes > 10000
What are the names of representatives in descending order of votes?
Additional table information: table: election_representative
SQL: SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes DESC
What is the party of the representative that has the smallest number of votes.
Additional table information: table: election_representative
SQL: SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes ASC NULLS FIRST LIMIT 1
What are the lifespans of representatives in descending order of vote percent?
Additional table information: table: election_representative
SQL: SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY Vote_Percent DESC
What is the average number of votes of representatives from party 'Republican'?
Additional table information: table: election_representative
SQL: SELECT AVG(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE T2.Party = 'Republican'
What are the different parties of representative? Show the party name and the number of representatives in each party.
Additional table information: table: election_representative
SQL: SELECT Party, COUNT(*) FROM representative GROUP BY Party
What is the party that has the largest number of representatives?
Additional table information: table: election_representative
SQL: SELECT Party, COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1
What parties have at least three representatives?
Additional table information: table: election_representative
SQL: SELECT Party FROM representative GROUP BY Party HAVING COUNT(*) >= 3
What states have at least two representatives?
Additional table information: table: election_representative
SQL: SELECT State FROM representative GROUP BY State HAVING COUNT(*) >= 2
List the names of representatives that have not participated in elections listed here.
Additional table information: table: election_representative
SQL: SELECT Name FROM representative WHERE NOT Representative_ID IN (SELECT Representative_ID FROM election)
Show the parties that have both representatives in New York state and representatives in Pennsylvania state.
Additional table information: table: election_representative
SQL: SELECT Party FROM representative WHERE State = 'New York' INTERSECT SELECT Party FROM representative WHERE State = 'Pennsylvania'
How many distinct parties are there for representatives?
Additional table information: table: election_representative
SQL: SELECT COUNT(DISTINCT Party) FROM representative
How many apartment bookings are there in total?
Additional table information: table: apartment_rentals
SQL: SELECT COUNT(*) FROM Apartment_Bookings
Count the total number of apartment bookings.
Additional table information: table: apartment_rentals
SQL: SELECT COUNT(*) FROM Apartment_Bookings
Show the start dates and end dates of all the apartment bookings.
Additional table information: table: apartment_rentals
SQL: SELECT booking_start_date, booking_end_date FROM Apartment_Bookings
What are the start date and end date of each apartment booking?
Additional table information: table: apartment_rentals
SQL: SELECT booking_start_date, booking_end_date FROM Apartment_Bookings
Show all distinct building descriptions.
Additional table information: table: apartment_rentals
SQL: SELECT DISTINCT building_description FROM Apartment_Buildings
Give me a list of all the distinct building descriptions.
Additional table information: table: apartment_rentals
SQL: SELECT DISTINCT building_description FROM Apartment_Buildings
Show the short names of the buildings managed by 'Emma'.
Additional table information: table: apartment_rentals
SQL: SELECT building_short_name FROM Apartment_Buildings WHERE building_manager = 'Emma'
Which buildings does 'Emma' manage? Give me the short names of the buildings.
Additional table information: table: apartment_rentals
SQL: SELECT building_short_name FROM Apartment_Buildings WHERE building_manager = 'Emma'
Show the addresses and phones of all the buildings managed by 'Brenden'.
Additional table information: table: apartment_rentals
SQL: SELECT building_address, building_phone FROM Apartment_Buildings WHERE building_manager = 'Brenden'
What are the address and phone number of the buildings managed by 'Brenden'?
Additional table information: table: apartment_rentals
SQL: SELECT building_address, building_phone FROM Apartment_Buildings WHERE building_manager = 'Brenden'
What are the building full names that contain the word 'court'?
Additional table information: table: apartment_rentals
SQL: SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE '%court%'
Find all the building full names containing the word 'court'.
Additional table information: table: apartment_rentals
SQL: SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE '%court%'
What is the minimum and maximum number of bathrooms of all the apartments?
Additional table information: table: apartment_rentals
SQL: SELECT MIN(bathroom_count), MAX(bathroom_count) FROM Apartments
Give me the minimum and maximum bathroom count among all the apartments.
Additional table information: table: apartment_rentals
SQL: SELECT MIN(bathroom_count), MAX(bathroom_count) FROM Apartments
What is the average number of bedrooms of all apartments?
Additional table information: table: apartment_rentals
SQL: SELECT AVG(bedroom_count) FROM Apartments
Find the average number of bedrooms of all the apartments.
Additional table information: table: apartment_rentals
SQL: SELECT AVG(bedroom_count) FROM Apartments
Return the apartment number and the number of rooms for each apartment.
Additional table information: table: apartment_rentals
SQL: SELECT apt_number, room_count FROM Apartments
What are the apartment number and the room count of each apartment?
Additional table information: table: apartment_rentals
SQL: SELECT apt_number, room_count FROM Apartments
What is the average number of rooms of apartments with type code 'Studio'?
Additional table information: table: apartment_rentals
SQL: SELECT AVG(room_count) FROM Apartments WHERE apt_type_code = 'Studio'
Find the average room count of the apartments that have the 'Studio' type code.
Additional table information: table: apartment_rentals
SQL: SELECT AVG(room_count) FROM Apartments WHERE apt_type_code = 'Studio'
Return the apartment numbers of the apartments with type code 'Flat'.
Additional table information: table: apartment_rentals
SQL: SELECT apt_number FROM Apartments WHERE apt_type_code = 'Flat'
Which apartments have type code 'Flat'? Give me their apartment numbers.
Additional table information: table: apartment_rentals
SQL: SELECT apt_number FROM Apartments WHERE apt_type_code = 'Flat'
Return the first names and last names of all guests
Additional table information: table: apartment_rentals
SQL: SELECT guest_first_name, guest_last_name FROM Guests
What are the first names and last names of all the guests?
Additional table information: table: apartment_rentals
SQL: SELECT guest_first_name, guest_last_name FROM Guests
Return the date of birth for all the guests with gender code 'Male'.
Additional table information: table: apartment_rentals
SQL: SELECT date_of_birth FROM Guests WHERE gender_code = 'Male'
What are dates of birth of all the guests whose gender is 'Male'?
Additional table information: table: apartment_rentals
SQL: SELECT date_of_birth FROM Guests WHERE gender_code = 'Male'
Show the apartment numbers, start dates, and end dates of all the apartment bookings.
Additional table information: table: apartment_rentals
SQL: 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
What are the apartment number, start date, and end date of each apartment booking?
Additional table information: table: apartment_rentals
SQL: 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
What are the booking start and end dates of the apartments with type code 'Duplex'?
Additional table information: table: apartment_rentals
SQL: 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'
Return the booking start date and end date for the apartments that have type code 'Duplex'.
Additional table information: table: apartment_rentals
SQL: 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'
What are the booking start and end dates of the apartments with more than 2 bedrooms?
Additional table information: table: apartment_rentals
SQL: 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
Find the booking start date and end date for the apartments that have more than two bedrooms.
Additional table information: table: apartment_rentals
SQL: 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
What is the booking status code of the apartment with apartment number 'Suite 634'?
Additional table information: table: apartment_rentals
SQL: 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'
Tell me the booking status code for the apartment with number 'Suite 634'.
Additional table information: table: apartment_rentals
SQL: 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'
Show the distinct apartment numbers of the apartments that have bookings with status code 'Confirmed'.
Additional table information: table: apartment_rentals
SQL: 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'
Which apartments have bookings with status code 'Confirmed'? Return their apartment numbers.
Additional table information: table: apartment_rentals
SQL: 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'
Show the average room count of the apartments that have booking status code 'Provisional'.
Additional table information: table: apartment_rentals
SQL: 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'
What is the average room count of the apartments whose booking status code is 'Provisional'?
Additional table information: table: apartment_rentals
SQL: 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'
Show the guest first names, start dates, and end dates of all the apartment bookings.
Additional table information: table: apartment_rentals
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
What are the guest first name, start date, and end date of each apartment booking?
Additional table information: table: apartment_rentals
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
Show the start dates and end dates of all the apartment bookings made by guests with gender code 'Female'.
Additional table information: table: apartment_rentals
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'
What are the start date and end date of the apartment bookings made by female guests (gender code 'Female')?
Additional table information: table: apartment_rentals
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'
Show the first names and last names of all the guests that have apartment bookings with status code 'Confirmed'.
Additional table information: table: apartment_rentals
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'
Which guests have apartment bookings with status code 'Confirmed'? Return their first names and last names.
Additional table information: table: apartment_rentals
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'
Show the facility codes of apartments with more than 4 bedrooms.
Additional table information: table: apartment_rentals
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
What are the facility codes of the apartments with more than four bedrooms?
Additional table information: table: apartment_rentals
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
Show the total number of rooms of all apartments with facility code 'Gym'.
Additional table information: table: apartment_rentals
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'
Find the total number of rooms in the apartments that have facility code 'Gym'.
Additional table information: table: apartment_rentals
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'
Show the total number of rooms of the apartments in the building with short name 'Columbus Square'.
Additional table information: table: apartment_rentals
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'
How many rooms in total are there in the apartments in the building with short name 'Columbus Square'?
Additional table information: table: apartment_rentals
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'
Show the addresses of the buildings that have apartments with more than 2 bathrooms.
Additional table information: table: apartment_rentals
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
Which buildings have apartments that have more than two bathrooms? Give me the addresses of the buildings.
Additional table information: table: apartment_rentals
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
Show the apartment type codes and apartment numbers in the buildings managed by 'Kyle'.
Additional table information: table: apartment_rentals
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'
What apartment type codes and apartment numbers do the buildings managed by 'Kyle' have?
Additional table information: table: apartment_rentals
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'
Show the booking status code and the corresponding number of bookings.
Additional table information: table: apartment_rentals
SQL: SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code
How many bookings does each booking status have? List the booking status code and the number of corresponding bookings.
Additional table information: table: apartment_rentals
SQL: SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code
Return all the apartment numbers sorted by the room count in ascending order.
Additional table information: table: apartment_rentals
SQL: SELECT apt_number FROM Apartments ORDER BY room_count ASC NULLS FIRST
Sort the apartment numbers in ascending order of room count.
Additional table information: table: apartment_rentals
SQL: SELECT apt_number FROM Apartments ORDER BY room_count ASC NULLS FIRST
Return the apartment number with the largest number of bedrooms.
Additional table information: table: apartment_rentals
SQL: SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1
What is the apartment number of the apartment with the most beds?
Additional table information: table: apartment_rentals
SQL: SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1
Show the apartment type codes and the corresponding number of apartments sorted by the number of apartments in ascending order.
Additional table information: table: apartment_rentals
SQL: SELECT apt_type_code, COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) ASC NULLS FIRST
Return each apartment type code with the number of apartments having that apartment type, in ascending order of the number of apartments.
Additional table information: table: apartment_rentals
SQL: SELECT apt_type_code, COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) ASC NULLS FIRST
Show the top 3 apartment type codes sorted by the average number of rooms in descending order.
Additional table information: table: apartment_rentals
SQL: SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY AVG(room_count) DESC LIMIT 3
What are the top three apartment types in terms of the average room count? Give me the
Additional table information: table: apartment_rentals
SQL: SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY AVG(room_count) DESC LIMIT 3
Show the apartment type code that has the largest number of total rooms, together with the number of bathrooms and number of bedrooms.
Additional table information: table: apartment_rentals
SQL: SELECT apt_type_code, bathroom_count, bedroom_count FROM Apartments GROUP BY apt_type_code ORDER BY SUM(room_count) DESC LIMIT 1
Which apartment type has the largest number of total rooms? Return the apartment type code, its number of bathrooms and number of bedrooms.
Additional table information: table: apartment_rentals
SQL: SELECT apt_type_code, bathroom_count, bedroom_count FROM Apartments GROUP BY apt_type_code ORDER BY SUM(room_count) DESC LIMIT 1
Show the most common apartment type code.
Additional table information: table: apartment_rentals
SQL: SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) DESC LIMIT 1
Which apartment type code appears the most often?
Additional table information: table: apartment_rentals
SQL: SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) DESC LIMIT 1
Show the most common apartment type code among apartments with more than 1 bathroom.
Additional table information: table: apartment_rentals
SQL: SELECT apt_type_code FROM Apartments WHERE bathroom_count > 1 GROUP BY apt_type_code ORDER BY COUNT(*) DESC LIMIT 1
Which apartment type code is the most common among apartments with more than one bathroom?
Additional table information: table: apartment_rentals
SQL: SELECT apt_type_code FROM Apartments WHERE bathroom_count > 1 GROUP BY apt_type_code ORDER BY COUNT(*) DESC LIMIT 1
Show each apartment type code, and the maximum and minimum number of rooms for each type.
Additional table information: table: apartment_rentals
SQL: SELECT apt_type_code, MAX(room_count), MIN(room_count) FROM Apartments GROUP BY apt_type_code
Return each apartment type code along with the maximum and minimum number of rooms among each type.
Additional table information: table: apartment_rentals
SQL: SELECT apt_type_code, MAX(room_count), MIN(room_count) FROM Apartments GROUP BY apt_type_code
Show each gender code and the corresponding count of guests sorted by the count in descending order.
Additional table information: table: apartment_rentals
SQL: SELECT gender_code, COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC
Sort the gender codes in descending order of their corresponding number of guests. Return both the gender codes and counts.
Additional table information: table: apartment_rentals
SQL: SELECT gender_code, COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC
How many apartments do not have any facility?
Additional table information: table: apartment_rentals
SQL: SELECT COUNT(*) FROM Apartments WHERE NOT apt_id IN (SELECT apt_id FROM Apartment_Facilities)
Find the number of apartments that have no facility.
Additional table information: table: apartment_rentals
SQL: SELECT COUNT(*) FROM Apartments WHERE NOT apt_id IN (SELECT apt_id FROM Apartment_Facilities)
Show the apartment numbers of apartments with bookings that have status code both 'Provisional' and 'Confirmed'
Additional table information: table: apartment_rentals
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'
Which apartments have bookings with both status codes 'Provisional' and 'Confirmed'? Give me the apartment numbers.
Additional table information: table: apartment_rentals
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'
Show the apartment numbers of apartments with unit status availability of both 0 and 1.
Additional table information: table: apartment_rentals
SQL: SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 0 INTERSECT SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 1
Which apartments have unit status availability of both 0 and 1? Return their apartment numbers.
Additional table information: table: apartment_rentals
SQL: SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 0 INTERSECT SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 1
How many games are held after season 2007?
Additional table information: table: game_injury
SQL: SELECT COUNT(*) FROM game WHERE season > 2007
List the dates of games by the home team name in descending order.
Additional table information: table: game_injury
SQL: SELECT Date FROM game ORDER BY home_team DESC
List the season, home team, away team of all the games.
Additional table information: table: game_injury
SQL: SELECT season, home_team, away_team FROM game
What are the maximum, minimum and average home games each stadium held?
Additional table information: table: game_injury
SQL: SELECT MAX(home_games), MIN(home_games), AVG(home_games) FROM stadium
What is the average attendance of stadiums with capacity percentage higher than 100%?
Additional table information: table: game_injury
SQL: SELECT average_attendance FROM stadium WHERE capacity_percentage > 100
What are the player name, number of matches, and information source for players who do not suffer from injury of 'Knee problem'?
Additional table information: table: game_injury
SQL: SELECT player, number_of_matches, SOURCE FROM injury_accident WHERE injury <> 'Knee problem'
What is the season of the game which causes the player 'Walter Samuel' to get injured?
Additional table information: table: game_injury
SQL: SELECT T1.season FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id WHERE T2.player = 'Walter Samuel'
What are the ids, scores, and dates of the games which caused at least two injury accidents?
Additional table information: table: game_injury
SQL: SELECT T1.id, T1.score, T1.date FROM game AS T1 JOIN injury_accident AS T2 ON T2.game_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2
What are the id and name of the stadium where the most injury accidents happened?
Additional table information: table: game_injury
SQL: SELECT T1.id, T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id JOIN injury_accident AS T3 ON T2.id = T3.game_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1
Find the id and name of the stadium where the largest number of injury accidents occurred.
Additional table information: table: game_injury
SQL: SELECT T1.id, T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id JOIN injury_accident AS T3 ON T2.id = T3.game_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1
In which season and which stadium did any player have an injury of 'Foot injury' or 'Knee problem'?
Additional table information: table: game_injury
SQL: SELECT T1.season, T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.injury = 'Foot injury' OR T3.injury = 'Knee problem'
How many different kinds of information sources are there for injury accidents?
Additional table information: table: game_injury
SQL: SELECT COUNT(DISTINCT SOURCE) FROM injury_accident
How many games are free of injury accidents?
Additional table information: table: game_injury
SQL: SELECT COUNT(*) FROM game WHERE NOT id IN (SELECT game_id FROM injury_accident)
How many distinct kinds of injuries happened after season 2010?
Additional table information: table: game_injury
SQL: SELECT COUNT(DISTINCT T1.injury) FROM injury_accident AS T1 JOIN game AS T2 ON T1.game_id = T2.id WHERE T2.season > 2010
List the name of the stadium where both the player 'Walter Samuel' and the player 'Thiago Motta' got injured.
Additional table information: table: game_injury
SQL: SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.player = 'Walter Samuel' INTERSECT SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.player = 'Thiago Motta'
Show the name, average attendance, total attendance for stadiums where no accidents happened.
Additional table information: table: game_injury
SQL: SELECT name, average_attendance, total_attendance FROM stadium EXCEPT SELECT T2.name, T2.average_attendance, T2.total_attendance FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id
Which stadium name contains the substring 'Bank'?
Additional table information: table: game_injury
SQL: SELECT name FROM stadium WHERE name LIKE '%Bank%'
How many games has each stadium held?
Additional table information: table: game_injury
SQL: SELECT T1.id, COUNT(*) FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id GROUP BY T1.id
For each injury accident, find the date of the game and the name of the injured player in the game, and sort the results in descending order of game season.
Additional table information: table: game_injury
SQL: SELECT T1.date, T2.player FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id ORDER BY T1.season DESC
List all country and league names.
Additional table information: table: soccer_1
SQL: SELECT T1.name, T2.name FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id
How many leagues are there in England?
Additional table information: table: soccer_1
SQL: SELECT COUNT(*) FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id WHERE T1.name = 'England'
What is the average weight of all players?
Additional table information: table: soccer_1
SQL: SELECT AVG(weight) FROM Player
What is the maximum and minimum height of all players?
Additional table information: table: soccer_1
SQL: SELECT MAX(weight), MIN(weight) FROM Player
List all player names who have an overall rating higher than the average.
Additional table information: table: soccer_1
SQL: SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.overall_rating > (SELECT AVG(overall_rating) FROM Player_Attributes)
What are the names of players who have the best dribbling?
Additional table information: table: soccer_1
SQL: SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.dribbling = (SELECT MAX(overall_rating) FROM Player_Attributes)
List the names of all players who have a crossing score higher than 90 and prefer their right foot.
Additional table information: table: soccer_1
SQL: SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.crossing > 90 AND T2.preferred_foot = 'right'
List the names of all left-footed players who have overall rating between 85 and 90.
Additional table information: table: soccer_1
SQL: SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.preferred_foot = 'left' AND T2.overall_rating >= 85 AND T2.overall_rating <= 90
What is the average rating for right-footed players and left-footed players?
Additional table information: table: soccer_1
SQL: SELECT preferred_foot, AVG(overall_rating) FROM Player_Attributes GROUP BY preferred_foot
Of all players with an overall rating greater than 80, how many are right-footed and left-footed?
Additional table information: table: soccer_1
SQL: SELECT preferred_foot, COUNT(*) FROM Player_Attributes WHERE overall_rating > 80 GROUP BY preferred_foot
List all of the player ids with a height of at least 180cm and an overall rating higher than 85.
Additional table information: table: soccer_1
SQL: SELECT player_api_id FROM Player WHERE height >= 180 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE overall_rating > 85
List all of the ids for left-footed players with a height between 180cm and 190cm.
Additional table information: table: soccer_1
SQL: SELECT player_api_id FROM Player WHERE height >= 180 AND height <= 190 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE preferred_foot = 'left'
Who are the top 3 players in terms of overall rating?
Additional table information: table: soccer_1
SQL: SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY overall_rating DESC LIMIT 3
List the names and birthdays of the top five players in terms of potential.
Additional table information: table: soccer_1
SQL: SELECT DISTINCT T1.player_name, T1.birthday FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY potential DESC LIMIT 5
How many performances are there?
Additional table information: table: performance_attendance
SQL: SELECT COUNT(*) FROM performance
List the hosts of performances in ascending order of attendance.
Additional table information: table: performance_attendance
SQL: SELECT HOST FROM performance ORDER BY Attendance ASC NULLS FIRST
What are the dates and locations of performances?
Additional table information: table: performance_attendance
SQL: SELECT Date, LOCATION FROM performance