Bird
0
0

You have a denormalized table where customer phone numbers are repeated in many rows. You run this update:

medium📝 Debug Q14 of 15
SQL - Database Design and Normalization
You have a denormalized table where customer phone numbers are repeated in many rows. You run this update:
UPDATE Orders SET CustomerPhone = '123-4567' WHERE CustomerID = 5;
but some rows still show old phone numbers. What is the most likely problem?
AThe WHERE clause did not match all rows for CustomerID 5
BDenormalization prevents updates to repeated data
CCustomerPhone is a computed column and cannot be updated
DThe database automatically updates all rows, so this is impossible
Step-by-Step Solution
Solution:
  1. Step 1: Analyze update query symptom and identify cause

    The update targets rows with CustomerID = 5, but some rows still have old data, meaning some rows were missed. Most likely, some rows have incorrect or missing CustomerID values, so the WHERE clause did not match them.
  2. Final Answer:

    The WHERE clause did not match all rows for CustomerID 5 -> Option A
  3. Quick Check:

    Update misses rows if WHERE condition is incomplete [OK]
Quick Trick: Check WHERE clause matches all repeated rows in denormalized tables [OK]
Common Mistakes:
  • Thinking denormalization blocks updates
  • Assuming computed columns without checking
  • Believing database auto-updates all duplicates

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes