learning-it by example

Back to the video

Valid Time, Transaction Time and Bitemporal Tables

One price correction stored three ways; only the bitemporal table answers all 4 questions as asked.

Video #265 ยท Data modelling

Steps in the video

  1. 0:00 One price correction, three tables. Only the bitemporal one gets all 4 questions right.
  2. 0:35 The idea
  3. 1:14 Setup
  4. 1:37 Three tables and three events
  5. 2:10 One axis at a time
  6. 2:38 Both axes
  7. 3:10 Asking a question
  8. 3:39 Run the rows
  9. 4:51 What this does not show
  10. 5:16 Mistakes to avoid
  11. 5:46 My take and next steps
  12. 6:08 Recap

Files

  • prices.py (62 lines)
  • run.py (48 lines)

Download the code (zip)

Tested with

Python 3.12.15

What this does not show

One made-up price and three events in SQLite, whole days only, no overlap constraint, and SQL:2011 known only from a summary.

Sources

Learning IT by Example.