Skip to main content

Documenting complex 3-table relationships

Sometimes, relationships get tricky - there is a composite relationship where one column requires a lookup table, such as on the diagram below:

3-table join

Those relationships on a diagram represent one join, not three distinct joins, i.e. you need to do all three at once to link the salaries table with the employees table.

There is no direct way in Dataedo you can model this (or other typical data modeling tools). You can use a workaround, however. You can create a virtual column that represents a lookup of the foreign key from the intermediary lookup table. You can use the following format to explain the required join:

column_name->lookup_table.foreign_key

or if the join to the lookup table is not obvious then the following:

(column_name->lookup_table.primary_key).foreign_key

virtual join column

Then, you can use the new virtual column to document the composite foreign key, directly to the primary table.

3-table join relationship
3-table join ERD