Database Basics

In a database used mainly for reading and aggregation, normalized tables are sometimes deliberately merged into one so that the same data is held in duplicate (denormalization). Which correctly pairs an advantage and a disadvantage of this design?

  1. AStorage shrinks because duplication disappears, but reads become slower because there are more joins
  2. BBoth reads and updates become faster, and data consistency is maintained automatically
  3. CReads become faster because there are fewer joins, but more update work is needed to keep the duplicated data consistent
Show answer and explanation

Answer: C. Reads become faster because there are fewer joins, but more update work is needed to keep the duplicated data consistent

Normalization removes duplicated data and prevents update anomalies, but every search then needs joins across several tables. Where read performance matters, normalization is sometimes deliberately broken by merging columns that are often used together into one table or by storing aggregated results as columns. This is called denormalization. With fewer joins, reads become faster, but because the same data is recorded in several places, every change must correctly update all of them, increasing the update work and the risk of inconsistencies. Storage generally increases too. For this reason, databases for transaction processing with many updates are normalized as a rule, and denormalization is applied only where it is needed, after weighing its benefit against its cost.

  • A. This is the opposite. Denormalization increases duplication and reduces joins.
  • B. The consistency of duplicated data is not maintained automatically; the update processing must maintain it.
  • C. Correct. Reads become faster, but there is more work to update the duplicated data consistently and a greater risk of inconsistency.
Practice this topic Back to topic

Related calculators

Books on Database Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Database Basics questions

  1. In an E-R diagram, there is a many-to-many relationship between students and courses: one student takes several courses, and one course is taken by several students. Which is an appropriate way to implement this relationship with relational database tables?
  2. In an account table, a transaction is started, and an UPDATE that subtracts 300 from account A's balance and an UPDATE that adds 300 to account B's balance are executed. Then ROLLBACK is executed instead of COMMIT. What happens to the account table?
  3. Among the ACID properties a transaction should have, which is the property that a transfer debiting account A and crediting account B is either carried out completely or not at all, even if a failure occurs partway through?
  4. The stock count of a product in a stock table is 10. Transaction T1 reads the stock count and writes back the value minus 3, and T2 reads the stock count and writes back the value minus 5. If they run without locks in the order T1 reads, T2 reads, T1 writes, T2 writes, what is the final stock count?
  5. Among the problems that occur when transactions run concurrently, which correctly describes a dirty read?