In this post I want to give as much insight on how to link your tables in VDM and what each form of linking is doing.
There are four main types of joins that are used in the linking process. Joins combine two or more tables, based on a related field/column between them.
For a full overview of Joins click here.
- Inner Join
- Left Join
- Right Join
- Full Join
The inner join is the most commonly used join. Inner Joins match the set of records that appear in both tables (See Image Below)
Example: Select all records from Table 1 and Table 2, where the join condition is met.
The left join returns all records from the left table and the matched records from the right table. If there are no matching records then null values will be returned.
Example: Select all records from Table 1, and records from Table 2 where the join condition is met (if at all)
A right join is similar to the left join, but reversed. The right join will return all records from the right table and the matched records from the left with null values where there is no match.
Example: Select all records from Table 2 and records from Table 1 where the join condition is met (if at all)
The full join is a combination of both the left and right join. The full join returns all the records from both tables. If there is no matching information for record in one of the tables a null value is returned.
Note: Full Join can potentially return a large amount of results.
Example: Return all records whether or not there is a match in either the left or right table.
To begin the linking process, click the Linking button on VDM's main screen.
Note: You will need to have added fields to the View from multiple tables to perform linking. Once on the linking page simply find the field you want to link the tables on and drag and drop the fields on top of each other. The key when linking is knowing the structure of the database, tables and fields. Below is our very comprehensive Youtube video of the entire linking process.