Databases Reference
In-Depth Information
2. Right-click and select Set Logical Primary Key.
When there is a relationship between two tables F and D, you typically have
columns A and B in tables F and D that are involved in the join. Typically
column B is the primary key in table D, but not always. Column A is referred
to as the foreign key. An example would be a Sales fact table that has a
product id as a column that joins with the product id in the dimension table
Products. In order to specify relationships between tables in the DSV, you
need to use the following steps:
1. Select the column A in table F that is involved in the join to another
table.
2. With column A selected, drag and drop it to column B in table D.
This forms a relationship between tables F and D and a line will be created
between these two tables with an arrow pointing toward table D. If you
double-click this line you will see details on the relationship — tables involved
in the relationship and columns used for the join. Figure 4-8 shows the rela-
tionship between FactResellersSales and DimReseller tables. You can modify
the relationship using this edit relationship dialog by either changing the
columns involved in the join or by adding additional columns that are involved
in the join.
You can also create a new relationship by right-clicking a table and selecting
New Relationship. You will be asked to specify the relationship in the Create
Relationship dialog which is similar to the Edit Relationship dialog shown in
Figure 4-9 where you need to choose the columns in the source and destina-
tion tables are involved in the join.
Search WWH ::




Custom Search