Re: Complex RDB Tables

From: Bien LX <lexuanbien_at_ozemail.com.au>
Date: Fri, 22 Mar 2002 20:22:05 +1100
Message-ID: <GICm8.196$Go6.13936_at_ozemail.com.au>


Hi objectman

This is quite fundamental in relational design. It's called a many-to-many relationship. To be specific, a certain WorkOrder includes many Parts, vice versa, certain part appears in many WorkOrder.

Specifically, this relationship has to be "normalized" into 2 one-to-many relationship using Codd's normalization method. After being normalized, the mentioned relation will become 3 relations. BTW, relation is the way relational theory calls table.

  1. WorkOrder (WorkOrderID, WorkOrderName, WorkOrderDueDate, WorkOrderStaff,...)
  2. Part (PartID, PartName, PartCost, PartSupplierID, ...)

and

3. WorkOrder_Part (WorkOrderID, PartID)

The primary key in (1) is WorkOrderID, (2) is PartID, and in (3) is WorkOrderID and PartID (a compound key)

Now tell me the reason why you're going back to relational :-)

Bien



"objectman" <kcintron_at_elp.rr.com> wrote in message news:Fm3m8.38055$Dv6.1593053_at_typhoon.austin.rr.com...
> I'm a newbie to complex relational DB modeling.
>
> What I'm attempting to do is.
>
> WorkOrder
> parts used (1+)
> accessories used (1+)
>
> In other works the WorkOrder has n+ parts and accessories that are used.
> In an OODB I would solve this using aggregation. What is the solution
> in the relational world. Thanks in advance.
>
>
> --
> Kevin J Citron
> Sr. Object Imagineer
> Optimized Objects
> (915) 276-5828
> (915) 566-2403
>
>
Received on Fri Mar 22 2002 - 10:22:05 CET

Original text of this message