CSC 480 · Database Management
Our notes
3 min readWhy normalise
A badly designed table repeats facts and causes anomalies. Example: one table Results(MatNo, StudentName, CourseCode, CourseTitle, Units, Score).
- Update anomaly: changing CSC 480's title must be done in hundreds of rows; miss one and data disagree.
- Insertion anomaly: a new course cannot be stored until a student registers it.
- Deletion anomaly: deleting the last registration for a course loses the course's title and units.
Functional dependencies (FDs)
X → Y: each value of X determines exactly one value of Y. In Results: MatNo → StudentName; CourseCode → CourseTitle, Units; {MatNo, CourseCode} → Score.
Armstrong's axioms: reflexivity (if Y ⊆ X then X → Y), augmentation (X → Y gives XZ → YZ), transitivity (X → Y and Y → Z give X → Z). Derived: union, decomposition, pseudo-transitivity.
Closure X⁺: all attributes determined by X. If X⁺ contains every attribute, X is a superkey.
Worked example. R(A, B, C, D) with A → B, B → C, C → D. A⁺ = {A, B, C, D}: A is a key. B⁺ = {B, C, D}: not a key.
The normal forms
- 1NF: every attribute atomic, no repeating groups (no "courses" column holding a list).
- 2NF: 1NF and no partial dependency: no non-key attribute depends on only part of a composite key.
- 3NF: 2NF and no transitive dependency: no non-key attribute depends on another non-key attribute.
- BCNF: for every non-trivial FD X → Y, X is a superkey. (Stronger than 3NF; differs only when there are overlapping candidate keys.)
Worked decomposition
Results(MatNo, CourseCode, StudentName, DeptCode, DeptName, CourseTitle, Units, Score), with MatNo → StudentName, DeptCode; DeptCode → DeptName; CourseCode → CourseTitle, Units.
- Partial dependencies (on MatNo alone and CourseCode alone) → 2NF: Student(MatNo, StudentName, DeptCode, DeptName); Course(CourseCode, CourseTitle, Units); Registration(MatNo, CourseCode, Score).
- Transitive dependency MatNo → DeptCode → DeptName → 3NF: Student(MatNo, StudentName, DeptCode); Department(DeptCode, DeptName).
Final: Student, Department, Course, Registration: exactly the running example's tables.
BCNF example
Teaching(Student, Course, Lecturer) where each lecturer teaches one course (Lecturer → Course) and each student has one lecturer per course ({Student, Course} → Lecturer). It is in 3NF (Course is part of a key) but not BCNF (Lecturer is not a superkey). Decompose into (Lecturer, Course) and (Student, Lecturer); note this loses the dependency {Student, Course} → Lecturer, the classic BCNF trade-off.
Good decompositions
- Lossless join: joining the parts gives back exactly the original (guaranteed if the common attributes form a key of one part).
- Dependency preservation: every FD can be checked within a single table.
3NF can always achieve both; BCNF always lossless but not always dependency-preserving.
Higher forms
4NF removes multi-valued dependencies (a lecturer's courses and hobbies stored in one table multiply rows); 5NF deals with join dependencies.
Denormalisation
Deliberately adding redundancy (a stored CGPA, a course count) for read speed in reporting systems. Done knowingly, with rules (triggers or batch jobs) to keep copies consistent.
Exams usually ask: identify anomalies; find FDs and keys using closure; normalise a given table step by step to 3NF/BCNF; define each normal form; lossless join and dependency preservation; when to denormalise.
Common mistake: jumping straight to final tables without showing the steps. State the FDs, name each violation (partial or transitive), then decompose: the marks are in the reasoning.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
NOUN CIT 843: Introduction to Database Management Systems
NOUN course book (PDF, about 2 MB). Nigerian course book: database concepts, DBMS architecture, data models, the relational model, SQL, normalisation and transactions.
(opens nou.edu.ng in a new tab)
-
Database normalization
(opens en.wikipedia.org in a new tab)
Wikipedia, Database normalization, CC BY-SA 4.0 · licence
-
Functional dependency
(opens en.wikipedia.org in a new tab)
Wikipedia, Functional dependency, CC BY-SA 4.0 · licence
Watch
-
Best pick Learn Database Normalization - 1NF, 2NF, 3NF, 4NF, 5NF
29 min · ≈ 131 MB · about ₦74
(opens youtube.com in a new tab)
-
Lec 4: Functional dependency in DBMS | What is functional dependency | Database Management System
26 min · ≈ 117 MB · about ₦66
(opens youtube.com in a new tab)
-
Lec 5: Armstrong's axioms in DBMS | Inference rules of Functional Dependency
25 min · ≈ 113 MB · about ₦63
(opens youtube.com in a new tab)
-
Database Design Course - Learn how to design and plan a database for beginners
8 h 7 min · ≈ 2.1 GB · about ₦1,231
(opens youtube.com in a new tab)
-
Relational Database Design – Full Course
5 h 55 min · ≈ 1.6 GB · about ₦897
(opens youtube.com in a new tab)
We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.