Notifications
Clear all

Methods for handling optional relationship when loading link


Posts: 85
Topic starter
(@geekn)
Trusted Member
Joined: 8 months ago

In cases where there is a zero to one relationship, what is the preferred approach to handling the optional relationship when loading the link table?  The relationship between the tables below would be modeled as: L_TABLE1_TABLE2 (HUBS are not listed but assume they exist).

QUESTION 1:

When table2_id is NULL for a record in TABLE1, would the preferred method be to generate a zero key in the L_TABLE1_TABLE2 link table OR would it be better to insert a link relationship record ONLY when the table2_id is NOT NULL by placing a WHERE clause on the LINK load into the raw vault?

TABLE1
-------------------
table1_id (PK)
attribute1
table2_id (FK) optional

TABLE2
-------------------
table2_id (PK)
attribute1

L_TABLE1_TABLE2
-------------------
hk_table1
hk_table2

QUESTION 2:

Would the preferred approach from question 1 change if you knew the optional relationship may show up at a later date?

Reply
Topic Tags
10 Replies