Give a table of your own that is already in 1NF but not in 2
Give a table of your own that is already in 1NF but not in 2NF, along with the functional dependencies among the attributes of the table drawn as a diagram. Illustrate the process of normalisation of your table to 2NF.
Solution
Second Normal Form :-
A table is said to be in 2NF if and only if :-
* The Table should be in 1NF.
* No non-prime attribute is dependent on the proper subset of any candidate key of table.
Non-Prime Attribute :-
Non-Prime Attibute is an attribute which is not part of any candidate key.
Example :-
In the given table ...
Candidate Keys :- SID,SUB
Non-Prime Attribute :- SAGE
Now we can say that the table is in 1 NF because every attribute has atomic value. But, it is not in 2NF because non prime attribute SAGE is dependent on SID alone which is a proper subset of candidate key, which violates the rule of 2NF. In order to achieve 2NF we can break the table into two tables like below :-
| SID | SUB | SAGE |
| 1210312201 | C | 15 |
| 1210312201 | C++ | 15 |
| 1210312202 | DATA STRUCTURES | 15 |
| 1210312203 | C++ | 16 |
| 1210312203 | JAVA | 16 |
