Making (3) composite primary key less redundant

65 Views Asked by At

I have a table with a composite key (3) like this:

sub_product
 - product_id (PK FK)
 - product_type (PK FK)
 - size_id (PK FK)
 - quantity

quantity is dependent on all 3 keys.

Is reducing this to only 2 composite keys normalization?

Like this:

sub_product
 - id
 - product_id
 - product_type

inventory
 - sub_product_id (PK FK)
 - size_id (PK FK)
 - quantity

As soon as I add a column (like picture_id) that only depends on product_id and product_type normalization is mandatory. (Assume I would never add a picture_id column.)

Is doing this considered mandatory for normalization or is it rather up to personal preference and use case?

1

There are 1 best solutions below

1
Bill Karwin On

It is not considered normalization. Normalization never calls for spurious pseudokeys.