UNIT II DATABASE DESIGN

2.10JOIN DEPENDENCIES AND FIFTH NORMAL FORM

Join Dependency

  A relation is said to have join dependency if it can be recreated by joining multiple sub relations and each of these sub relations has a subset of the attributes of the original relation.

Condition for join dependency:

               If the join of R1 and R2 over Q is equal to relation R then we can say that a join dependency exists, where R1 and R2 are the decomposition R1 (P, Q) and R2 (Q, S) of a given relation R (P, Q, S). R1 and R2 are a lossless decomposition of R.

Example: Consider the relation R below having the schema R(supplier, product, consumer).

The primary key is a combination of all three attributes of the relation.


Table 2, Table 3 and Table 4 when joined yield the original table (Table 1). Hence join dependency exists in Table 1, therefore Table 1 is not in 5NF or PJNF. 

 

FIFTH NORMAL FORM (5NF)

o   A relation is in 5NF if it is in 4NF and not contains any join dependency and joining should be lossless.

o   5NF is satisfied when all the tables are broken into as many tables as possible in order to avoid redundancy.

o   5NF is also known as Project-join normal form (PJ/NF).

Example

SUBJECT

LECTURER

SEMESTER

 

 

Computer

Anshika

Semester 1

doesn't take Math class for Semester 2. In this case, combination of all these fields required to identify a valid data.

 Suppose we add a new Semester as Semester 3 but do not know about the subject and who will be taking that subject so we leave Lecturer and Subject as NULL. But all three columns together acts as a primary key, so we can't leave other two columns blank.

               So to make the above table into 5NF, we can decompose it into three relations P1, P2 & P3:

 

 

SEMSTER          LECTURER

 

Semester 1

Anshika

Semester 1

John

Semester 1

John

Semester 2

Akash

Semester 1

Praveen

 

Comments

Popular posts from this blog

CS3492 Database Management Systems Syllabus

UNIT I RELATIONAL DATABASES

UNIT I WEBSITE BASICS, HTML 5, CSS 3, WEB 2.0