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

3 Answers

+38 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$
answered by Boss (11.1k points)
edited by
+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

@Sankaranarayanan P.N 

what if the relationship is 1 to many?

+4

@iarnav

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

+8
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)
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.
+15 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)
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.
answered by (165 points)
Answer:

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
49,811 questions
54,533 answers
188,411 comments
75,547 users