in Databases
409 views
0 votes
0 votes

in Databases
by
409 views

3 Comments

<p>Actually in this question I m not getting why in first one only one table is required nd in third one why two for 1nf....and what if both end had 1:1 mapping??</p>
0
0
no first one require two table and third one require 1 table only..
0
0
Can u explain and please provide its concept nd rules if u have..
0
0

1 Answer

0 votes
0 votes
Best answer
in first case you can join E1R(A,C,B) key will be AC

but you cant join on E2 side as it has partial participation so some attributes of E2 must not be related to anything on E1 side so for those attrbute value of E2,E1 value will ne null so our key constraint will be violated i.e primary key values can't be null.

But in case 3 as both side total participation you can join all into single table no key constraints would be violated.

take example and check.!

I will show you how to solve these type of qsn no rules whatso ever required just use your concepts wisely

loook in first case

E1(A,B)                    R(A,C)[AC is primary key]                       E2(C,D)

a1                               a1 c1                                                   c1

a2                               a1 c2                                                   c2

a3                               a2 c3                                                   c3

                                   a3  c2                                                   c4

(total participation)                                                           (partial participation)

you can join R on E1 side only so as to have primary key in table and its constraints to be preserved you cant join it further with E2 becz there will c4 tuple for which A value would be null i.e   NULL  c4(this will occur when you join E2 too) but due to this our primary key constraint gets violated i.e PK value cant be null....so its not possible to store this table in DBMS.  So you need 2 tables for this case E1R and E2.

 

In second case similarly you try by taking exmple as i took you will get it for sure..in second case you will see E1E2R can be joined in single table and keeping all constaints preserved i.e total particpation of both entity set,M:N relationship between two entity sets and even primary key constarint also remains preserved.!
selected by

3 Comments

and for 2nd
0
0
and suppose for 1st one we have 1:1 cardinality but E1 has total participation but E2 has partial participation....then in this case we need to join R towards partial participation????? ND still two tables are needed??
0
0
edited by
yes you are correct you need to join R on partial participation side...dont stop here try to join E1 also and see 3 things which i mentioned are not violated na when you join E1 also.

 look if for first one you have 1:1 cardinality than do similarly keep 3 things in mind in final table...

you should have Primary key,1:1 cardinality preserved,total and partial participation on whichever side should be preserved in final table.

you can join all into single table
1
1