GATE CSE
First time here? Checkout the FAQ!
x
+5 votes
177 views

asked in Databases by Loyal (3.4k points)   | 177 views

1 Answer

+6 votes
Best answer

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 (78.8k points)  
selected by

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 Sep 2017
  1. Habibkhan

    8796 Points

  2. rishu_darkshadow

    3588 Points

  3. Warrior

    2914 Points

  4. Arjun

    2840 Points

  5. A_i_$_h

    2550 Points

  6. manu00x

    2268 Points

  7. nikunj

    1990 Points

  8. Bikram

    1874 Points

  9. makhdoom ghaya

    1820 Points

  10. SiddharthMahapatra

    1718 Points


26,346 questions
33,929 answers
80,525 comments
31,231 users