The second normal form (2nf), Database Management System

Assignment Help:

The Second Normal Form (2NF)

Definition: A relation is in 2NF if it is in 1NF and each non-key attribute is fully dependent on each candidate key of the relation.

Some of the points that should be noted here are:

  • A relation having a one attribute key has to be in 2NF.
  • In the case of composite key, partial dependency on key that is part of the key is not allowed.
  • 2NF tries to make sure that information in one relation is about one thing
  • Non-key attributes are those that are not part of any candidate key.

Let us now reconsider, which describes the FDs of the relation to the relation STUDENT (Enrolmentno, Sname, Address, Cno, Cname, Instructor, Office). These FDs can also be written as:

Enrolmentno     →         Sname,           Address     (1)

Cno                 →           Cname,           Instructor  (2)

Instructor        →                                   Office        (3)

 

The key attributes of the relation are (Cno + Enrolmentno). Rest of the attributes are non-key attributes. For the 2NF decomposition, we are concerned with the FDs (1) and (2) as above as they relate to partial dependence on the key that is (Cno +Enrolmentno). As these dependencies illustrates that relation in not in 2NF and therefore suffer from all the three anomalies and redundancy troubles as many non-key attributes can be derived from partial key attribute. To change the relation into 2NF, let us use FDs. As per FD (1) the Enrolment number uniquely verify student name and address, so one relation should be:

STUDENT1 (Enrolmentno, Address, Sname)

Now as per FD (2) we can decompose the relation more, but what about the attribute 'Office'?

We find in FD (2) that Course code (Cno) attribute uniquely shows the name of instructor (refer to FD 2(a)). Also the FD (3) means that name of the instructor uniquely shows office number. This can be written as:

Cno        →             Instructor                  (2 (a)) (without Cname)

Instructor          →                                    Office            (3)

⇒      Cno      →                                      Office  (This is transitive dependency)

 

Therefore, FD (2) now can be rewritten as:

Cno                  →         Cname, Instructor, Office           (2')

This FD, now provides us the second decomposed relation:

COU_INST (Cno, Cname, Instruction, Office)

Therefore, the relation STUDENT has been decomposed into two relations:

STUDENT1 (Enrolmentno, Sname, Address) COU_INST (Cno, Cname, Instruction, Office)

Is the decomposition into 2NF finish now?

No, how would you join the two relations formed above any way? Please note we have super FDs as, because (Cno +Enrolmentno) is the primary key of the relation STUDENT:

Enrolmentno, Cno       →        ALL ATTRIBUTES

Every attributes except for the key attributes that are Cno and Enrolmentno, Though, are covered on the right side of the FDs (1) (2) and (3), therefore, making the FD as redundant. But in any situation we have to have a relation that connects the two decomposed relations. This relation would cover any attributes of Super FD that have not been covered by the key attributes and the decomposition. Therefore, we need to make a joining relation as:

COURSE_STUDENT (Enrolmentno, Cno)

 So, the relation STUDENT in 2NF form would be:

STUDENT1 (Enrolmentno, Sname, Address)                   2NF(a)

 COU_INST (Cno, Cname, Instruction, Office)                 2NF(b)

 COURSE_STUDENT (Enrolmentno, Cno)                         2NF(c)


Related Discussions:- The second normal form (2nf)

Illustrate the cardinality of relationship, Cardinality of Relationship ...

Cardinality of Relationship One-to-One Only one entity of the first set is linked to only one entity of the second set. E.g. A teacher teaches a student. Only one teacher

Derived horizontal fragmentation, Derived horizontal fragmentation: Some ap...

Derived horizontal fragmentation: Some applications may include a join of two or more relations. If the relations are stored at dissimilar locations, there may be a major overhead

Benefits and drawbacks of heap files, Benefits of heap files 1.   This i...

Benefits of heap files 1.   This is a easy file Organisation method. 2.   Insertion is somehow capable. 3.   Good for bulk-loading data into a table. 4.   Best if file

What are advantages of object-oriented programming paradigm, What is the ma...

What is the major advantage of object-oriented programming paradigm? The ability to modify the explanation of an object without affecting the rest of the system is the main adv

What are the dbms languages, What are the DBMS languages? Briefly explain?...

What are the DBMS languages? Briefly explain? Data Definition language (DDL):A database schema is specified through a set of definitions expressed through a special language

Each statement should have a where clause, Submit SQL SELECT Statements to ...

Submit SQL SELECT Statements to demonstrate several reports off your database, according to the following guidelines: You must submit at least 5 SELECT Statements. Each

What is index, What is Index? An index is a physical structure having p...

What is Index? An index is a physical structure having pointers to the data. Indices are created in an existing table to locate rows more quickly and efficiently. It is possibl

Single-valued dependencies, Single-Valued Dependencies A database is a ...

Single-Valued Dependencies A database is a collection of related information and it is therefore inevitable that some items of information in the database would depend on some

Equi-join, explain equi-join using illustration

explain equi-join using illustration

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd