DBMS - FIRST NORMAL FORM
-
Upload
manish-t-i -
Category
Education
-
view
78 -
download
0
Transcript of DBMS - FIRST NORMAL FORM
DATABASE MANAGEMENT SYSTEM
NORMALIZATION
It was defined to disallow multi valued attributes, compositeattributes and their combinations (Complex Attributes).
Attribute values permitted by normal form are single atomic (or indivisible)
It disallows “ relations within relations” or relations as attribute values within tuples”.
FIRST NORMAL FORM
Example
DNAME DNUMBER DHEAD
CSE 101 Raju
IT 102 Ram
ECE 103 Rahul
DEPARTMENT Relation SchemaPrimary Key DNUMBER
DNAME DNUMBER DHEAD DLOCATION
CSE 101 Raju Thr, Tvm
IT 102 Ram Thr
ECE 103 Rahul Thr, Tvm
DNUMBER is functionally dependent with DNAME, DHEADNow we extend with the attribute DLOCATION
DLOCATION contains atomic values but some tuples can have a set of values. DLOCATION is not functionally dependent on the primary key DNUMBER. The Domain of DLOCATION contain set of values and hence it is non-atomic.
Converting to First Normal Form
Solution I :-
Remove the attribute DLOCATION that violates 1NF and place it in a separate relation DEPT_LOCATION along with the primary key DNUMBER of the DEPARTMENT Schema
DNAME DNUMBER DHEAD
CSE 101 Raju
IT 102 Ram
ECE 103 Rahul
DNUMBER DLOCATION
101 Thr
101 Tvm
102 Thr
103 Thr
103 Tvm
DEPARTMENT DEPT_LOCATION
Decomposes the non - 1nf relation into two 1nf relations
Solution II :-
Expand the key so that there will be a separate tuple in the original DEPARTMENT relation for each location of a DEPARTMENT. Using this method redundancy occurs in data
DNAME DNUMBER DHEAD DLOCATION
CSE 101 Raju Thr
CSE 101 Raju Tvm
IT 102 Ram Thr
ECE 103 Rahul Thr,
ECE 103 Rahul Tvm
Here DNUMBER and DLOCATION is Primary key of DEPARTMENT schema .DNUMBER , DLOCATION is the Partial Key
Solution III :-
If maximum number of values is known for the attribute. For example at most three locations can exist for a department. Replace the DLOCATION attribute by three atomic attributes DLOCATION1, DLOCATION2, DLOCATION3. The disadvantage of introducing NULL values if most department have fewer than three locations.
DNAME
DNUMBER
DHEAD
DLOCATION1
DLOCATION2
DLOCATION3
CSE 101 Raju Thr Tvm NULL
IT 102 Ram Thr NULL NULL
ECE 103 Rahul Thr Tvm NULL
If queries contact :
Manish T IE-mail: [email protected] [email protected]: 919744603783
Reference:-
Elmasri, Navathe. Fundamentals of Database Systems, Third Edition, Pearson Education, 2000.