Database Analysis-Unit-1I: Course Name: Faculty Name
Database Analysis-Unit-1I: Course Name: Faculty Name
Database Analysis-Unit-1I: Course Name: Faculty Name
Super keys: The above table has following super keys. All
of the following sets of super key are able to uniquely
identify a row of the employee table.
Super key in DBMS-Example
{Emp_SSN}
{Emp_Number}
{Emp_SSN, Emp_Number}
{Emp_SSN, Emp_Name}
{Emp_SSN, Emp_Number, Emp_Name}
{Emp_Number, Emp_Name}
Super key in DBMS-Example
{Emp_SSN}
{Emp_Number}
Onlythese two sets are candidate keys as all
other sets are having redundant attributes that
are not necessary for unique identification.
1. First you have to understand that all the candidate keys
Super Key vs. Candidate Key
which can uniquely identify a tuple.
to point to the primary key of another table
In a company, every employee works in a specific
department, and employee and department are two
different entities. So we can't store the information of
the department in the employee table. That's why we
link these two tables through the primary key of one
table.
We add the primary key of the DEPARTMENT table,
Department_Id as a new attribute in the EMPLOYEE
table.
Now in the EMPLOYEE table, Department_Id is the
foreign key, and both the tables are related.
Normalization is a process of organizing the data in
Normalization
database to avoid data redundancy, insertion anomaly,
update anomaly & deletion anomaly. Let’s discuss
about anomalies first then we will discuss normal
forms with examples.
Anomalies in DBMS
There are three types of anomalies that occur when the
database is not normalized. These are – Insertion,
update and deletion anomaly. Let’s take an example to
understand this.
Example: Suppose a manufacturing company stores the
employee details in a table named employee that has
Normalization-Example
value.
2NF A relation will be in 2NF if it is in 1NF and all
non-key attributes are fully functional
dependent on the primary key.
3NF A relation will be in 3NF if it is in 2NF and no
transition dependency exists.
4NF A relation will be in 4NF if it is in Boyce Codd
normal form and has no multi-valued
dependency
5NF A relation is in 5NF if it is in 4NF and not
contains any join dependency and joining
should be lossless
A relation will be 1NF if it contains an atomic value.
It states that an attribute of a table cannot hold multiple
Types of Normalization(1NF)