The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+21 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
asked in Databases by Boss (19.1k points)
retagged by | 1.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.

2 Answers

+34 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.
answered by Boss (11.6k points)
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)
+11 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.
answered by Active (1.2k points)

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

44,019 questions
49,544 answers
65,769 users