Key
The attribute / attributes which uniquely identifies the record
1. Super key
The attribute or set of attributes which uniquely identifies the record
2. Candidate key
The minimal subset of super key
3. Primary key
An attribute which uniquely identifies the record and present in Candidate key list
4. Alternate key
Except primary key attribute remaining attributes among Candidate key
5. Composite key
If primary key has more than one attribute
6. Foreign key
Attribute which builds relationship between the tables
Example
NORMALIZATION
Normalization is the process of organizing data in a database
• Which is helpful to protect the data
• To make the database more flexible by eliminating
redundancy and inconsistent dependency.
• To overcome the anomalies like (insertion,updation,deletion)
First normal form (1NF)
• Table should have exactly one primary key
• Columns should have unique name
• Each cell in a table must have atomic value
• Values in a column must be of same domain
Second normal form (2NF)
• Table should be in first normal form
• Table should not have partial functional dependencies
Third normal form (3NF)
• Table should be in second normal form
• Table should not have transitive functional dependencies
Boyce codd normal form (BCNF or 3.5NF)
• Table should be in third normal form
• If Column A is determining Column B then Column A should be
primary key / super key / candidate
PARTIAL FUNCTIONAL DEPENDENCIES
If a table consist of composite key(primary key with more than one attribute)
and non-prime attributes are depending on part of the primary key then
table has partial functional dependencies
----solution
It has to be removed by dividing table into sub tables
EXAMPLE
TRANSITIVE FUNCTIONAL DEPENDENCIES
If non-prime attributes are determining (identifying) another non-prime attributes then it is known as transitive
functional dependencies
----solution
It has to be removed by dividing table into sub tables
EXAMPLE