GATE CSE
First time here? Checkout the FAQ!
x
+2 votes
96 views

asked in Databases by Junior (977 points)   | 96 views

1 Answer

+3 votes

First of all we have to check the ER diagram carefully.In this we have :

A) Strong entity employee with eid as the key

B) Weak entity dependent with dob as the partial key

C) A multivalued attribute phoneno..

So we need to have 3 relations :

a) For employee with eid as key

b) For {dependent , has} with {eid,dob} as key with eid being identifier

c) For multivalued attribute phoneno..

 

So no of attributes which are non prime in employee = 2 [which are dob,ename]

    no of attributes which are non prime in {dependent , has} = 1 [which is dname only]

 

Hence C) is the correct answer..

answered by Veteran (59.6k points)  

I'm not getting why multi-values atrr.(phoneno.) needs special attention! 

Table-1(Employee){e_id,e_name,dob,phone_no}

Table-2(Has){e_id,dob}

Table-3(Dependant){d_name,e.id,dob}

Let me know where am I lacking?

This is the heuristic followed for multivalued attribute..U have to form a separate table for it..
So finally I'm having how many tables ?
can your write those?
ok let's assume that we have the third table for the phone number but why does the primary key of the phone number table has to be part of the primary key of the employee table.

and more than 1 employee can have the same phone number.

I think it should not be part of primary key.
that's what i'm trying to tell!

Ok, i got it! follow this, they explained everything about it! thanks Habib!

https://www.tutorialcup.com/dbms/er-model-into-tables.htm

 

Now the composite key that has been created is a primary key for stud_hobby table while hobby attribute get a miss from the student table.

Now relating to our question since phone no has been moved out from employee table. thus leaving us with 2 non-prime attributes. Am i correct?

and the phone no along with employee id would be primary key for phone table

Top Users Jan 2017
  1. Debashish Deka

    7172 Points

  2. Habibkhan

    4696 Points

  3. Vijay Thakur

    4308 Points

  4. sudsho

    4090 Points

  5. saurabh rai

    4024 Points

  6. Arjun

    3292 Points

  7. santhoshdevulapally

    3066 Points

  8. GateSet

    3016 Points

  9. Bikram

    3014 Points

  10. Sushant Gokhale

    2892 Points

Monthly Topper: Rs. 500 gift card

18,838 questions
23,808 answers
51,589 comments
20,148 users