Reputation: 1
I am facing a problem with updating tables. I have two tables:
Visit
: visitId, roomId(FK)Room
: roomId, priceHow can I update room price for specific roomId
, but keep old value of price in Visit
?
For example somebody booked room in hotel for 50$, but after he did it, the price changes to 60$. So I want to keep old price(50$) just for this client and for new ones use the new value (60$).
Thanks for responses
Upvotes: 0
Views: 49
Reputation: 1269573
You have a slowly changing dimension. Probably the best approach is to keep the price in the visit
table as well. You can call this the reservationPrice
or something similar, to distinguish from the current price for the room.
Upvotes: 2