2k views

Consider the entities 'hotel room', and 'person' with a many to many relationship 'lodging' as shown below:

If we wish to store information about the rent payment to be made by person (s) occupying different hotel rooms, then this information should appear as an attribute of

1. Person
2. Hotel Room
3. Lodging
4. None of these

retagged | 2k views
0

Lodging is the only attribute relating person and hotel room.

+1
Notice line --> "rent payment to be made by person"

So it is not a Room Rent or payment done by person.

Since it is many to many, rent cannot be an attribute of room or person entities alone. If depending on number of persons sharing a room the rent for each person for the room will be different. Otherwise rent can be attribute of room. hence i go for attribute of Lodging.

Correct Answer: $C$
by Boss (11k points)
edited
+4
yes c bcoz of many to many relationship b/w 'hotel room', and 'person' no one can alone decide the rent. here  key should be combination of both side keys
+1

what if the relationship is 1 to many?

+4

relation 1 to many says that ....a single hotel_rooms is allocated for many persons but a single person  has only one rooms allocated...there for attribute rent can be the part of Person entity....???

+10
Yes correct!

If m:m to lodging

If 1:m to  person

If m:1 to hotel room

If 1:1 to any one (person or hotel room)
0
rent payment is made only when a person is going to book a hotel,he/she doesn't pay the rent while living in their own home, likewise a vacant room is not appliacble for rent payment.

So, rent payment occurs only when the relationship occurs.i.e rent payment should be an attribute of Lodging.
Rent must be part of Loging only becuase of the following reasons

1. Person will contain the persoanl detail of customer only

2. Room will contain information related to type of room (e.g. delux, semidelux etc.) and the charges of those rooms

3. But loging will contain the information who is staying room, in which room and how many days he would stay based on this amount to be paid decided so it must be part of it only.
by Active (1.3k points)
In a relation descriptive attribute can be assigned to relationship set or key constraint if any.

As given relation is many to many descriptive attribute can only be assigned to relationship set i.e lodging.
by (165 points)

1
2