Assignment 1
Assignment 1
First Normal Form (1st NF)
In 1st NF
The table cells must be of a single value.
Eliminate repeating groups in individual tables.
Create a separate table for each set of related data.
Identify each set of related data with a primary key.
Definition: An entity is in the first normal form if it contains no repeating
groups. In relational terms, a table is in the first normal form if it contains no
repeating columns. Repeating columns make your data less flexible, waste disk
space, and makes it more difficult to search for data.
Second Normal Form (2nd NF)
In 2nd NF
In 3rd NF
In BCNF
When a relation has more than one candidate key, anomalies may result
even though the relation is in 3NF.
3NF does not deal satisfactorily with the case of a relation with overlapping
candidate keys
i.e. composite candidate keys with at least one attribute in common.
BCNF is based on the concept of a determinant.
A determinant is any attribute (simple or composite) on which some other
attribute is fully functionally dependent.
A relation is in BCNF is, and only if, every determinant is a candidate key.
Definition: A relation is in Boyce-Codd Normal Form (BCNF) if every determinant is a
candidate key. (See the links in the box at right for definitions of determinant and
candidate key.)
The difference between 3NF and BCNF is that for a functional dependency A B, 3NF
allows this dependency in a relation if B is a primary-key attribute and A is not a
candidate key,
Whereas BCNF insists that for this dependency to remain in a relation, A must be a
candidate key.
In 4th NF
An entity is in Fourth Normal Form (4NF) when it meets the requirement of being in
Third Normal Form (3NF) and additionally:
Definition: A table is in fourth normal form (4NF) if and only if it is in BCNF and contains
no more than one multi-valued dependency.
In 5th NF
Fifth normal form, also known as join-projection normal form (JPNF), states that no non-
trivial join dependencies exist. 5NF states that any fact should be able to be
reconstructed without any anomalous results in any case, regardless of the number of
tables being joined. A 5NF table should have only candidate keys and its primary key
should consist of only a single column.
i) Primary Key
A primary key, also called a primary keyword, is a column in a relational
database table that's distinctive for each record. It's a unique identifier,
such as a driver's license number, telephone number with area code or
vehicle identification number (VIN). A relational database must have
only one primary key. Every row of data must have a primary key value
and none of the rows can be null.
1. X → Y
The left side of FD is known as a determinant, the right side of the production is
known as a dependent.
For example:
Assume we have an employee table with attributes: Emp_Id, Emp_Name,
Emp_Address.
Here Emp_Id attribute can uniquely identify the Emp_Name attribute of employee
table because if we know the Emp_Id, we can tell that employee name associated
with it.
1. Emp_Id → Emp_Name
Example:
1. Consider a table with two columns Employee_Id and Employee_Name.
2. {Employee_id, Employee_Name} → Employee_Id is a trivial functional dependency
as
3. Employee_Id is a subset of {Employee_Id, Employee_Name}.
4. Also, Employee_Id → Employee_Id and Employee_Name → Employee_Name are tri
vial dependencies too.
2. Non-trivial functional dependency
o A → B has a non-trivial functional dependency if B is not a subset of A.
o When A intersection B is NULL, then A → B is called as complete non-trivial.
Example:
1. ID → Name,
2. Name → DOB
iii) Attributes
In a database management system (DBMS), an attribute is a piece of data that
describes an entity. For example, in a customer database, the attributes might be
name, address, and phone number. In a product database, the attributes might be
name, price, and date of manufacture.
Types of Attributes