You are on page 1of 7

Week-6 Tutorial Normalization

1. What is normalization? When is a table in 1NF?

Normalization, in the context of databases, is the process of organizing the fields and tables of a
relational database to minimize redundancy and dependency. It ensures that data is stored
efficiently and avoids certain types of anomalies that can arise from redundant data.A table is said
to be in First Normal Form (1NF) if following conditions are satisfied:

i. Each column in a table must have atomic values.


ii. Each column must contain single valued attribute.

2. Given the dependency diagram shown in Figure 1, answer the following question

a. Identify and discuss each of the indicated dependencies

C1 -> C2. It represents a partial dependency, as C2 depends only on C1.

C4 -> C5. It represents a transitive dependency, as C5 depends on C4 which is not part of a primary
key.

C1, C3 -> C2, C4, C5 It represents a set of proper functional dependencies, because C2, C4, and C5
depend on the primary key composed of C1 and C3.

b. Create a database whose tables are at least in 2NF, showing the dependency diagrams for
each table.

Converting the above dependency diagram into 2NF.


Table 1

Table 2

c. Create a database whose tables are at least in 3NF, showing the dependency diagrams for
each table.

Converting the above dependency diagram into 3NF.

Table 1
Table 2

Table 3
3. The dependency diagram in Fig 2 indicates that a patient can receive many
prescriptions for one or more medicines over time. Based on the dependency
diagram, create a database whose tables are in at least 2NF, showing the
dependency diagram for each table

Following are the dependency diagram for each table:

Table 1
Table 2

Table 3
4. What is a partial dependency? With what normal form is it associated?

Partial dependency occurs in a database when an attribute or a set of attributes depends only on a
part of the primary key, rather than the entire primary key. For example, if we have a table called
Employee with attributes like Employee ID, Employee Name, and Department where the primary
key is Employee ID. We also have an attribute called Department Location which depends only
on the Department. If two employees are in the same department, they likely share the same
department location. So, the Department Location attribute depends only on a part of the primary
key (the Department), not the entire primary key (Employee ID). This is a partial dependency.

Partial dependency is associated with the first normal form (1NF), which is the simplest level of
database normalization. By identifying and resolving partial dependencies, we ensure that the
database structure is efficient and that data integrity is maintained.

5. What three data anomalies are likely to be the result of data redundancy? How can such
anomalies be eliminated?

Data redundancy is the duplication of data within a database. Redundancy leads to various anomalies
that can affect data integrity. The three primary anomalies resulting from data redundancy are:

Update Anomalies: Update anomalies occur when a piece of data is stored redundantly and needs to
be updated in multiple places. If we only update one copy of the data and others are not updated then
it arises inconsistencies. For example, if a employee changes their address, updating it in one record
but not others can lead to confusion and errors in data retrieval.

Insertion Anomalies: This types of anomalies arise when certain attributes cannot be added to the
database without the presence of other attributes. For example, if we have a table where we store
student grades along with their courses, and if a student hasn't enrolled in any course yet, we cannot
add their grade information because it would require the existence of a course record.

Deletion Anomalies: Deletion anomalies occur when the removal of certain data leads to unintended
loss of other data that is still relevant. For example, if we store student information along with the
projects they are assigned to, deleting information about a project may result in the loss of details
about students who were only associated with that project.

To eliminate these anomalies and enhance data integrity, we can employ a process called
normalization. Normalization involves organizing data into well-structured tables with minimal
redundancy. This process typically evolves dividing large tables into smaller ones and establishing
relationships between them.By normalizing the database, redundant data is minimized, and
relationships between data entities are clearly defined. This helps to prevent update, insertion, and
deletion anomalies.

You might also like