Discount schemes apply to customers. A customer benefits from at most 1 discount scheme at any one time. A discount scheme may be registered prior to applying to any customers.
The association between Discount Scheme and Customer is 0..1 - 0..n (a form of "one-to-many").
Implement this association as a USoft relationship with Parent Object = D_SCHEME and Child Object = CUSTOMER. The Role of the relationship could be "APPLIES TO". The Co-Role could be "benefits from". The relationship has a Parent Column D_SCHEME corresponding to a Child Column D_SCHEME.
The D_SCHEME foreign key is not mandatory. If present, its value must correspond to a D_SCHEME primary key value in the parent table.
A customer can place multiple orders. Each order is placed by exactly 1 customer who is actually known to the application. A customer may be registered prior to placing any order.
The association between Customer and Order is 1 - 0:n (a form of "one‑to‑many").
Implement this association as a USoft relationship with Parent Object = CUSTOMER and Child Object = ORDER. The Role of the relationship could be "PLACES". The Co-Role could be "is placed by". The relationship has a Parent Column CUSTOMER corresponding to a Child Column PLACED_BY.
The PLACED_BY foreign key is mandatory. It corresponds to the CUSTOMER primary key in the parent table.
It is possible for a foreign key to be part of the primary key of the child table.
An order, for example order 3449876, can have multiple numbered orderlines identified by line numbers: 1, 2, 3... The association between Order and Orderline is 1 - 1:n (a form of "one‑to‑many").
Implement this association as a USoft relationship with Parent Object = ORDER and Child Object = ORDERLINE. The Role of the relationship could be "HAS". The Co-Role could be "of". The relationship has a Parent Column ORDER corresponding to a Child Column ORDER.
The ORDER foreign key is part of the primary key of the child table. For this reason alone, it must have Mandatory = Yes.
It is possible for a Relationship's key to span multiple key columns. In this case the primary key in the parent table and the foreign key in the child table span the same number of columns.
A tour in the catalogue of a tour operator is identified by a combination of destination and tour type (the SUNTANNER tour to AUSTRALIA). A tour is regularly scheduled on the calendar. The relevant association between Tour and Scheduled Tour is 1 - 0:n (a form of "one‑to‑many").
Implement this association as a USoft relationship with Parent Object = TOUR and Child Object = SCHEDULED_TOUR. The Role of the relationship could be "SCHEDULED AS". The Co-Role could be "occurrrence of". The relationship has a Parent Column DESTINATION corresponding to a Child Column DESTINATION, and a Parent Column TOUR_TYPE corresponding to a Child Column TOUR_TYPE.
The two key columns are mandatory in both tables. The primary key is the combination of DESTINATION and TOUR_TYPE in the TOUR table. The foreign key is the combination of DESTINATION and TOUR_TYPE in the SCHEDULED_TOUR table.
The fact that the primary key in the parent table spans the 2 relationship key columns is typical. The fact that the foreign key in the child table is part of a primary key spanning 3 columns is accidental.
|