Anomalies in DBMS

Broadly, we have three types of anomalies that will occur when the database is not normalized. These are the insertion, update, and deletion anomalies. Let's consider each one of them with an example.

For example, suppose a company stores employee details in a table named employee that has four attributes: emp_id to store the employee's id, emp_name to store the employee's name, emp_address to store the employee's address, and emp_dept to store the department details (where the employee works). At the initial stage, the table will look like this:

emp_id

emp_name

emp_address

emp_dept

101

Roger

Texas

D001

101

Roger

Texas

D002

123

Martin

Ohio

D890

166

George

New York

D900 ...

Get PostgreSQL Development Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.