Consider a table storing customer orders where customer details are repeated in every order row. What issue does this cause?
CREATE TABLE Orders ( OrderID INT, CustomerName VARCHAR(100), CustomerAddress VARCHAR(200), Product VARCHAR(100), Quantity INT ); INSERT INTO Orders VALUES (1, 'Alice', '123 Maple St', 'Book', 2), (2, 'Alice', '123 Maple St', 'Pen', 5), (3, 'Bob', '456 Oak St', 'Notebook', 1);
Think about what happens if Alice changes her address.
Repeating customer details in every order causes data redundancy. If the address changes, it must be updated in many rows, risking inconsistencies.
What is the main goal of normalization in database design?
Normalization helps keep data consistent and avoids repetition.
Normalization organizes data into tables to minimize duplication and ensure data accuracy.
Which SQL option correctly splits customer and order data into two normalized tables?
Look for separate tables with a foreign key linking orders to customers.
Option A creates two tables with a foreign key, properly normalizing customer and order data.
How does normalization affect the process of updating customer address information?
Think about how many places you must change the address in a normalized design.
Normalization stores customer data once, so updating the address happens in one place, reducing errors and effort.
Given this denormalized table, what anomaly might occur if a customer changes their phone number?
Orders OrderID | CustomerName | PhoneNumber | Product 1 | John Doe | 555-1234 | Laptop 2 | John Doe | 555-1234 | Mouse 3 | Jane Smith | 555-5678 | Keyboard
What happens if John Doe's phone number changes but only one order row is updated?
Because the phone number is repeated in multiple rows, updating only some rows causes inconsistent data.