Question :

What is 5nf in DBMS.

Subject

Database Management System

Standard

Computer Science Engineering

Views

576

Asked By

Qayanat

Knowledge
Answer / Solution

The Fifth Normal Form (5NF), also known as Project-Join Normal Form (PJNF), is a level of database normalization that goes beyond the Third Normal Form (3NF) and the Boyce-Codd Normal Form (BCNF). It addresses the problem of join dependencies in a relational database schema.

To understand 5NF, let's first discuss the concept of a join dependency. A join dependency arises when a relation can be decomposed into two or more smaller relations, and the original relation can be obtained by joining these smaller relations based on certain attributes.

5NF aims to eliminate join dependencies by decomposing a relation into smaller, non-redundant relations, such that every join dependency is represented explicitly. It ensures that a database schema is free from any redundancy or anomalies caused by join operations.

The conditions for a relation to be in 5NF are as follows:

  1. The relation must be in Fourth Normal Form (4NF).
  2. The relation must not have any nontrivial join dependencies.

A nontrivial join dependency occurs when a relation can be expressed as a join of two or more smaller relations, and this join is not implied by any of the candidate keys or superkeys of the original relation.

To achieve 5NF, the relation is decomposed into smaller relations based on the nontrivial join dependencies. Each smaller relation will represent a subset of the attributes and tuples from the original relation, ensuring that no redundancy exists.

It's important to note that achieving 5NF may lead to an increase in the number of relations in the database schema, as the decomposition process creates new relations to represent the join dependencies explicitly. This can have implications on query performance and maintainability, so careful consideration is required when deciding to decompose a relation into 5NF.

Overall, the Fifth Normal Form (5NF) addresses the elimination of join dependencies in a relational database schema, ensuring that the schema is free from redundancy and anomalies caused by join operations. It represents the highest level of normalization and is typically used in complex database designs where preserving data integrity and minimizing anomalies is crucial.

Kirti
Answer / Solution

Fifth Normal Form (5NF), also known as Project-Join Normal Form (PJNF), is a level of normalization in database design that goes beyond the Boyce-Codd Normal Form (BCNF). It aims to eliminate redundancy and anomalies caused by multi-valued dependencies and join dependencies. 5NF is considered the highest level of normalization and ensures the absence of all kinds of redundancy in a database schema.

To understand 5NF, let's first discuss the concept of multi-valued dependencies (MVDs) and join dependencies.

Multi-valued dependencies occur when a relation has attributes that depend on only part of a candidate key rather than the entire key. In other words, if changing the value of one attribute within a multi-valued dependency can result in multiple possible values for another attribute, then a multi-valued dependency exists.

Join dependencies occur when a relation can be decomposed into multiple smaller relations, and the original relation can be reconstructed by joining these smaller relations together.

Now, let's define 5NF. A relation is said to be in 5NF if and only if every join dependency in the relation is implied by the candidate keys of the relation.

Here's an example to illustrate 5NF:

Consider a database schema with three relations: "Teachers," "Subjects," and "Assignments.". Teachers (TeacherID, TeacherName, SubjectIDs) Subjects (SubjectID, SubjectName) Assignments (AssignmentID, TeacherID, SubjectID, AssignmentName)

In this example, the TeacherID attribute is the primary key in the Teachers relation, and the SubjectID attribute is the primary key in the Subjects relation.

Now, let's examine the multi-valued dependencies and join dependencies in this schema:

Multi-valued Dependencies:

  • Teachers relation: TeacherID ->> SubjectIDs (A teacher can be associated with multiple subjects.)

Join Dependencies:

  • Teachers relation + Subjects relation = Assignments relation (The Assignments relation can be reconstructed by joining the Teachers and Subjects relations using their common attributes.)

To achieve 5NF, we need to decompose the schema into smaller relations, eliminating the multi-valued dependencies and join dependencies.

Decomposed Relations: Teachers (TeacherID, TeacherName) TeacherSubjects (TeacherID, SubjectID) Subjects (SubjectID, SubjectName) Assignments (AssignmentID, TeacherID, SubjectID, AssignmentName)

By decomposing the schema, we have eliminated the multi-valued dependencies and ensured that every join dependency is implied by the candidate keys of the relations. Each relation now represents a separate entity with its own attributes, reducing redundancy and improving data integrity.

In summary, 5NF eliminates redundancy and anomalies caused by multi-valued dependencies and join dependencies. It ensures that all join dependencies are implied by the candidate keys, resulting in a highly normalized and well-structured database design.

Aarohi
Answer / Solution

Lets take the example of 5NF. 

SUBJECT LECTURER SEMESTER
Computer Anshika Semester 1
Computer  John     Semester 1
Math John Semester 1
Math Akash Semester 2
Chemistry  Praveen Semester 1

In the above table, John takes both Computer and Math class for Semester 1 but he 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 Relation1, Relation2 & Relation3:

Relation1

SEMESTER SUBJECT
Semester 1 Computer
Semester 1 Math
Semester 2 Math
Semester 1 Chemistry 

Relation2

SUBJECT LECTURER
Computer Anshika
Computer John
Math John
Math Praveen

Relation3

SEMESTER LECTURER
Semester 1 Anshika
Semester 1 John
Semester 2 John
Semester 1 Praveen


 


Top Trending Questions


Recent Question Update

Explain Domain Key Normal Form DKNF with example.
Explain Project Join Normal Form PJNF with example.
Explain 4nf and 5nf with example.
What do you mean by 4NF in DBMS. Explain with example.
What is BCNF Boyce Codd Normal Form. Explain it.
What is normalization? Explain 3NF with example.
What is 2NF? How is it achieved.
What is 1NF? How do we achieve it.
What are the different normal forms in DBMS?
Brief Introduction to the Normalization.
Explain multivalued dependencies
What do you mean by lossless join? How can we test it.
What is the meaning of decomposition in DBMS? List its properties.
Explain the closure of attribute sets.
What do you mean by closure of a set of functional dependencies.
Explain the inference rules for functional dependencies in DBMS
What is the Difference between BCNF and 4NF in DBMS.
SQL Full Outer Join Using Left and Right Outer Join and Union Clause
Difference between Natural join and Inner Join in SQL
Define aggregate function in database.
Write the operations which are responsible for database modification.
Explain natural join operation.
Differentiate union, intersection and set difference operations.
Explain fundamental operations of relational algebra with example.
What do you mean by database scheme. Explain with example.
What do you mean by relational algebra?
Explain Aggregation
What do you mean by Generalization and Specialization in DBMS?
Explain superclass and subclass entity types
Describe EER Model?
What is ER Entity relationship Diagram.
Explain the concept of weak entity and strong entity.
What are the entities and attributes? Explain them.
What are keys? Discuss its types.
Define relationship sets.
What do you mean by attributes? Explain its types.
What are the limitations of a database system.
Explain database administrator and its functions
Explain different database system users
What is database abstraction. Explain its levels.
Write advantages and disadvantages of Hierarchical Data Model
Write advantages and disadvantages of Network Data Model
Write advantages and disadvantages of Relational Data Model
What are data models? Explain its types.
Write different applications of a database
What are the advantages and disadvantages of a database system
Explain Database. Explain different types of elements.

Advantages Of NCERT, CBSE & State Boards Solutions For All Subjects

  • All the NCERT Solutions have been prepared by academic experts having 10+ years of teaching experience.
  • They have prepared all the solutions in simple and easy language so that each and every student can understand the concepts easily.
  • All the solutions have been explained step to step-wise in details with better explanations.
  • Students can also use these question and answers for your assignments and in homework help.
  • All the solutions have been explained in detail and the answers have been compiled in a step-wise manner.
  • All the questions and answers are commonly prepared according to the Latest Syllabus of Board Education and Guidelines.
  • Students can know about the various types of questions asked in the exams with the help of these solutions.

Top Course Categories