I have the following tables:
Each ProductLine
will encompass many Part
s. For this reason, it initially seemed to me that the Part
table is a child of the ProductLine
table. However, a part is not simply an extension of a product line, and when I asked myself if it is possible to a part to exist without a product line, the answer seems to be yes.
So I'm wondering if the above design appears to be correct or if there is a better design. In the Part
table, PartBase
can be thought of as the unique identifier for each part (the part number if you will.)
As a somewhat unrelated question, I have these tables set up as a one to many relationship. Since each Part
must belong to a ProductLine
but cannot belong to more than one, is it more correct to have this as a one-and-only-one to many relationship? Is the only difference that a Part
must contain a not null ProductLineNumber
in the actual database? Is that different from requiring that ProductLineNumber
be not null?
To follow up to @HandyD's comment, as a business rule, every part must belong to exactly one product line. However, when I was thinking about a part as a physical object, it shouldn't need a product line to exist (a product line is just a label after all.) I'm comparing here to how a sale needs a customer to make sense, so that a Sale
table would more clearly be the child of a Customer
table. Is this distinction between Part
-ProductLine
and Sale
-Customer
a false one?