[quoted text, click to view] >> My first thinking is: UPN is natural key and model is at least in 2NF. <<
The table has a single column key which makes any partial key dependency
irrelevant. So you are correct in stating that the table is in 2NF.
However, in this case UPN, rather than being a pure natural key, can be
considered as an intelligent key, at least partially. A minor difference
between an intelligent key & a natural key is that an intelligent key
generally contains overloaded meanings while a natural key contains singular
meaning.
[quoted text, click to view] >> But, date_of_birth is functionally dependent on part of the key (first 7
digits of UPN are telling abaut date_of_birth), sex is functionally
dependent on part of the key (10. digit). <<
Not really; in a relational table ( i.e. a table in 1NF ), all columns have
scalar values. Thus, UPN is as scalar as any other value in your table.
Being an intelligent key does not make the values in the column non-scalar
and thus there is no such thing as "part of the key" as far as the logical
model is concerned. The meaning associated with the format or some part of
the key is user-assigned. So it has no relevance in determining functional
dependencies.
[quoted text, click to view] >> 1. Is this model violating 2NF? <<
As mentioned before, the table has a single column key and so partial key
dependencies are out of question. So 2NF is not violated.
[quoted text, click to view] >> Is it better to CHECK atributes date_of_birth and sex to meet facts in
UPN or is better to CHECK UPN to meet facts stored in date_of_birth and sex?
<<
By definition an intelligent key has a meaning in itself, however in this
case UPN is partly intelligent and partly surrogate -- serial number being
unfamiliar & meaningless. However, the key has some meaning of values of
other attribute(s) embedded in it, it has to rely on such attribute values.
Thus, ignoring the serial number part, the value of the UPN follows the
value of date_of_birth and gender and not vice-versa.
So, it is more sensible to enforce a CHECK constraint on UPN to match the
desired values of the attributes date_of_birth and sex.
--
Anith