database schema question
I need some suggestions in the database design schema I've created below... I am not sure that it's correct.. in terms of relationship. Especially the USER - USER_RESERVATION - RESERVA开发者_开发技巧TION. What I am trying to say is that a USER can have many RESERVATION, but then the same RESERVATION can belong to many different USERS... am I representing it correctly?
If a user can have many reservations and each reservation can be for many users, you are correct to have a USER_RESERVATION table to do the many-to-many mapping.
Off the top of my head, though, it seems odd that a reservation would belong to multiple users. I would tend to think that each user would have a separate reservation in the system and that there would be some concept of linked reservations. So if a family of four wants to take a flight, Mom, Dad, and each kid would have a separate reservation with a separate ticket but all four reservations would be linked together in the system for certain operations like checking in. Separate reservations, though, would tend to simplify rebooking tasks if, say, Mom needed to move her flight back a day or if the family needed to be rebooked on two separate flights because their flight was cancelled.
精彩评论