240 likes | 493 Views
Database Normalization. Dr. Mahendra Jivraj Patel Templesoft Solutions Pvt. Ltd. www.templesoft.com. Data. Primary Key. A primary key is a field, or list of fields, that uniquely identify one record. Employee_Project Table. Primary Key. Project Number cannot be a Primary Key
E N D
Database Normalization Dr. Mahendra Jivraj Patel Templesoft Solutions Pvt. Ltd. www.templesoft.com
Primary Key • A primary key is a field, or list of fields, that uniquely identify one record
Primary Key • Project Number cannot be a Primary Key • Neither can the Employee Number be the Primary Key • Both do not identify a row uniquely • Both together are the Primary Key for this table
Normalization • There are 5 Normal Forms • Only 3 are used in commercial application • Normalization is done to maintain the integrity of data • Sometimes tables are De-Normalized for efficiency – faster reports
1st Normal Form • Eliminate repeating groups • All key attributes are defined • All attributes are dependent on the primary key
2nd Normal Form • The table HAS to be in the 1st Normal Form • The attribute should be related to the entire Primary Key • No partial dependency
Data • Project Name is dependent ONLY on Project Number • Employee Name, Rate Category and Hourly Rate are dependent ONLY on Employee Number • Remove these fields from the Table
Is this appropriate? Employee Table
3rd Normal Form • The table HAS to be in the 2nd Normal Form • There should be no transitive dependencies • Where a non-key attribute is dependent on another non-key attribute • Each column must be DIRECTLY dependent on the primary key
Any Questions? Thank You vrgurus@hotmail.com mjp@templesoft.com