Search:  

Previous pageData Integration Next page
Relationships 

A Relationship is a way of describing how the records in one Table borrow from (or 'relate' to) records in another Table.

Relationships are important because they enable you to benefit from some of the core competencies of computers:

Avoid duplicating information
If you find that when you enter multiple records in a Table you are having to enter exactly the same information in several records, that's usually a sign that the repeating information should be instead stored in a different Table, and a Relationship should be used to connect the two.


Case study

An animal sanctuary needs a list of their animals to help manage their feeding.

Initially a Table is designed with Fields of:

Animal:
Name (Text field)
Type (Text field)
Food (Text field)

A typical record would be:

Name: Fluffy
Type: Cat
Food: Cat Food

Now for the sake of example, we will assume that all cats eat Cat Food, so you can see that for each Cat, we have to type in "Cat Food" in the Food field. This could get quite tedious, so we change the Form:

Animal:
Name (Text field)
Type (Recordlink field)

And since we no-longer have anywhere to enter the Food, we create a new Table:

Type:
Name (Text field)
Food (Text field)

Now, when we add a new Record in the Animal Table, we still get to type in the animal's name, but now we don't have to type in the Type, but can simply choose from a dropdown listbox. That will list out all the animal Types you already entered in the Type Table.

In this example, the Recordlink field has been used to define a relationship between the Animal and the Type Table, and allows us to gain two benefits:
no need to repeatedly enter the same predictable information (originally, whenever you typed Cat, you knew you had to type Cat Food too);
and there's now no need to even type Cat in each time, but choose it from a pick list (ok, "Cat" isn't the hardest one to type, but what if you had a herd of rhinoceroses)

Furthermore, if the dietician decides that cats should now be fed mice instead of catfood, there is only one record that needs updating (in the Type Table) rather than having to go through each Animal record looking for all the records for Cats.


In the case study we used a Recordlink to define the relationship between one record in the first Table, and one record in the second Table. However sometimes we need to relate one record in the first Table to several records in the second Table. For this, we use a Multi Recordlink.
 

Managing data