Note that there are some explanatory texts on larger screens.

plurals
  1. PODatabase Design for Multiple Room Reservation: One To Many
    text
    copied!<p>Primary Entities: Client Guest Reservation RoomAssignment</p> <p>I want to implement a multiple room reservation database design. First, I want to explain first the concept:</p> <ol> <li>The <strong>Client</strong> is the one who acquires a reservation.</li> <li>The <strong>Client</strong> can only have 1 reservation at a time</li> <li>The <strong>Client</strong> can reserve multiple rooms.</li> <li><p>The <strong>Guest</strong> is the one who is assigned into a specific room.</p> <p>So for the Table:</p> <p><code>Client (client_id(PK), Name)<br> Guest (guest_id(PK), Name)</code></p> <pre><code>Reservation (reservation_id(PK), client_id(FK), roomAss_id(FK), checkInDate); RoomAssignment (roomAss_id(PK), guest_id(FK), roomno(FK)); Room(room_id(PK), roomDetails); </code></pre></li> </ol> <p>//The problem here is that I don't know how to implement a 1 to many relationship. My Reservation should handle mutliple RoomAssignment? Or my RoomAssignment will handle multiple guest_id and roomno and then I will pass 1 roomass_id into my reservation table?</p> <p>Thanks I am really confused about this 1 to many relationship. I hope somebody is so kind to help instead of giving me negative points. T_T</p> <p>Another Attempt:</p> <pre><code>Room(room_id(PK), roomDetails); Client (client_id(PK), Name) Guest (guest_id(PK), Name) Reservation (reservation_id(PK), client_id(FK), checkInDate); Booking(book_id(PK), reservation_id(FK), room_id(FK)); Lodging(lodge_id(PK), guest_id(FK), book_id(FK)) </code></pre> <p>(Client, Room, Guest are already filled), add Reservation, add Booking, add Lodging</p> <p>Is This Correct??</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload