A primary key is an attribute or set of attributes that uniquely identifies a row in a table. But a primary key has not only to be unique, but also minimal. Why is that necessary?
The reason why it's important to identify minimal keys is to ensure that there is no redundancy in dependencies on those keys. Redundancy can cause anomalies and incorrect results.
Minimality is essentially a semantic matter rather than purely a structural feature so it isn't necessarily required by the database implementation. For instance SQL allows you to create a "PRIMARY KEY" on any superkey, which may not be an irreducible superkey.
Minimality has nothing to do with storage size because minimal means irreducible, it does not mean smallest.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With