← RGPV CS-502 DBMS November 2023 solved question paper
RGPV CS-502 (GS) | November 2023 | Q3(a) | 7 marks
Question (restated): Explain insertion, deletion and update anomalies in an employee table containing employee ID, name and department.
Answer
| E_ID | Ename | Dname |
|---|---|---|
| e1 | A | HR |
| e4 | B | HR |
| e8 | C | Finance |
| e9 | D | NULL |
| e2 | E | Civil |
An anomaly is an undesirable consequence of representing facts about different entities in the same relation. Here employee facts and department membership are stored together. E_ID is the primary key. Department names are repeated, and departments cannot be represented independently.
Insertion anomaly: suppose a new department IT is established before any employee is assigned to it. The table cannot store that fact without inventing an employee identifier or violating the primary-key constraint. The NULL department for employee e9 also illustrates that an employee may exist without a known department assignment.
Deletion anomaly: deleting e8 removes the only row containing Finance. If this table is the sole record of departments, information about the Finance department is lost even though the intention was only to delete an employee.
Update anomaly: renaming HR to Human Resources requires changing both e1 and e4. If only one row is updated, the database contains inconsistent representations of the same department. The problem grows with the number of employees.
A better design separates department identity from employee membership. Use Department(D_ID,Dname) and Employee(E_ID,Ename,D_ID), with a foreign key that may be nullable if unassigned employees are allowed. A department can then be inserted independently, renamed once, and retained after its last employee leaves. Referential actions must be selected according to business rules.
Note that E_ID → Ename,Dname alone does not prove a formal normal-form violation: the anomalies arise from the intended semantics of department existence and identity. Introducing a separate department entity captures those semantics explicitly.
Further reading: Silberschatz, Korth and Sudarshan, Database System Concepts; Elmasri and Navathe, Fundamentals of Database Systems.
Discussion
Ask a question, share your thoughts or report an error.
Sign in to participate in the discussion.
Join the discussion