No, itâs not necessary. The universe can work without them. However, you will not be sure that the universe gives correct results.
On the other hand, setting all cardinalities is considered a good practice and doing so helps the universe developer in a big way. If nothing else then at least it helps to identify possible traps.
Whether a join is an inner join or an outer (left or right) join just tells you only a little about the cardinality.
To avoid any confusing definitions, I will give an example of what cardinality of a join is:
Imagine 2 tables - Invoices and Invoice_Lines. The Invoices table has a unique ID, itâs inv_id column. There is only one row per each invoice in the Invoices table. And every invoice is identified by its own unique inv_id.
Now, in the Invoice_Lines table there may be more rows per each invoice. Every row in this table represents an individual line/item from an invoice. You may have an invoice inv_id=1 with only 1 line and you may have an invoice inv_id=2 with 100 lines. That many rows (1 for the first invoice and 100 for the second invoice) are in the Invoice_Items table.
The Invoices and Invoice_Lines tables can be joined via inv_id column:
Invoices.inv_id = Invoice_Lines.inv_id
You can set the join as an inner join - it means that every invoice has at least one record in the Invoice_Items table. Or you can set the join as an outer join if there are also invoices that donât have any invoice lines/items.
And now cardinality:
The cardinality of the join between these 2 tables is 1:N (read â1 to Nâ) and it means that every single row from the Invoices table has at least one and potentially N (where N is any number > 1) rows in the Invoice_Items table. This is very important to understand that 1 row from Invoices can have 1 or N rows in Invoice_Lines. When you take it from the other end, then every row from the Invoice_Lines table has 1 and only one row in the Invoices table.
So the cardinality of this join needs to be set as:
Invoices ---- 1:N ---- Invoice_Lines
You can visually represent it also like this
Invoices ----< Invoice_Lines
where the symbol â<â is at the N side of the join.
So setting a cardinality of a join in Designer means setting which table is at the â1â side of the 1:N join and which table is at the âNâ side of the join.
Other typical examples of 1:N joins between 2 tables can be:
- customers and orders (1 customer made/has N orders. And 1 order belongs to one and only one customer)
- customers and invoices (1 customer received N invoices. And 1 invoice was sent to one and only one customer)
- subscribers and calls (1 subscriber made N calls. And 1 call was made by one and only one subscriber)
- employees and salary details (1 employee had N salaries. And 1 salary was sent to (belongs to) one and only one employee)
- countries and cities (1 country has many (N) cities and 1 city belongs to one and only one country)
To make it a little bit more complicated, a join does not necessarily need to have the 1:N cardinality. You may have 2 tables where the join between them has a 1:1 cardinality. This means that 1 row from the first table has only 1 corresponding row in the second table and vice versa - 1 row from the second table has only 1 corresponding row in the first table.
You have more options:
- you can ask for the data model the person that knows it or that designed it
- you can guess what the cardinalities are based on the knowledge of the subject area. Like if you have invoices and invoice lines tables then you should know that 1 invoice has 1 or more invoice lines, so the cardinality between invoices and invoice lines tables is 1:N
- you can try automatic cardinalities detection in Designer. Sometimes it gives correct results
However, I donât rely on this automatic process. Itâs better to manually set the cardinalities based on your own knowledge of the data model based on which the universe is being built. But if you lack the knowledge of the data model then this automatic detection is better than nothing. However, be aware that it can deceive you 
Marek Chladny
(BOB member since 2003-11-27)