Getting Started Guide
c) Enter Cash in the third row. The PaymentID changes to 2.
2) Save and close the table window.
Tip
You can also use the Enter key to move from entry field to entry
field, or use the down arrow key to move from row to row.
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 all at one time
each day. Most of these expenses are in the Vacations table, but the
fuel we buy is not. So, we will relate 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 Vacations table also contains several fields for the type of payment
used. For each field listing the payment type, there is only one entry
from the Payment Type table. This is a one to one relationship: one
field in one table to one entry from the other table. (It is designated
1:1.) Other tables also contain fields for the type of payment. The
relationship between the fields of those tables and the Payment Type
table are also 1:1.
Since the Payment Type table only provides a static list, we will not be
defining a relationship between the Payment Type table and the fields
of the other tables which use the entries of the Payment Type table.
That will be done when the forms are created.
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 need to also determine
where tables are related and how.
1) To begin defining relationships, choose Tools > Relationships.
The Automobile – OpenOffice.org 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:
264 Getting Started with OpenOffice.org 3.x
Free eBook Edition