Lesson 17ª

 

 

 

 

 

   

Managing Relationships II

We will learn how to relate several fields in a Table. For example, our "Orders" Table is related to the "Clients" Table through the "Client's Code" field and to the "Products" Table through the"Product Codes" field.

First, we add the "Products" Table from the "Show Table" window.

Then, we click and drag the "Product Code" field from the "Father table", "Products", to the "Son Table", "Orders". By default, we will see that the relationship line has no symbol (after selecting "Create"). This means that the Relationship is Many to Many.

This is due to the fact that we haven't selected the Referential Integrity slot. In other words, there could be "Orders" with many codes of "Products" and many "Products" with several "Orders".. This is obviously a mistake. Even if a Product can be ordered several times, a single order makes reference to a single product. Not doing this would lead to mistakes at the time of making our invoices since we wouldn't know which Product we are talking about.

If we click on the "Enforce Referential Integrity" slot, we will notice how the Relationship changes to One to Many.