SQL Dojo Beta
Modeling

Data Vault: hubs, links, satellites

Hubs hold business keys, links hold relationships, satellites hold attributes and their history.

Every table is insert-only, with a load_date and a record_source. Keys are hashes of the business key (md5(lower(email))), so loads can run in parallel. Analysts query star schemas built on top.

SELECT md5(lower(trim(email))) AS customer_hk,
       lower(trim(email)) AS customer_bk,
       'shop' AS record_source
FROM customers
ORDER BY customer_id
LIMIT 3;
customer_hkcustomer_bkrecord_source
bd9af961a49d3deb8f784dfd7745e924ines.morel@orange.frshop
08899450d6cec19d4b1d228ea111175delsa.fernandez@proton.meshop
7b6338cee1782cc246656d3987174f86eva.keller@orange.frshop
Try it in Randori