So you want Slowly Changing Dimension?
Understand slowly changing dimension definitions, methods, and tools. Outlines the business benefits of using slowly changing dimension for database versioning. Introduces Dolt, the first SQL database with built in slowly changing dimension.
dolthub.com