Establishing Relationships

From NeoWiki

Revision as of 00:23, 12 September 2007 by Lorinda (Talk | contribs)
Jump to: navigation, search
This article is part of the To Base and Back Again tutorial series.

Part of the power of Base is that it is a relational Database, allowing you to relate different tables of data. In order to make use of this power, we need establish the relationships between the various tables. In our case, not all the tables need to be related. The tables we "termed" covenience tables in the first article of this series, do not need to be related by an official process, as they will be used primarily for combo boxes and/or list boxes. The essential tables do need to be related to each other.

Types of Relationships

Relationships can be one-to-one or one-to-many. In a one-to-one relationship, one record in one table relates to one and only one record in another table. In a one-to-many relationship, one record in one table relates to more than one record in another table. In our database, the relationship between Field Trips and Sightings is one to many; on any given field trip, the birder would (hopefully!) see many birds. Note that at least one of the fields you are relating must be a primary key field.

Creating the Relationships

  1. With the database open, go to the Tools menu and choose Relationships
  2. In the floating window, click on the Field Trips and then click the Add button. A small window named Field Trips appears in the larger Relation Design window.
  3. repeat with the Sightings
  4. close the floating window
  5. click on the the ID field in the Field Trips sub-window; drag from there to the Field Trips ID field in the Sightings sub-window. A line appears connecting these two fields, with a 1 the Field Trips end and an n next to the Sightings window. This identifies a one-to-many relationship.
  6. click on the hard drive symbol in the toolbar to save the changes you have made, and close the window.
Personal tools