diff --git a/content/notes/Normal-Forms.md b/content/notes/Normal-Forms.md index 4eaa7f738..c87b23143 100644 --- a/content/notes/Normal-Forms.md +++ b/content/notes/Normal-Forms.md @@ -6,3 +6,14 @@ tags: --- +# 1 NF +- atomic attributes +- no multivalue/composite/nested relations + +# 2 NF +- no nonprime attributes that are partially functionally dependent on primary key + +# 3 NF +- remove nonprime attributes that are transitively dependent on primary key + +# BCNF diff --git a/content/notes/databases.md b/content/notes/databases.md index 5acb0834c..ad7ca270b 100644 --- a/content/notes/databases.md +++ b/content/notes/databases.md @@ -28,9 +28,29 @@ Constraints - Ref Integrity: Foreign key - Functional Dependencies - fd: when one value determines another e.g., sid -> sname, {sid, cid} -> grade - - armstrong axioms: + - armstrong axioms: ![](https://i.imgur.com/3MAOrXD.png) # Normal Forms +Help to prevent anomalies (update, delete, insert) by reducing redundancy + +e.g., +``` +bad: +Student_Course(sid, sname, address, cid, cname, grade) + +good: +Student(sid,sname,address) +Course(cid,cname) +nrolled(sid,cid,grade) +``` + +done through process of decomposition: breaking down schema into set of schemas while preserving: +- attributes +- dependencies +- lossless joins + +Various degrees of normalisatin defined by normal forms: [Normal Forms](notes/Normal-Forms) + # SQL [SQL](notes/SQL) \ No newline at end of file