db_id
stringlengths 3
31
| query
stringlengths 18
577
| question
stringlengths 3
224
| schema
stringlengths 177
6.14k
| primary_keys
stringlengths 16
545
| foreign_keys
stringlengths 16
1.48k
|
---|---|---|---|---|---|
apartment_rentals
|
SELECT building_short_name FROM Apartment_Buildings WHERE building_manager = "Emma"
|
Show the short names of the buildings managed by "Emma".
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT building_short_name FROM Apartment_Buildings WHERE building_manager = "Emma"
|
Which buildings does "Emma" manage? Give me the short names of the buildings.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT building_address , building_phone FROM Apartment_Buildings WHERE building_manager = "Brenden"
|
Show the addresses and phones of all the buildings managed by "Brenden".
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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"?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE "%court%"
|
What are the building full names that contain the word "court"?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE "%court%"
|
Find all the building full names containing the word "court".
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT min(bathroom_count) , max(bathroom_count) FROM Apartments
|
What is the minimum and maximum number of bathrooms of all the apartments?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT min(bathroom_count) , max(bathroom_count) FROM Apartments
|
Give me the minimum and maximum bathroom count among all the apartments.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT avg(bedroom_count) FROM Apartments
|
What is the average number of bedrooms of all apartments?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT avg(bedroom_count) FROM Apartments
|
Find the average number of bedrooms of all the apartments.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT apt_number , room_count FROM Apartments
|
Return the apartment number and the number of rooms for each apartment.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT apt_number , room_count FROM Apartments
|
What are the apartment number and the room count of each apartment?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT avg(room_count) FROM Apartments WHERE apt_type_code = "Studio"
|
What is the average number of rooms of apartments with type code "Studio"?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT apt_number FROM Apartments WHERE apt_type_code = "Flat"
|
Return the apartment numbers of the apartments with type code "Flat".
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT apt_number FROM Apartments WHERE apt_type_code = "Flat"
|
Which apartments have type code "Flat"? Give me their apartment numbers.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT guest_first_name , guest_last_name FROM Guests
|
Return the first names and last names of all guests
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT guest_first_name , guest_last_name FROM Guests
|
What are the first names and last names of all the guests?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT date_of_birth FROM Guests WHERE gender_code = "Male"
|
Return the date of birth for all the guests with gender code "Male".
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT date_of_birth FROM Guests WHERE gender_code = "Male"
|
What are dates of birth of all the guests whose gender is "Male"?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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
|
Show the apartment numbers, start dates, and end dates of all the apartment bookings.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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 type code "Duplex"?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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".
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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 are the booking start and end dates of the apartments with more than 2 bedrooms?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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"
|
What is the booking status code of the apartment with apartment number "Suite 634"?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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".
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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 distinct apartment numbers of the apartments that have bookings with status code "Confirmed".
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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 average room count of the apartments that have booking status code "Provisional".
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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"?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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 guest first names, start dates, and end dates of all the apartment bookings.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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 start dates and end dates of all the apartment bookings made by guests with gender code "Female".
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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")?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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 first names and last names of all the guests that have apartment bookings with status code "Confirmed".
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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 facility codes of apartments with more than 4 bedrooms.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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 all apartments with facility code "Gym".
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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".
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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 total number of rooms of the apartments in the building with short name "Columbus Square".
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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"?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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 addresses of the buildings that have apartments with more than 2 bathrooms.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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 apartment type codes and apartment numbers in the buildings managed by "Kyle".
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT booking_status_code , COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code
|
Show the booking status code and the corresponding number of bookings.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT apt_number FROM Apartments ORDER BY room_count ASC
|
Return all the apartment numbers sorted by the room count in ascending order.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT apt_number FROM Apartments ORDER BY room_count ASC
|
Sort the apartment numbers in ascending order of room count.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1
|
Return the apartment number with the largest number of bedrooms.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1
|
What is the apartment number of the apartment with the most beds?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT apt_type_code , COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) ASC
|
Show the apartment type codes and the corresponding number of apartments sorted by the number of apartments in ascending order.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT apt_type_code , COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) ASC
|
Return each apartment type code with the number of apartments having that apartment type, in ascending order of the number of apartments.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY avg(room_count) DESC LIMIT 3
|
Show the top 3 apartment type codes sorted by the average number of rooms in descending order.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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 apartment type code that has the largest number of total rooms, together with the number of bathrooms and number of bedrooms.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1
|
Show the most common apartment type code.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT apt_type_code FROM Apartments WHERE bathroom_count > 1 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.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT apt_type_code , max(room_count) , min(room_count) FROM Apartments GROUP BY apt_type_code
|
Show each apartment type code, and the maximum and minimum number of rooms for each type.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT gender_code , COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC
|
Show each gender code and the corresponding count of guests sorted by the count in descending order.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT count(*) FROM Apartments WHERE apt_id NOT IN (SELECT apt_id FROM Apartment_Facilities)
|
How many apartments do not have any facility?
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
SELECT count(*) FROM Apartments WHERE apt_id NOT IN (SELECT apt_id FROM Apartment_Facilities)
|
Find the number of apartments that have no facility.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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 bookings that have status code both "Provisional" and "Confirmed"
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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
|
Show the apartment numbers of apartments with unit status availability of both 0 and 1.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
apartment_rentals
|
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.
|
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
|
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
|
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
|
game_injury
|
SELECT count(*) FROM game WHERE season > 2007
|
How many games are held after season 2007?
|
[Schema (values) (types)]: | game_injury | stadium : id (text) , name (number) , home_games (text) , average_attendance (number) , total_attendance (number) , capacity_percentage (number) | game : stadium_id (text) , id (number) , season (text) , date (number) , home_team (number) , away_team (number) , score (number) , competition (number) | injury_accident : game_id (text) , id (number) , player (text) , injury (number) , number_of_matches (number) , source (number);
|
[Primary Keys]: stadium : id, game : id, injury_accident : id
|
[Foreign Keys]: game : stadium_id = stadium : id | injury_accident : game_id = game : id
|
game_injury
|
SELECT Date FROM game ORDER BY home_team DESC
|
List the dates of games by the home team name in descending order.
|
[Schema (values) (types)]: | game_injury | stadium : id (text) , name (number) , home_games (text) , average_attendance (number) , total_attendance (number) , capacity_percentage (number) | game : stadium_id (text) , id (number) , season (text) , date (number) , home_team (number) , away_team (number) , score (number) , competition (number) | injury_accident : game_id (text) , id (number) , player (text) , injury (number) , number_of_matches (number) , source (number);
|
[Primary Keys]: stadium : id, game : id, injury_accident : id
|
[Foreign Keys]: game : stadium_id = stadium : id | injury_accident : game_id = game : id
|
game_injury
|
SELECT season , home_team , away_team FROM game
|
List the season, home team, away team of all the games.
|
[Schema (values) (types)]: | game_injury | stadium : id (text) , name (number) , home_games (text) , average_attendance (number) , total_attendance (number) , capacity_percentage (number) | game : stadium_id (text) , id (number) , season (text) , date (number) , home_team (number) , away_team (number) , score (number) , competition (number) | injury_accident : game_id (text) , id (number) , player (text) , injury (number) , number_of_matches (number) , source (number);
|
[Primary Keys]: stadium : id, game : id, injury_accident : id
|
[Foreign Keys]: game : stadium_id = stadium : id | injury_accident : game_id = game : id
|
game_injury
|
SELECT max(home_games) , min(home_games) , avg(home_games) FROM stadium
|
What are the maximum, minimum and average home games each stadium held?
|
[Schema (values) (types)]: | game_injury | stadium : id (text) , name (number) , home_games (text) , average_attendance (number) , total_attendance (number) , capacity_percentage (number) | game : stadium_id (text) , id (number) , season (text) , date (number) , home_team (number) , away_team (number) , score (number) , competition (number) | injury_accident : game_id (text) , id (number) , player (text) , injury (number) , number_of_matches (number) , source (number);
|
[Primary Keys]: stadium : id, game : id, injury_accident : id
|
[Foreign Keys]: game : stadium_id = stadium : id | injury_accident : game_id = game : id
|
game_injury
|
SELECT average_attendance FROM stadium WHERE capacity_percentage > 100
|
What is the average attendance of stadiums with capacity percentage higher than 100%?
|
[Schema (values) (types)]: | game_injury | stadium : id (text) , name (number) , home_games (text) , average_attendance (number) , total_attendance (number) , capacity_percentage (number) | game : stadium_id (text) , id (number) , season (text) , date (number) , home_team (number) , away_team (number) , score (number) , competition (number) | injury_accident : game_id (text) , id (number) , player (text) , injury (number) , number_of_matches (number) , source (number);
|
[Primary Keys]: stadium : id, game : id, injury_accident : id
|
[Foreign Keys]: game : stadium_id = stadium : id | injury_accident : game_id = game : id
|
game_injury
|
SELECT player , number_of_matches , SOURCE FROM injury_accident WHERE injury != 'Knee problem'
|
What are the player name, number of matches, and information source for players who do not suffer from injury of 'Knee problem'?
|
[Schema (values) (types)]: | game_injury | stadium : id (text) , name (number) , home_games (text) , average_attendance (number) , total_attendance (number) , capacity_percentage (number) | game : stadium_id (text) , id (number) , season (text) , date (number) , home_team (number) , away_team (number) , score (number) , competition (number) | injury_accident : game_id (text) , id (number) , player (text) , injury (number) , number_of_matches (number) , source (number);
|
[Primary Keys]: stadium : id, game : id, injury_accident : id
|
[Foreign Keys]: game : stadium_id = stadium : id | injury_accident : game_id = game : id
|
game_injury
|
SELECT T1.season FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id WHERE T2.player = 'Walter Samuel'
|
What is the season of the game which causes the player 'Walter Samuel' to get injured?
|
[Schema (values) (types)]: | game_injury | stadium : id (text) , name (number) , home_games (text) , average_attendance (number) , total_attendance (number) , capacity_percentage (number) | game : stadium_id (text) , id (number) , season (text) , date (number) , home_team (number) , away_team (number) , score (number) , competition (number) | injury_accident : game_id (text) , id (number) , player (text) , injury (number) , number_of_matches (number) , source (number);
|
[Primary Keys]: stadium : id, game : id, injury_accident : id
|
[Foreign Keys]: game : stadium_id = stadium : id | injury_accident : game_id = game : id
|
game_injury
|
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 ids, scores, and dates of the games which caused at least two injury accidents?
|
[Schema (values) (types)]: | game_injury | stadium : id (text) , name (number) , home_games (text) , average_attendance (number) , total_attendance (number) , capacity_percentage (number) | game : stadium_id (text) , id (number) , season (text) , date (number) , home_team (number) , away_team (number) , score (number) , competition (number) | injury_accident : game_id (text) , id (number) , player (text) , injury (number) , number_of_matches (number) , source (number);
|
[Primary Keys]: stadium : id, game : id, injury_accident : id
|
[Foreign Keys]: game : stadium_id = stadium : id | injury_accident : game_id = game : id
|
game_injury
|
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
|
What are the id and name of the stadium where the most injury accidents happened?
|
[Schema (values) (types)]: | game_injury | stadium : id (text) , name (number) , home_games (text) , average_attendance (number) , total_attendance (number) , capacity_percentage (number) | game : stadium_id (text) , id (number) , season (text) , date (number) , home_team (number) , away_team (number) , score (number) , competition (number) | injury_accident : game_id (text) , id (number) , player (text) , injury (number) , number_of_matches (number) , source (number);
|
[Primary Keys]: stadium : id, game : id, injury_accident : id
|
[Foreign Keys]: game : stadium_id = stadium : id | injury_accident : game_id = game : id
|
game_injury
|
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.
|
[Schema (values) (types)]: | game_injury | stadium : id (text) , name (number) , home_games (text) , average_attendance (number) , total_attendance (number) , capacity_percentage (number) | game : stadium_id (text) , id (number) , season (text) , date (number) , home_team (number) , away_team (number) , score (number) , competition (number) | injury_accident : game_id (text) , id (number) , player (text) , injury (number) , number_of_matches (number) , source (number);
|
[Primary Keys]: stadium : id, game : id, injury_accident : id
|
[Foreign Keys]: game : stadium_id = stadium : id | injury_accident : game_id = game : id
|
game_injury
|
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'
|
In which season and which stadium did any player have an injury of 'Foot injury' or 'Knee problem'?
|
[Schema (values) (types)]: | game_injury | stadium : id (text) , name (number) , home_games (text) , average_attendance (number) , total_attendance (number) , capacity_percentage (number) | game : stadium_id (text) , id (number) , season (text) , date (number) , home_team (number) , away_team (number) , score (number) , competition (number) | injury_accident : game_id (text) , id (number) , player (text) , injury (number) , number_of_matches (number) , source (number);
|
[Primary Keys]: stadium : id, game : id, injury_accident : id
|
[Foreign Keys]: game : stadium_id = stadium : id | injury_accident : game_id = game : id
|
game_injury
|
SELECT count(DISTINCT SOURCE) FROM injury_accident
|
How many different kinds of information sources are there for injury accidents?
|
[Schema (values) (types)]: | game_injury | stadium : id (text) , name (number) , home_games (text) , average_attendance (number) , total_attendance (number) , capacity_percentage (number) | game : stadium_id (text) , id (number) , season (text) , date (number) , home_team (number) , away_team (number) , score (number) , competition (number) | injury_accident : game_id (text) , id (number) , player (text) , injury (number) , number_of_matches (number) , source (number);
|
[Primary Keys]: stadium : id, game : id, injury_accident : id
|
[Foreign Keys]: game : stadium_id = stadium : id | injury_accident : game_id = game : id
|
game_injury
|
SELECT count(*) FROM game WHERE id NOT IN ( SELECT game_id FROM injury_accident )
|
How many games are free of injury accidents?
|
[Schema (values) (types)]: | game_injury | stadium : id (text) , name (number) , home_games (text) , average_attendance (number) , total_attendance (number) , capacity_percentage (number) | game : stadium_id (text) , id (number) , season (text) , date (number) , home_team (number) , away_team (number) , score (number) , competition (number) | injury_accident : game_id (text) , id (number) , player (text) , injury (number) , number_of_matches (number) , source (number);
|
[Primary Keys]: stadium : id, game : id, injury_accident : id
|
[Foreign Keys]: game : stadium_id = stadium : id | injury_accident : game_id = game : id
|
game_injury
|
SELECT count(DISTINCT T1.injury) FROM injury_accident AS T1 JOIN game AS T2 ON T1.game_id = T2.id WHERE T2.season > 2010
|
How many distinct kinds of injuries happened after season 2010?
|
[Schema (values) (types)]: | game_injury | stadium : id (text) , name (number) , home_games (text) , average_attendance (number) , total_attendance (number) , capacity_percentage (number) | game : stadium_id (text) , id (number) , season (text) , date (number) , home_team (number) , away_team (number) , score (number) , competition (number) | injury_accident : game_id (text) , id (number) , player (text) , injury (number) , number_of_matches (number) , source (number);
|
[Primary Keys]: stadium : id, game : id, injury_accident : id
|
[Foreign Keys]: game : stadium_id = stadium : id | injury_accident : game_id = game : id
|
game_injury
|
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'
|
List the name of the stadium where both the player 'Walter Samuel' and the player 'Thiago Motta' got injured.
|
[Schema (values) (types)]: | game_injury | stadium : id (text) , name (number) , home_games (text) , average_attendance (number) , total_attendance (number) , capacity_percentage (number) | game : stadium_id (text) , id (number) , season (text) , date (number) , home_team (number) , away_team (number) , score (number) , competition (number) | injury_accident : game_id (text) , id (number) , player (text) , injury (number) , number_of_matches (number) , source (number);
|
[Primary Keys]: stadium : id, game : id, injury_accident : id
|
[Foreign Keys]: game : stadium_id = stadium : id | injury_accident : game_id = game : id
|
game_injury
|
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
|
Show the name, average attendance, total attendance for stadiums where no accidents happened.
|
[Schema (values) (types)]: | game_injury | stadium : id (text) , name (number) , home_games (text) , average_attendance (number) , total_attendance (number) , capacity_percentage (number) | game : stadium_id (text) , id (number) , season (text) , date (number) , home_team (number) , away_team (number) , score (number) , competition (number) | injury_accident : game_id (text) , id (number) , player (text) , injury (number) , number_of_matches (number) , source (number);
|
[Primary Keys]: stadium : id, game : id, injury_accident : id
|
[Foreign Keys]: game : stadium_id = stadium : id | injury_accident : game_id = game : id
|
game_injury
|
SELECT name FROM stadium WHERE name LIKE "%Bank%"
|
Which stadium name contains the substring "Bank"?
|
[Schema (values) (types)]: | game_injury | stadium : id (text) , name (number) , home_games (text) , average_attendance (number) , total_attendance (number) , capacity_percentage (number) | game : stadium_id (text) , id (number) , season (text) , date (number) , home_team (number) , away_team (number) , score (number) , competition (number) | injury_accident : game_id (text) , id (number) , player (text) , injury (number) , number_of_matches (number) , source (number);
|
[Primary Keys]: stadium : id, game : id, injury_accident : id
|
[Foreign Keys]: game : stadium_id = stadium : id | injury_accident : game_id = game : id
|
game_injury
|
SELECT T1.id , count(*) FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id GROUP BY T1.id
|
How many games has each stadium held?
|
[Schema (values) (types)]: | game_injury | stadium : id (text) , name (number) , home_games (text) , average_attendance (number) , total_attendance (number) , capacity_percentage (number) | game : stadium_id (text) , id (number) , season (text) , date (number) , home_team (number) , away_team (number) , score (number) , competition (number) | injury_accident : game_id (text) , id (number) , player (text) , injury (number) , number_of_matches (number) , source (number);
|
[Primary Keys]: stadium : id, game : id, injury_accident : id
|
[Foreign Keys]: game : stadium_id = stadium : id | injury_accident : game_id = game : id
|
game_injury
|
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
|
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.
|
[Schema (values) (types)]: | game_injury | stadium : id (text) , name (number) , home_games (text) , average_attendance (number) , total_attendance (number) , capacity_percentage (number) | game : stadium_id (text) , id (number) , season (text) , date (number) , home_team (number) , away_team (number) , score (number) , competition (number) | injury_accident : game_id (text) , id (number) , player (text) , injury (number) , number_of_matches (number) , source (number);
|
[Primary Keys]: stadium : id, game : id, injury_accident : id
|
[Foreign Keys]: game : stadium_id = stadium : id | injury_accident : game_id = game : id
|
soccer_1
|
SELECT T1.name , T2.name FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id
|
List all country and league names.
|
[Schema (values) (types)]: | soccer_1 | Player_Attributes : id (text) , player_fifa_api_id (number) , player_api_id (number) , date (number) , overall_rating (text) , potential (number) , preferred_foot (number) , attacking_work_rate (text) , defensive_work_rate (text) , crossing (text) , finishing (number) , heading_accuracy (number) , short_passing (number) , volleys (number) , dribbling (number) , curve (number) , free_kick_accuracy (number) , long_passing (number) , ball_control (number) , acceleration (number) , sprint_speed (number) , agility (number) , reactions (number) , balance (number) , shot_power (number) , jumping (number) , stamina (number) , strength (number) , long_shots (number) , aggression (number) , interceptions (number) , positioning (number) , vision (number) , penalties (number) , marking (number) , standing_tackle (number) , sliding_tackle (number) , gk_diving (number) , gk_handling (number) , gk_kicking (number) , gk_positioning (number) , gk_reflexes (number) | sqlite_sequence : name (text) , seq (number) | Player : id (text) , player_api_id (number) , player_name (number) , player_fifa_api_id (number) , birthday (text) , height (number) , weight (number) | League : id (text) , country_id (number) , name (number) | Country : id (text) , name (number) | Team : id (text) , team_api_id (number) , team_fifa_api_id (number) , team_long_name (number) , team_short_name (text) | Team_Attributes : id (text) , team_fifa_api_id (number) , team_api_id (number) , date (number) , buildupplayspeed (text) , buildupplayspeedclass (number) , buildupplaydribbling (number) , buildupplaydribblingclass (text) , buildupplaypassing (text) , buildupplaypassingclass (text) , buildupplaypositioningclass (number) , chancecreationpassing (number) , chancecreationpassingclass (number) , chancecreationcrossing (number) , chancecreationcrossingclass (number) , chancecreationshooting (number) , chancecreationshootingclass (number) , chancecreationpositioningclass (number) , defencepressure (number) , defencepressureclass (number) , defenceaggression (number) , defenceaggressionclass (number) , defenceteamwidth (number) , defenceteamwidthclass (number) , defencedefenderlineclass (number);
|
[Primary Keys]: player_attributes : id, sqlite_sequence : id, player : id, league : id, country : id, team : id
|
[Foreign Keys]: player_attributes : player_api_id = player : player_api_id | player_attributes : player_fifa_api_id = player : player_fifa_api_id | league : country_id = country : id | team_attributes : team_api_id = team : team_api_id | team_attributes : team_fifa_api_id = team : team_fifa_api_id
|
soccer_1
|
SELECT count(*) FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id WHERE T1.name = "England"
|
How many leagues are there in England?
|
[Schema (values) (types)]: | soccer_1 | Player_Attributes : id (text) , player_fifa_api_id (number) , player_api_id (number) , date (number) , overall_rating (text) , potential (number) , preferred_foot (number) , attacking_work_rate (text) , defensive_work_rate (text) , crossing (text) , finishing (number) , heading_accuracy (number) , short_passing (number) , volleys (number) , dribbling (number) , curve (number) , free_kick_accuracy (number) , long_passing (number) , ball_control (number) , acceleration (number) , sprint_speed (number) , agility (number) , reactions (number) , balance (number) , shot_power (number) , jumping (number) , stamina (number) , strength (number) , long_shots (number) , aggression (number) , interceptions (number) , positioning (number) , vision (number) , penalties (number) , marking (number) , standing_tackle (number) , sliding_tackle (number) , gk_diving (number) , gk_handling (number) , gk_kicking (number) , gk_positioning (number) , gk_reflexes (number) | sqlite_sequence : name (text) , seq (number) | Player : id (text) , player_api_id (number) , player_name (number) , player_fifa_api_id (number) , birthday (text) , height (number) , weight (number) | League : id (text) , country_id (number) , name (number) | Country : id (text) , name (number) | Team : id (text) , team_api_id (number) , team_fifa_api_id (number) , team_long_name (number) , team_short_name (text) | Team_Attributes : id (text) , team_fifa_api_id (number) , team_api_id (number) , date (number) , buildupplayspeed (text) , buildupplayspeedclass (number) , buildupplaydribbling (number) , buildupplaydribblingclass (text) , buildupplaypassing (text) , buildupplaypassingclass (text) , buildupplaypositioningclass (number) , chancecreationpassing (number) , chancecreationpassingclass (number) , chancecreationcrossing (number) , chancecreationcrossingclass (number) , chancecreationshooting (number) , chancecreationshootingclass (number) , chancecreationpositioningclass (number) , defencepressure (number) , defencepressureclass (number) , defenceaggression (number) , defenceaggressionclass (number) , defenceteamwidth (number) , defenceteamwidthclass (number) , defencedefenderlineclass (number);
|
[Primary Keys]: player_attributes : id, sqlite_sequence : id, player : id, league : id, country : id, team : id
|
[Foreign Keys]: player_attributes : player_api_id = player : player_api_id | player_attributes : player_fifa_api_id = player : player_fifa_api_id | league : country_id = country : id | team_attributes : team_api_id = team : team_api_id | team_attributes : team_fifa_api_id = team : team_fifa_api_id
|
soccer_1
|
SELECT avg(weight) FROM Player
|
What is the average weight of all players?
|
[Schema (values) (types)]: | soccer_1 | Player_Attributes : id (text) , player_fifa_api_id (number) , player_api_id (number) , date (number) , overall_rating (text) , potential (number) , preferred_foot (number) , attacking_work_rate (text) , defensive_work_rate (text) , crossing (text) , finishing (number) , heading_accuracy (number) , short_passing (number) , volleys (number) , dribbling (number) , curve (number) , free_kick_accuracy (number) , long_passing (number) , ball_control (number) , acceleration (number) , sprint_speed (number) , agility (number) , reactions (number) , balance (number) , shot_power (number) , jumping (number) , stamina (number) , strength (number) , long_shots (number) , aggression (number) , interceptions (number) , positioning (number) , vision (number) , penalties (number) , marking (number) , standing_tackle (number) , sliding_tackle (number) , gk_diving (number) , gk_handling (number) , gk_kicking (number) , gk_positioning (number) , gk_reflexes (number) | sqlite_sequence : name (text) , seq (number) | Player : id (text) , player_api_id (number) , player_name (number) , player_fifa_api_id (number) , birthday (text) , height (number) , weight (number) | League : id (text) , country_id (number) , name (number) | Country : id (text) , name (number) | Team : id (text) , team_api_id (number) , team_fifa_api_id (number) , team_long_name (number) , team_short_name (text) | Team_Attributes : id (text) , team_fifa_api_id (number) , team_api_id (number) , date (number) , buildupplayspeed (text) , buildupplayspeedclass (number) , buildupplaydribbling (number) , buildupplaydribblingclass (text) , buildupplaypassing (text) , buildupplaypassingclass (text) , buildupplaypositioningclass (number) , chancecreationpassing (number) , chancecreationpassingclass (number) , chancecreationcrossing (number) , chancecreationcrossingclass (number) , chancecreationshooting (number) , chancecreationshootingclass (number) , chancecreationpositioningclass (number) , defencepressure (number) , defencepressureclass (number) , defenceaggression (number) , defenceaggressionclass (number) , defenceteamwidth (number) , defenceteamwidthclass (number) , defencedefenderlineclass (number);
|
[Primary Keys]: player_attributes : id, sqlite_sequence : id, player : id, league : id, country : id, team : id
|
[Foreign Keys]: player_attributes : player_api_id = player : player_api_id | player_attributes : player_fifa_api_id = player : player_fifa_api_id | league : country_id = country : id | team_attributes : team_api_id = team : team_api_id | team_attributes : team_fifa_api_id = team : team_fifa_api_id
|
soccer_1
|
SELECT max(weight) , min(weight) FROM Player
|
What is the maximum and minimum height of all players?
|
[Schema (values) (types)]: | soccer_1 | Player_Attributes : id (text) , player_fifa_api_id (number) , player_api_id (number) , date (number) , overall_rating (text) , potential (number) , preferred_foot (number) , attacking_work_rate (text) , defensive_work_rate (text) , crossing (text) , finishing (number) , heading_accuracy (number) , short_passing (number) , volleys (number) , dribbling (number) , curve (number) , free_kick_accuracy (number) , long_passing (number) , ball_control (number) , acceleration (number) , sprint_speed (number) , agility (number) , reactions (number) , balance (number) , shot_power (number) , jumping (number) , stamina (number) , strength (number) , long_shots (number) , aggression (number) , interceptions (number) , positioning (number) , vision (number) , penalties (number) , marking (number) , standing_tackle (number) , sliding_tackle (number) , gk_diving (number) , gk_handling (number) , gk_kicking (number) , gk_positioning (number) , gk_reflexes (number) | sqlite_sequence : name (text) , seq (number) | Player : id (text) , player_api_id (number) , player_name (number) , player_fifa_api_id (number) , birthday (text) , height (number) , weight (number) | League : id (text) , country_id (number) , name (number) | Country : id (text) , name (number) | Team : id (text) , team_api_id (number) , team_fifa_api_id (number) , team_long_name (number) , team_short_name (text) | Team_Attributes : id (text) , team_fifa_api_id (number) , team_api_id (number) , date (number) , buildupplayspeed (text) , buildupplayspeedclass (number) , buildupplaydribbling (number) , buildupplaydribblingclass (text) , buildupplaypassing (text) , buildupplaypassingclass (text) , buildupplaypositioningclass (number) , chancecreationpassing (number) , chancecreationpassingclass (number) , chancecreationcrossing (number) , chancecreationcrossingclass (number) , chancecreationshooting (number) , chancecreationshootingclass (number) , chancecreationpositioningclass (number) , defencepressure (number) , defencepressureclass (number) , defenceaggression (number) , defenceaggressionclass (number) , defenceteamwidth (number) , defenceteamwidthclass (number) , defencedefenderlineclass (number);
|
[Primary Keys]: player_attributes : id, sqlite_sequence : id, player : id, league : id, country : id, team : id
|
[Foreign Keys]: player_attributes : player_api_id = player : player_api_id | player_attributes : player_fifa_api_id = player : player_fifa_api_id | league : country_id = country : id | team_attributes : team_api_id = team : team_api_id | team_attributes : team_fifa_api_id = team : team_fifa_api_id
|
soccer_1
|
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 )
|
List all player names who have an overall rating higher than the average.
|
[Schema (values) (types)]: | soccer_1 | Player_Attributes : id (text) , player_fifa_api_id (number) , player_api_id (number) , date (number) , overall_rating (text) , potential (number) , preferred_foot (number) , attacking_work_rate (text) , defensive_work_rate (text) , crossing (text) , finishing (number) , heading_accuracy (number) , short_passing (number) , volleys (number) , dribbling (number) , curve (number) , free_kick_accuracy (number) , long_passing (number) , ball_control (number) , acceleration (number) , sprint_speed (number) , agility (number) , reactions (number) , balance (number) , shot_power (number) , jumping (number) , stamina (number) , strength (number) , long_shots (number) , aggression (number) , interceptions (number) , positioning (number) , vision (number) , penalties (number) , marking (number) , standing_tackle (number) , sliding_tackle (number) , gk_diving (number) , gk_handling (number) , gk_kicking (number) , gk_positioning (number) , gk_reflexes (number) | sqlite_sequence : name (text) , seq (number) | Player : id (text) , player_api_id (number) , player_name (number) , player_fifa_api_id (number) , birthday (text) , height (number) , weight (number) | League : id (text) , country_id (number) , name (number) | Country : id (text) , name (number) | Team : id (text) , team_api_id (number) , team_fifa_api_id (number) , team_long_name (number) , team_short_name (text) | Team_Attributes : id (text) , team_fifa_api_id (number) , team_api_id (number) , date (number) , buildupplayspeed (text) , buildupplayspeedclass (number) , buildupplaydribbling (number) , buildupplaydribblingclass (text) , buildupplaypassing (text) , buildupplaypassingclass (text) , buildupplaypositioningclass (number) , chancecreationpassing (number) , chancecreationpassingclass (number) , chancecreationcrossing (number) , chancecreationcrossingclass (number) , chancecreationshooting (number) , chancecreationshootingclass (number) , chancecreationpositioningclass (number) , defencepressure (number) , defencepressureclass (number) , defenceaggression (number) , defenceaggressionclass (number) , defenceteamwidth (number) , defenceteamwidthclass (number) , defencedefenderlineclass (number);
|
[Primary Keys]: player_attributes : id, sqlite_sequence : id, player : id, league : id, country : id, team : id
|
[Foreign Keys]: player_attributes : player_api_id = player : player_api_id | player_attributes : player_fifa_api_id = player : player_fifa_api_id | league : country_id = country : id | team_attributes : team_api_id = team : team_api_id | team_attributes : team_fifa_api_id = team : team_fifa_api_id
|
soccer_1
|
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)
|
What are the names of players who have the best dribbling?
|
[Schema (values) (types)]: | soccer_1 | Player_Attributes : id (text) , player_fifa_api_id (number) , player_api_id (number) , date (number) , overall_rating (text) , potential (number) , preferred_foot (number) , attacking_work_rate (text) , defensive_work_rate (text) , crossing (text) , finishing (number) , heading_accuracy (number) , short_passing (number) , volleys (number) , dribbling (number) , curve (number) , free_kick_accuracy (number) , long_passing (number) , ball_control (number) , acceleration (number) , sprint_speed (number) , agility (number) , reactions (number) , balance (number) , shot_power (number) , jumping (number) , stamina (number) , strength (number) , long_shots (number) , aggression (number) , interceptions (number) , positioning (number) , vision (number) , penalties (number) , marking (number) , standing_tackle (number) , sliding_tackle (number) , gk_diving (number) , gk_handling (number) , gk_kicking (number) , gk_positioning (number) , gk_reflexes (number) | sqlite_sequence : name (text) , seq (number) | Player : id (text) , player_api_id (number) , player_name (number) , player_fifa_api_id (number) , birthday (text) , height (number) , weight (number) | League : id (text) , country_id (number) , name (number) | Country : id (text) , name (number) | Team : id (text) , team_api_id (number) , team_fifa_api_id (number) , team_long_name (number) , team_short_name (text) | Team_Attributes : id (text) , team_fifa_api_id (number) , team_api_id (number) , date (number) , buildupplayspeed (text) , buildupplayspeedclass (number) , buildupplaydribbling (number) , buildupplaydribblingclass (text) , buildupplaypassing (text) , buildupplaypassingclass (text) , buildupplaypositioningclass (number) , chancecreationpassing (number) , chancecreationpassingclass (number) , chancecreationcrossing (number) , chancecreationcrossingclass (number) , chancecreationshooting (number) , chancecreationshootingclass (number) , chancecreationpositioningclass (number) , defencepressure (number) , defencepressureclass (number) , defenceaggression (number) , defenceaggressionclass (number) , defenceteamwidth (number) , defenceteamwidthclass (number) , defencedefenderlineclass (number);
|
[Primary Keys]: player_attributes : id, sqlite_sequence : id, player : id, league : id, country : id, team : id
|
[Foreign Keys]: player_attributes : player_api_id = player : player_api_id | player_attributes : player_fifa_api_id = player : player_fifa_api_id | league : country_id = country : id | team_attributes : team_api_id = team : team_api_id | team_attributes : team_fifa_api_id = team : team_fifa_api_id
|
soccer_1
|
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 players who have a crossing score higher than 90 and prefer their right foot.
|
[Schema (values) (types)]: | soccer_1 | Player_Attributes : id (text) , player_fifa_api_id (number) , player_api_id (number) , date (number) , overall_rating (text) , potential (number) , preferred_foot (number) , attacking_work_rate (text) , defensive_work_rate (text) , crossing (text) , finishing (number) , heading_accuracy (number) , short_passing (number) , volleys (number) , dribbling (number) , curve (number) , free_kick_accuracy (number) , long_passing (number) , ball_control (number) , acceleration (number) , sprint_speed (number) , agility (number) , reactions (number) , balance (number) , shot_power (number) , jumping (number) , stamina (number) , strength (number) , long_shots (number) , aggression (number) , interceptions (number) , positioning (number) , vision (number) , penalties (number) , marking (number) , standing_tackle (number) , sliding_tackle (number) , gk_diving (number) , gk_handling (number) , gk_kicking (number) , gk_positioning (number) , gk_reflexes (number) | sqlite_sequence : name (text) , seq (number) | Player : id (text) , player_api_id (number) , player_name (number) , player_fifa_api_id (number) , birthday (text) , height (number) , weight (number) | League : id (text) , country_id (number) , name (number) | Country : id (text) , name (number) | Team : id (text) , team_api_id (number) , team_fifa_api_id (number) , team_long_name (number) , team_short_name (text) | Team_Attributes : id (text) , team_fifa_api_id (number) , team_api_id (number) , date (number) , buildupplayspeed (text) , buildupplayspeedclass (number) , buildupplaydribbling (number) , buildupplaydribblingclass (text) , buildupplaypassing (text) , buildupplaypassingclass (text) , buildupplaypositioningclass (number) , chancecreationpassing (number) , chancecreationpassingclass (number) , chancecreationcrossing (number) , chancecreationcrossingclass (number) , chancecreationshooting (number) , chancecreationshootingclass (number) , chancecreationpositioningclass (number) , defencepressure (number) , defencepressureclass (number) , defenceaggression (number) , defenceaggressionclass (number) , defenceteamwidth (number) , defenceteamwidthclass (number) , defencedefenderlineclass (number);
|
[Primary Keys]: player_attributes : id, sqlite_sequence : id, player : id, league : id, country : id, team : id
|
[Foreign Keys]: player_attributes : player_api_id = player : player_api_id | player_attributes : player_fifa_api_id = player : player_fifa_api_id | league : country_id = country : id | team_attributes : team_api_id = team : team_api_id | team_attributes : team_fifa_api_id = team : team_fifa_api_id
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.