Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Normalization

Here are the most commonly used normal forms:

 First normal form(1NF)


 Second normal form(2NF)
 Third normal form(3NF)
 Boyce & Codd normal form (BCNF)

First normal form (1NF)


A relation is said to be in 1NF (first normal form), if it doesn’t contain any multi-valued
attribute. In other words you can say that a relation is in 1NF if each attribute contains only
atomic(single) value only.

Second normal form (2NF)


A table is said to be in 2NF if both the following conditions hold:

 Table is in 1NF (First normal form)


 No non-prime attribute is dependent on the proper subset of any candidate key of
table.

An attribute that is not part of any candidate key is known as non-prime attribute.

Third Normal form (3NF)


A table design is said to be in 3NF if both the following conditions hold:

 Table must be in 2NF


 Transitive functional dependency of non-prime attribute on any super key should be
removed.

An attribute that is not part of any candidate key is known as non-prime attribute.

In other words 3NF can be explained like this: A table is in 3NF if it is in 2NF and for each
functional dependency X-> Y at least one of the following conditions hold:

 X is a super key of table


 Y is a prime attribute of table

An attribute that is a part of one of the candidate keys is known as prime attribute.
Boyce Codd normal form (BCNF)
It is an advance version of 3NF that’s why it is also referred as 3.5NF. BCNF is stricter
than 3NF. A table complies with BCNF if it is in 3NF and for every functional
dependency X->Y, X should be the super key of the table.

Fourth normal form (4NF):


Fourth normal form (4NF) is a level of database normalization where there are no non-
trivial multivalued dependencies other than a candidate key. It builds on the first three
normal forms (1NF, 2NF and 3NF) and the Boyce-Codd Normal Form (BCNF). It states
that, in addition to a database meeting the requirements of BCNF, it must not contain
more than one multivalued dependency.
Properties – A relation R is in 4NF if and only if the following conditions are satisfied:

1. It should be in the Boyce-Codd Normal Form (BCNF).


2. the table should not have any Multi-valued Dependency.

Fifth Normal Form / Projected Normal Form (5NF):


A relation R is in 5NF if and only if every join dependency in R is implied by the candidate
keys of R. A relation decomposed into two relations must have loss-less join Property,
which ensures that no spurious or extra tuples are generated, when relations are reunited
through a natural join.
Properties – A relation R is in 5NF if and only if it satisfies following conditions:

1. R should be already in 4NF.

2. It cannot be further non loss decomposed (join dependency)

An Entity–relationship model (ER


model) describes the structure of a database with
the help of a diagram, which is known as Entity
Relationship Diagram (ER Diagram). The main
components of E-R model are: entity set and
relationship set. Here are the geometric shapes and
their meaning in an E-R Diagram.
Rectangle: Represents Entity sets.
Ellipses: Attributes
Diamonds: Relationship Set
Lines: They link attributes to Entity Sets and Entity sets to
Relationship Set
Double Ellipses: Multivalued Attributes
Dashed Ellipses: Derived Attributes
Double Rectangles: Weak Entity Sets
Double Lines: Total participation of an entity in a relationship set
Relationship
A relationship is represented by diamond shape in ER diagram, it shows the relationship
among entities. There are four types of relationships:
1. One to One
2. One to Many
3. Many to One
4. Many to Many

One to One Relationship:


When a single instance of an entity is
associated with a single instance of another
entity then it is called one to one relationship.
For example, a person has only one passport and a passport is
given to one person.

One to Many Relationship: When a


single instance of an entity is associated with
more than one instances of another entity then it
is called one to many relationship.
For example – a customer can place many
orders but a order cannot be placed by many customers.

Many to One Relationship: When


more than one instances of an entity is associated
with a single instance of another entity then it is
called many to one relationship.
For example – many students can study in a
single college but a student cannot study in many colleges at the
same time.

Many to Many Relationship:


When more than one instances of an entity is
associated with more than one instances of
another entity then it is called many to many
relationship.
For example, a can be assigned to many projects
and a project can be assigned to many students.

You might also like