Question :

What are the different normal forms in DBMS? Explain with example.

Subject

Database Management System

Standard

Computer Science Engineering

Views

566

Asked By

Dashboard

Victoria
Answer / Solution

In database management systems (DBMS), the concept of normal forms is used to ensure data integrity and minimize data redundancy in a relational database. There are several normal forms, each representing a specific level of normalization.

The commonly known normal forms are:

First Normal Form (1NF):

  • Ensures that each column in a table contains atomic values (indivisible values).
  • Eliminates repeating groups and ensures each attribute has a single value.

Example: Consider a table called "Students" with the following columns: StudentID, Name, Subjects.

The table violates 1NF because the "Subjects" column contains multiple values for each student. To normalize it, you would split it into two tables: "Students" (with columns: StudentID, Name) and "Subjects" (with columns: StudentID, Subject).

Second Normal Form (2NF):

  • Builds on 1NF and ensures that each non-key attribute is fully dependent on the entire primary key.
  • Eliminates partial dependencies.

Example: Suppose we have a table called "Orders" with columns: OrderID, ProductID, ProductName, Quantity, and Price.

The table violates 2NF if ProductName and Price depend on ProductID but not on OrderID. To normalize it, you would create two tables: "Orders" (with columns: OrderID, ProductID, Quantity) and "Products" (with columns: ProductID, ProductName, Price).

Third Normal Form (3NF):

  • Builds on 2NF and ensures that no non-key attribute is transitively dependent on the primary key.
  • Eliminates transitive dependencies.

Example: Consider a table called "Employees" with columns: EmployeeID, DepartmentID, DepartmentName, Manager.

The table violates 3NF if DepartmentName depends on DepartmentID and Manager depends on DepartmentName. To normalize it, you would create three tables: "Employees" (with columns: EmployeeID, DepartmentID), "Departments" (with columns: DepartmentID, DepartmentName), and "Managers" (with columns: DepartmentName, Manager).

These are the first three normal forms, but there are higher normal forms as well, such as Boyce-Codd Normal Form (BCNF), Fourth Normal Form (4NF), and Fifth Normal Form (5NF). Each subsequent normal form addresses more complex normalization issues, but the first three forms are the most commonly used and understood.

It's important to note that normalization should be applied based on the specific requirements and characteristics of the data model, and sometimes denormalization is intentionally done for performance optimization.

Qayanat
Answer / Solution

In database management systems (DBMS), the concept of normal forms is used to define the level of organization and optimization of a relational database schema. There are several normal forms, each building upon the previous one, with the ultimate goal of minimizing data redundancy and improving data integrity. Let's discuss the most commonly known normal forms:

First Normal Form (1NF):

  • The first normal form requires that each attribute in a table must be atomic, meaning it should hold only a single value.

Example: Consider a table called "Employees" with the following attributes: Employee_ID, Name, and Skills. To satisfy 1NF, we need to ensure that each attribute contains atomic values. If the Skills attribute is a multivalued attribute, we can separate it into a separate table "Employee_Skills" with columns Employee_ID and Skill.

Second Normal Form (2NF):

  • The second normal form requires the fulfillment of 1NF and that each non-key attribute is fully functionally dependent on the entire primary key.

Example: Let's say we have a table called "Orders" with attributes: Order_ID, Product_ID, Product_Name, and Product_Price. To satisfy 2NF, we can break this table into two separate tables: "Orders" (Order_ID and Product_ID) and "Products" (Product_ID, Product_Name, and Product_Price). The Product_Name and Product_Price are fully functionally dependent on the Product_ID, which is the primary key of the "Products" table.

Third Normal Form (3NF):

  • The third normal form requires the fulfillment of 2NF and that there should be no transitive dependencies, where an attribute depends on another non-key attribute.

Example: Suppose we have a table called "Students" with attributes: Student_ID, Course_ID, Course_Name, and Instructor. Here, Course_Name and Instructor are functionally dependent on the Course_ID, not directly on the Student_ID. To satisfy 3NF, we can split this table into three separate tables: "Students" (Student_ID), "Courses" (Course_ID and Course_Name), and "Instructors" (Course_ID and Instructor). This eliminates the transitive dependency between the Student_ID and the attributes related to the Course.

These are the first three normal forms (1NF, 2NF, and 3NF) commonly used in database normalization.

There are higher normal forms like Boyce-Codd Normal Form (BCNF) and Fourth Normal Form (4NF), which deal with more complex situations and dependencies. The goal of normalization is to minimize redundancy, ensure data consistency, and improve the overall efficiency of a database schema.


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 is 5nf in DBMS.
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.
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