- Local time
- Tomorrow, 00:30
- Joined
- Jan 20, 2009
- Messages
- 12,895
Surely you realise that this can be done with any two tables. Even a table with NO Keys.
It appears my description was not clear. A typical example using a composite key will illustrate the point.
Take a table with fields including, say, EmployeeID and WorkDate. These two fields can form a composite key because in our data model there is only one record for each employee per day.
A one-to-many related table containing further information about the employee activities on that day will contain both these fields as the composite foreigh key. This table can be independently queried to return aggregates by EmployeeID and/or WorkDate.
The alternative structure with a synthetic autonumber field as the key still needs the composite index to ensure data integrity is maintained with a single record for each EmployeeID/WorkDay, plus it requires the autonumber with its own separate indexing.
More importantly the related table contains only the autonumber field to indicate the associated record in the first table. Any query requiring information about either the EmployeeID or the WorkDate can only be determined with a join on the autonumber field.