0% found this document useful (0 votes)
50 views

Assignment 1

Normalization is a process of organizing data to minimize redundancy and dependency. It involves breaking large tables into smaller tables and linking them through relationships. The document discusses the various normal forms from 1st to 5th normal form which are applied to normalize tables by removing anomalies like insertion, deletion and update anomalies. It also explains entity relationship modeling for a college management system and key terms like primary key, functional dependency and attributes.

Uploaded by

Gaurav Anand
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Assignment 1

Normalization is a process of organizing data to minimize redundancy and dependency. It involves breaking large tables into smaller tables and linking them through relationships. The document discusses the various normal forms from 1st to 5th normal form which are applied to normalize tables by removing anomalies like insertion, deletion and update anomalies. It also explains entity relationship modeling for a college management system and key terms like primary key, functional dependency and attributes.

Uploaded by

Gaurav Anand
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

1. Explain the concept of normalization and its types.

Normalization is the process of organizing data into a related table; it also


eliminates redundancy and increases the integrity which improves
performance of the query. To normalize a database, we divide the
database into tables and establish relationships between the tables.
Normalization Avoids
Duplication of Data- The same data is listed in multiple lines of the
database
Insert Anomaly- A record about an entity cannot be inserted into the table
without first inserting information about another entity - Cannot enter a
customer without a sales order
Delete Anomaly- A record cannot be deleted without deleting a record
about a related entity. Cannot delete a sales order without deleting all of
the customer's information.
Update Anomaly- Cannot update information without changing
information in many places. To update customer information, it must be
updated for each sales order the customer has placed.

 
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

 Remove Partial Dependencies.


 Functional Dependency: The value of one attribute in a table is determined
entirely by the value of another.
 Partial Dependency: A type of functional dependency where an attribute is
functionally dependent on only part of the primary key (primary key must
be a composite key).
 Create a separate table with the functionally dependent data and the part
of the key on which it depends. The tables created at this step will usually
contain descriptions of resources.
Definition: A relation is in 2NF if it is in 1NF and every non-key attribute is fully
dependent on each candidate key of the relation.

Third Normal Form (3rd NF)


 

In 3rd NF

 Remove transitive dependencies.


 Transitive Dependency A type of functional dependency where an attribute
is functionally dependent on an attribute other than the primary key. Thus
its value is only indirectly determined by the primary key.
 Create a separate table containing the attribute and the fields that are
functionally dependent on it. The tables created at this step will usually
contain descriptions of either resources or agents. Keep a copy of the key
attribute in the original file.
A relation is in third normal form if it is in 2NF and every non-key attribute of the
relation is non-transitively dependent on each candidate key of the relation.

Boyce-Codd Normal Form (BCNF)


 

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.

Fourth Normal Form (4th NF)


 

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:

 Has no multiple sets of multi-valued dependencies. In other words, 4NF


states that no entity can have more than a single one-to-many relationship
within an entity if the one-to-many attributes are independent of each
other.
 Fourth Normal Form applies to situations involving many-to-many
relationships.
In relational databases, many-to-many relationships are expressed through cross-
reference tables.

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.

Fifth Normal Form (5th NF)


 

In 5th NF

 A relation that has a join dependency cannot be decomposed by a


projection into other relations without spurious results
 A relation is in 5NF when its information content cannot be reconstructed
from several smaller relations i.e. from relations having fewer attributes
than the original relation
Definition: A table is in the fifth normal form (5NF) or Project-Join Normal Form (PJNF) if
it is in 4NF and it cannot have a lossless decomposition into any number of smaller
tables.

 
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.

2. Explain ER Data Modeling for College management system.


The entity-relationship diagram of College Management System shows all the
visual instrument of database tables and the relations between Books, Issues,
Library, Branch etc. It used structure data and to define the relationships between
structured data groups of College Management System functionalities.

3. Explain following terms: i. Primary Key ii. Functional Dependency iii.


Attributes

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.

The choice of a primary key in a relational database often depends on the


preference of the administrator. It's possible to change the primary key for a
given database when the specific needs of the users change. For example,
the people in a town might be uniquely identified according to their driver's
license numbers in one application, but in another situation, it might be
more convenient to identify them according to their telephone numbers.

The following are a few common examples of primary keys:

Social Security Number (SSN). U.S. citizens are issued uniquely


identifiable social security numbers, which can be used as a primary key in
a relational database. Some organizations prefer to use SSNs, as each
employee already has one and because of their uniqueness. However, due
to privacy concerns, the use of an SSN can be controversial.

Vehicle Identification Number (VIN). A VIN is a good example of a


primary key for a relational database for a vehicle registration system, as
no two vehicles can have the same VIN.

ii) Functional Dependency


The functional dependency is a relationship that exists between two attributes. It
typically exists between the primary key and non-key attribute within a table.

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.

Functional dependency can be written as:

1. Emp_Id → Emp_Name   

We can say that Emp_Name is functionally dependent on Emp_Id.

Types of Functional dependency

1. Trivial functional dependency


o A → B has trivial functional dependency if B is a subset of A.
o The following dependencies are also trivial like: A → A, B → B

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

You might also like