The Gateway to Computer Science Excellence
+27 votes

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
in Databases by Boss
retagged by | 2.6k views

Lodging is the only attribute relating person and hotel room.

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

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

 many to many relationship we need ak separate  table for key  

so this  information should appear as an attribute of Lodging 

c option 

3 Answers

+42 votes
Best answer
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 Loyal
edited by
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

@Sankaranarayanan P.N 

what if the relationship is 1 to many?



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....???

Yes correct!

Rent attribute can be added

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)
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.
+20 votes
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
0 votes
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.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
52,215 questions
60,005 answers
94,684 users