Question

Suppose we have relation like (employee, address, phone) - or, something like this - (userid, login_name, password) for example - with first field being the key.

It feels like it is not "normalized" since we can split it in two (employee, address) and (employee, phone) - especially good if some employee do not have a phone (or have two).

As I understand it does not violate 2NF and complies with 1NF requirements (at least until we try insert null for phone) - but I could not show how it violates 3NF.

So the question is - whether such relation complies with 3rd normal form or not. Or does it violate some other I did not think about?

Was it helpful?

Solution

At last I understand that the problem is in messing two different kind of relations in this question:

  • if we decide that one employee could have only one phone, than employee is a candidate key and the relation satisfies requirements of 2nd and 3rd normal forms;

  • but if the employee could have several phones, then employee is no more a key - instead the tuple (employee, phone) becomes a candidate key - and if so, 2nd normal form is violated because address depends only on the part of the candidate key - employee field.

I'm sorry for involuntarily bewildering whoever reads the question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top