Referential Integrity Flashcards
What is Referential Integrity?
Lookup columns never contain null values.
Every value in a lookup column, has a match in the destination table.
What were the three mechanisms Caboodle uses to enforce referential integrity?
Negative surrogate keys. Every table has the three negative surrogate keys.
Default values. Caboodle supplies a default value (-1,-2,-3) when Source data is unavailable.
Inferred rows (with -1, *Unspecified) which act as placeholders until the relevant info is loaded into Caboodle.
-1 surrogate key equates to what in the source system?
NULL = *Unspecified
What does the WHERE clause look like to eliminate these negative surrogate keys?
WHERE ________Key > 0
-2 surrogate key equates to what in the source system?
*Not applicable (string), -2 (foreign keys)
-3 surrogate key
*Deleted
What kind of row is created by the ETL if the referenced row does not exist yet?
Inferred Row and all it’s string values are set to *Unknown
All Fact tables have a Count column which normally stores a 1, when will it store a 0?
When the rows are negative or deleted