List Reservations at all locations in the state of 'CA' - NEED SQL guidance -


select *  reservation,hotel  reservation.guestid = hotel.hstate    , hstate = 'ca'; 

i keep on trying sql command , don't anything. think there might wrong foreign keys , that. little please.

these tables

brand guest hotel htmldb_plan_table reservation room roomtype 

i'm guessing here (from experience, , fact seems homework assignment db 101 course), think guest , hotel tables related via reservation table, , if correct, query you're looking this:

select * reservation inner join guest on reservation.guestid = guest.id inner join hotel on reservation.hotelid = hotel.id hotel.hstate = 'ca' 

adjust column names match actual design (which didn't inform about).


Comments

Popular posts from this blog

rest - Spring boot: Request method 'PUT' not supported -

php - Magento - Deleted Base url key -

symfony - imagine_filter() not generating the correct url in LiipImagineBundle -