Operation Manual

Figure 205: Fields in Vacations table
Defining relationships
Now that the tables have been created, what are the relationships between our tables? This is the
time to define them based upon the questions we asked and answered in the beginning.
When on vacation, we want to enter all of our expenses at once each day. Most of these expenses
are in the Vacations table, but the fuel we buy is not. So we will link these two tables using the
Date fields. Since the Fuel table may have more than one entry per date, this relationship between
the Vacations and Fuel tables is one to many (it is designated 1:n.)
The Fuel and Maintenance tables do not really have a relationship even though they share similar
fields: Date and Odometer.
Tip
As you create your own databases, you will also need to determine where tables are
related and how.
1) To begin defining relationships, choose Tools > Relationships. The Automobile –
LibreOffice Base: Relation Design window opens and the Add Tables dialog pops up. (You
can also open it by clicking the Add Tables icon on the Relation Design window.)
2) On the Add Tables dialog, use either of these ways to add a table to the Relation Design
window:
Double-click the name of the table. In our case, do this for both Vacations and Fuel.
Or, click the name of the table and then click Add for each table.
3) Click Close to close the Add Tables dialog when you have added the tables you want.
Chapter 8 Getting Started with Base | 225