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

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -