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  | 
| 
 
  | 
 
  | 
 
  | 
 
  | 
| 
 
  | 
 
  | 
 
  | 
 
  | 
| 
 
  | 
 
  | 
 
  | 
 
  | 
| 
 
  | 
 
  | 
 
  | 
 
  | 
| 
 
  | 
 
  | 
 
  | 
 
  | 
As you can see, the preceding table is not normalized. We will start to see the following problems when a table is not normalized:
- Update anomaly: In the preceding table...