Describe the concept of normalization in a database.

Instruction: Explain what normalization is and why it is important in database design. Provide an example to illustrate your explanation.

Context: This question is designed to gauge the candidate's understanding of normalization principles, its importance in reducing data redundancy and improving data integrity, and their ability to apply these concepts through practical examples.

Updated

Official answer

Normalization organizes relations around their keys and functional dependencies to reduce avoidable duplication and insertion, update and deletion anomalies. It is not a promise that every query becomes faster.

Suppose Orders(order_id, customer_id, current_customer_name) stores one row per order. Assume each order belongs to one customer and customer_id determines the customer's current name. Repeating that name on every order creates an update anomaly: a correction could leave different names for the same customer.

Use Customers(customer_id, current_customer_name) and Orders(order_id, customer_id), with primary keys and an appropriate foreign key. The current name has one authoritative location. The example depends on the stated business rule: a legally required name captured when an order was placed is a historical fact, not necessarily redundant current-customer data.

At an introductory level, first normal form removes repeating groups within the chosen relational model; second normal form removes dependencies of non-key attributes on only part of a candidate key; third normal form addresses inappropriate transitive dependencies on keys. Identify candidate keys and dependencies before applying these labels.

Analytical designs may deliberately duplicate attributes for usability or measured performance. Document their source, refresh process and consistency rules rather than assuming either normalization or denormalization is universally best.

Related Questions