Database Basics
What is the main purpose of normalization of tables in a relational database?
- ATo reduce the number of tables so that any search can be done quickly without joins
- BTo encrypt data so that unauthorized users cannot read it
- CTo eliminate duplicated data and prevent anomalies such as contents becoming inconsistent after an update
Show answer and explanation
Answer: C. To eliminate duplicated data and prevent anomalies such as contents becoming inconsistent after an update
Normalization is a design procedure that splits tables based on functional dependencies between columns (a relationship in which the value of one column determines the value of another) so that the same fact is not recorded in several places. For example, if every row of an employee table also holds the department name, renaming a department requires rewriting every row of that department's employees, and missing any of them leaves the contents inconsistent (an update anomaly). Other problems arise as well: a department with no employees yet cannot be registered (an insertion anomaly), and deleting the last employee of a department also erases the department's information (a deletion anomaly). If department information is moved into a separate department table, a department name needs to be corrected in only one place. On the other hand, splitting tables means more joins when searching, so normalization does not necessarily make searches faster.
- A. Normalization splits tables into more of them, and searches more often need joins.
- B. Encryption is a security measure and has nothing to do with normalization.
- C. Correct. The purpose is to remove duplication and prevent update, insertion and deletion anomalies.