Real-World Normalization
In practice, most teams target 3NF with selective denormalization for performance. Common denormalized fields: total_amount, item_count, status_label, and soft-delete timestamps.
In practice, most teams target 3NF with selective denormalization for performance. Common denormalized fields: total_amount, item_count, status_label, and soft-delete timestamps.
-- Common denormalized fields on orders
ALTER TABLE orders ADD COLUMN subtotal DECIMAL(10,2);
ALTER TABLE orders ADD COLUMN item_count INT DEFAULT 0;
-- Updated via trigger or application code after order_items change
-- Avoids expensive SUM() on every order fetch
Document intentional denormalization in schema comments so future developers understand the trade-off.