









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










A functional dependency is a constraint between two attributes (or sets of attributes) in a relation. An attribute Y is functionally dependent on attribute X if each value of X uniquely determines exactly one value of Y.
Rule for checking an FD
For any two tuples t1, t2 in a relation, if t1.X = t2.X, then t1.Y must equal t2.Y. If every value of the determinant is unique, the dependency automatically holds.
Example — Student table
Since Stud_ID uniquely identifies a student, it determines the name.
Example — Employee table (StudentID, Name, Department, DeptHead)
people can share a name)
Example: For Student(Stud_ID, Stud_Name):
Example (Employee table):
Completely Non-Trivial FD
If X → Y holds and the intersection of X and Y is empty (null), it is called a completely non-trivial functional dependency.
Example (Bike table with Model, Manuf_year, Color):
Manuf_year and Color are independent of each other but both depend on Model.
If Y is a subset of X, then X → Y.
Example: For Student(Roll_No, Name, Branch):
If X → Y holds, and Z is any attribute set, then XZ → YZ also holds (adding attributes doesn't change the basic dependency).
Example:
If X → Y and Y → Z hold, then X → Z also holds.
Example:
Normalization is a multi-step process used to eliminate data redundancy and enhance data integrity in tables by organizing columns and tables so that dependencies are properly enforced.
An attribute's domain is atomic if its values are indivisible units (no multivalued or composite substructure).
Attribute Relation Atomicity Emp_Name Employee Atomic Emp_Age Employee Atomic Marks Student Atomic Phone_no Employee Non-atomic Name (Fname, Minit, Lname) Student Non-atomic
Problems caused by redundant data (duplicated data fields across multiple records).
Occurs when you cannot insert a new piece of information without also having some unrelated piece of information available.
Example: A new course “Cyber Security” cannot be added to a combined Student-Course table until a student actually enrolls in it, because the table requires Student_ID and Student_Name to be filled in.
Rule: A relation is in 1NF if it does not contain any multivalued or composite attributes — every attribute must hold only a single atomic (indivisible) value.
Example — Before (violates 1NF)
Roll Name Subject 19 Rajesh Math, Science 23 Supriya History, English 32 Zack Geography
Example — After (1NF, atomic values only)
Roll Name Subject 19 Rajesh Math 19 Rajesh Science 23 Supriya History 23 Supriya English 32 Zack Geography
Candidate Key
A set of one or more attributes that can uniquely identify a record in a relation. Any candidate key can be chosen as the primary key.
Super Key
A set of one or more attributes that can uniquely identify a record; a candidate key is a minimal super key, and the primary key is a subset of the super key.
Second Normal Form (2NF)
Rule: A relation is in 2NF if:
What is partial dependency?
Transitive Dependency (recap): X → Z holds indirectly because X → Y and Y → Z (where Y does not → X).
Example (violates 3NF)
Stud_id Name Sub_id Subject Address 11 Akshay C101 DS Mumbai 12 Kaushik C201 DBMS Pune 13 Satyajeet C105 AOA Satara 14 Niharika C204 TCS Pune 15 Rashmi C201 DBMS Pune Here: Stud_id → Sub_id, and Sub_id → Subject, therefore Stud_id → Subject transitively — this violates 3NF.
Decomposition to achieve 3NF
Student table:
Stud_id Name Sub_id Address 11 Akshay C101 Mumbai 12 Kaushik C201 Pune 13 Satyajeet C105 Satara 14 Niharika C204 Pune
Subject_details table:
Sub_id Subject C101 DS C201 DBMS C105 AOA C204 TCS
Boyce-Codd Normal Form (BCNF)
Also known as 3.5NF.
Rule: A relation is in BCNF if:
BCNF addresses certain anomalies not handled by 3NF.
Example (violates BCNF)
Subject relation — each student can enroll in multiple subjects, multiple teachers can teach the same subject, and for each subject a teacher is assigned:
Stud_id Subject Teacher 11 DS S. Tare 12 DBMS M. Kore 12 CN J. Patil 13 DBMS M. Kore 14 TCS K. Singh 14 DBMS M. Kore 15 CN J. Patil This is in 3NF but not BCNF, because there's an additional dependency: Teacher → Subject (Teacher is not a super key, yet it determines Subject).
Decomposition to achieve BCNF
Student table:
Stud_id Prof_id 11 101 12 102 12 103 13 102 14 104 14 102 15 103
Starting (Unnormalized) table
StudentID StudentName Course Instructor 1 Alex DBMS, Networks Prof. Smith 2 Mary DBMS Prof. Smith 3 John Networks, Python Prof. Clark
Step 1 — 1NF (remove repeating groups, atomic values only)
StudentID StudentName Course Instructor 1 Alex DBMS Prof. Smith 1 Alex Networks Prof. Smith 2 Mary DBMS Prof. Smith 3 John Networks Prof. Clark 3 John Python Prof. Clark
Step 2 — 2NF (remove partial dependency)
Composite key is (StudentID, Course), but StudentName depends only on StudentID — split it out.
Step 3 — 3NF (remove transitive dependency)
Instructor depends on Course, not directly on StudentID — split further.
Step 4 — BCNF (check every determinant is a super key)
Check: StudentID → StudentName ✓(StudentID is a super key), Course → Instructor ✓ (Course is a super key of that table). No violations — the three-table decomposition above is already in BCNF.
Decomposition is the process of splitting a relation into two or more smaller relations to eliminate redundancy and anomalies.
Why decompose?
Goals of a good decomposition
Step 1: Identify the relation
Step 2: Identify Functional Dependencies
Step 3: Find the Candidate Key (via attribute closure)
Multivalued Dependency (MVD)
Exists when one attribute determines a set of values for another attribute, independently of any other attributes in the relation.
Example: In relation Person, PersonID →→ PhoneNumbers means each person has an associated set of phone numbers, independent of other attributes.
Fourth Normal Form (4NF)
Rule: A relation is in 4NF if:
Decomposing into 4NF removes unnecessary duplication caused by multivalued dependencies.
Steps of decomposition for 4NF
Worked Example
Initial relation: Person(PersonID, Address, PhoneNumber) — a person can have multiple addresses AND multiple phone numbers, causing redundancy when both are stored together in one row.
Multivalued dependencies:
Decomposed relations:
This decomposition removes the redundancy that existed when addresses and phone numbers were combined in a single table.
Fifth Normal Form (5NF), also called PJNF (Project-Join Normal Form):
Rule: A relation is in 5NF if: