Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Logical - Physical Design Transition Problem

Re: Logical - Physical Design Transition Problem

From: Gerard H. Pille <ghp_at_skynet.be>
Date: Wed, 19 May 1999 22:06:37 +0200
Message-ID: <7hv5t2$geq$1@news0.skynet.be>


If both Orders and Warehouses have the customer-code as the first part of their primary key, you could have one column customer-code in the Shipments, that is used for both foreign keys, one to Orders and one to Warehouses.

I know it's ugly, but it would do what you want.

Gerard

Matt Randle heeft geschreven in bericht <927116339.11503.0.nnrp-02.d4e48d0d_at_news.demon.co.uk>...
>Hello,
>
>I am running into problems trying to create integrity constraints to model
>the following problem. I think I am missing some fundamental RDB principle
>but can't see what it is!! Has anyone any ideas ??
>
>In the Logical model we have identified four Entities - Customer,
Warehouse,
>Order and Shipment. They are related as follows,
>
>Customer has many Warehouses
>Warehouse belongs to one Customer
>
>Customer has many Orders
>Order is for one Customer
>
>Order has many Shipments
>Shipment is for one Order
>
>Shipment is sent to one Warehouse
>Warehouse receives goods from many Shipments
>
>At first glance it seems easy as most of the referential integrity
>constraints are basic one to many.
>
>However, the rule I cannot enforce is that Shipments must be sent to a
>Warehouse owned by the Customer that placed the Order. For example, the
.db
>should not let you create a shipment record for Order A & Warehouse B if
>Warehouse B is not owned by the Customer placing Order A.
>
>Matt.
>
>
Received on Wed May 19 1999 - 15:06:37 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US