1NF and 2NF

Normalization: It is a way to reduce/minimize data redundancy (repetition of data). It can be achieved by splitting the table into many tables.

First Normal Form (1NF):
-> It is the property of converting ER Diagram into the Relational Database.
-&…


This content originally appeared on DEV Community and was authored by hebaShakeel

Normalization: It is a way to reduce/minimize data redundancy (repetition of data). It can be achieved by splitting the table into many tables.

First Normal Form (1NF):
-> It is the property of converting ER Diagram into the Relational Database.
-> The Relational Database is implicitly in 1NF.
-> All attributes should be atomic [ only one value in a tuple is allowed].

Example
Alt Text
Here, SMobile has multiple values which are not allowed. They have to be taken individually.

Approach-1
Alt Text
This approach creates a lot of redundancy in the table. Therefore it is not a suitable approach.

Approach-2
Alt Text
This approach also has redundancy but less when compared to the previous Approach. This is because the tables have now been split into two.

Prime Attributes(Key):
Those attributes which participate in the Candidate key.
Example 1
R(ABCD), CKs: {A, BD}
Therefore PA = {A,B,D}

Example 2
R(ABCDEFG), CKs: {AB, BC, CD, F}
Therefore PA = {A,B,C,D,F}

Non-Prime Attributes(Non-Key):
Those attributes which do not participate in Candidate Key.
Example 1
R(ABCD), CKs: {A, BD}
Therefore NPA = {C}

Example 2
R(ABCDEFG), CKs: {AB, BC, CD, F}
Therefore NPA = {E,G}

Partial Dependency:
If subset of any Candidate Key derives a non-key attribute.

Example
R(ABCD) FDs : {AB->CD, B->D}
CK => {AB}
B->D, B is a subset of AB and it derives non-key, therefore it is a partial dependency.

Second Normal Form (2NF):
=> If a relation 'R' is in 1NF (and)
=> If every non-prime attribute is fully dependent on any complete CK (or) No Partial Dependency exists.

Allowed in 2NF:
=> Non-Prime determines Non-Prime
=> Non-Prime determines Prime
=> Prime determines Prime

Not-Allowed in 2NF:
=> Prime determines Non-Prime


This content originally appeared on DEV Community and was authored by hebaShakeel


Print Share Comment Cite Upload Translate Updates
APA

hebaShakeel | Sciencx (2021-06-14T18:17:24+00:00) 1NF and 2NF. Retrieved from https://www.scien.cx/2021/06/14/1nf-and-2nf/

MLA
" » 1NF and 2NF." hebaShakeel | Sciencx - Monday June 14, 2021, https://www.scien.cx/2021/06/14/1nf-and-2nf/
HARVARD
hebaShakeel | Sciencx Monday June 14, 2021 » 1NF and 2NF., viewed ,<https://www.scien.cx/2021/06/14/1nf-and-2nf/>
VANCOUVER
hebaShakeel | Sciencx - » 1NF and 2NF. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/06/14/1nf-and-2nf/
CHICAGO
" » 1NF and 2NF." hebaShakeel | Sciencx - Accessed . https://www.scien.cx/2021/06/14/1nf-and-2nf/
IEEE
" » 1NF and 2NF." hebaShakeel | Sciencx [Online]. Available: https://www.scien.cx/2021/06/14/1nf-and-2nf/. [Accessed: ]
rf:citation
» 1NF and 2NF | hebaShakeel | Sciencx | https://www.scien.cx/2021/06/14/1nf-and-2nf/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.