0% found this document useful (0 votes)
45 views1 page

Anomaly Examples

Uploaded by

nkwentiak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views1 page

Anomaly Examples

Uploaded by

nkwentiak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Certainly! Let's consider an example that demonstrates all |2 | Sarah | Project B | Ms.

Johnson | Marketing
three types of anomalies (insertion, update, and deletion) |
using tables.
|3 | Emily | Project C | Ms. Thompson | Sales
Consider the following denormalized table that stores |
information about employees and their projects:
Here, the update of the project manager's name has to be
Table: EmployeeProjects performed in multiple places, risking inconsistencies if the
update is missed in any of the corresponding records.
Emplo Employee Proj ProjectMa Depart
yeeID Name ect nager ment 3. Deletion Anomaly:
1 John Proj Mr. Smith Sales
ect A A deletion anomaly occurs when deleting data from the table
2 Sarah Proj Ms. Marketi unintentionally removes other related data that should have
ect B Johnson ng been preserved. Let's say we remove the record for "Employee
3 Emily Proj Mr. Adams Sales 3" who was working on "Project C." As a result, the information
ect C about the project and the department is lost:

1. Insertion Anomaly:
| EmployeeID | EmployeeName | Project | ProjectManager
An insertion anomaly occurs when we cannot add data to the | Department |
table without including unnecessary or incomplete
|------------|--------------|--------------|----------------|---------------|
information. In this case, let's say we want to add a new
project, "Project D," to the table, but there is no employee |1 | John | Project A | Mr. Smith | Sales |
assigned to that project yet. We would need to insert a record
|2 | Sarah | Project B | Ms. Johnson | Marketing
with incomplete information:
|
Employe EmployeeNa Proje ProjectMana Departm
eID me ct ger ent The deletion of "Employee 3" results in the loss of information
1 John Proje Mr. Smith Sales about "Project C" and its associated department.
ct A To address these anomalies, the table can be normalized into
2 Sarah Proje Ms. Johnson Marketin separate tables for Employees, Projects, and Departments,
ct B g
with appropriate relationships established between them. This
3 Emily Proje Mr. Adams Sales
normalization would eliminate redundancy, improve data
ct C
integrity, and prevent the occurrence of these anomalies.
NULL NULL Proje NULL NULL
ct D

Here, the insertion of the incomplete record with NULL values


is necessary to add the new project, but it introduces
incomplete or missing information.

2. Update Anomaly:

An update anomaly occurs when updating data in the table


leads to inconsistencies or redundancies. Let's say the project
manager for "Project C" changes from Mr. Adams to Ms.
Thompson. To update this information, we would need to
modify multiple records:

| EmployeeID | EmployeeName | Project | ProjectManager


| Department |

|------------|--------------|--------------|----------------|---------------|

|1 | John | Project A | Mr. Smith | Sales |

You might also like