Why Keep History
Audit, undo and analytics from the past.
The Problem With Overwriting
Every time you run an UPDATE or DELETE, the old data disappears forever. That sounds efficient, but it creates real problems: you cannot answer questions like what was the price last Tuesday? or who changed this record and when?
Keeping history means storing every version of a row, not just the latest one. This lesson explores why that matters and how SQL helps you do it.
Three Reasons to Keep History
There are three classic reasons to preserve historical data in a database:
1. Audit — prove that a change happened, who made it, and when.
2. Undo — roll back a mistake without restoring the whole database.
3. Analytics — answer questions about the past, spot trends, and compare periods.
A well-designed history strategy satisfies all three needs without duplicating too much storage.