Database Reference
In-Depth Information
been billed. And you can use a “Go To Related Record” command to navigate between ex-
penses and line items.
Figure 14-6. Right now, your Relationships graph still looks a lot like your ER diagram (page 182).
The only relationship between an expense (which you need to be reimbursed for) and a line item
(which allows for reimbursement) is through the Jobs table and then to the Invoices table.
Your new relationship will be one-to-one. In other words, one Expense Line Item is related
to one, and only one, Invoice Line Item. One-to-one relationships are fairly rare birds. This
new one-to-one relationship—Expenses to Line Items—is purely about how your database
functions. It exists for one purpose only: to give your database a convenient way to record
which Line Item an Expense has been billed on. To create this new relationship and make it
work properly, you need three things:
▪ A new primary key ( Primary and Foreign Keys ) to hook the two tables together.
▪ A way to represent the new relationship in your Relationships graph without throwing
the whole thing into disarray. That's right—a new table occurrence.
▪ New fields on one of your layouts (the Expenses layout in this case), to show the newly
related data.
The next section covers the entire process.
Deciding Which Table Needs a New Occurrence
When you create a new occurrence of a table, you're giving that table a new meaning in the
relational structure of your database. But when you're thinking about the problem of creating
Search WWH ::




Custom Search