Unit-II Design and Normalization
Unit-II Design and Normalization
• When only one instance of the entity on the left, and more
than one instance of an entity on the right associates with
the relationship then this is known as a one-to-many
relationship.
• For example, Scientist can invent many inventions, but the
invention is done by the only specific scientist.
Many-to-one relationship
• When more than one instance of the entity on the left, and
only one instance of an entity on the right associates with
the relationship then it is known as a many-to-one
relationship.
• For example, Student enrolls for only one course, but a
course can have many students.
Many-to-many relationship
• When more than one instance of the entity on the left, and
more than one instance of an entity on the right associates
with the relationship then it is known as a many-to-many
relationship.
• For example, Employee can assign by many projects and
project can have many employees.
ENHANCED ENTITY-RELATIONSHIP MODEL
• What is Normalization?
• Normalization is the process of organizing the data in the
database.
• Normalization is used to minimize the redundancy from a
relation or set of relations. It is also used to eliminate
undesirable characteristics like Insertion, Update, and
Deletion Anomalies.
• Normalization divides the larger table into smaller and
links them using relationships.
• The normal form is used to reduce redundancy from the
database table.
First Normal form
• It states that the domain of an attribute must include only
atomic (simple, indivisible) values and that the value of any
attribute in a tuple must be a single value from the domain
of that attribute.
• It disallows having a set of values, a tuple of values, or a
combination of both as an attribute value for a single tuple.
•
A table in 1NF
First technique:
•
• EMP_DEPT is normalized by decomposing it into the two 3NF relation
schemas ED1 and ED2.
BOYCE CODD NORMAL FORM
• Definition: A relation schema R is in BCNF if whenever a nontrivial
functional dependency X→A holds in R, then X is a superkey of R.
• Example: Consider a relation TEACH with the following
dependencies:
• FD1: {Student, Course} → Instructor FD2: Instructor → Course
• {Student, Course} is a candidate key for this relation and that the
dependencies shown follow the pattern in figure, with Student as
A, Course as B, and Instructor as C.
Fourth Normal Form