I cannot comment on https://stackoverflow.com/questions/8437957/difference-between-3nf-and-bcnf-in-simple-terms-must-be-able-to-explain-to-an-8, so I have to post my question here. It is about the relations on this table cited as the most favored answer on that thread:

 Pizza    Topping     Topping Type  
 -------- ----------  -------------
 1        mozzarella  cheese
 1        pepperoni   meat
 1        olives      vegetable
 2        mozzarella  cheese
 2        sausage     meat
 2        peppers     vegetable

According to the source of the answer, it is in 3nf. However, I thought there is only one candidate key which is (Pizza,Topping). (Pizza,Topping Type) cannot be a candidate key because a Pizza can have multiple Topping Type values.

A candidate key must be able to identify a distinct tuple, and (Pizza, Topping Type) does not meet this condition. So it seems to me that the above relation is not in 2nf, and therefore not in 3nf. Topping Type only tells something about Topping, but not Pizza. Am I missing something?


1 Answer 1


The example is provided in the answer in the linked question. The author of that answer - and example - states that (Pizza, Topping Type) is a candidate key of the relation - ther's also discussion in the comments below the answer.

So the example has the added restriction that every pizza has not more than one toppings of any type.

This may not be your usual definition of a pizza but with this assumption - even if we assume the common sense dependency that Topping -> Topping Type - the relation is indeed in (2NF and) 3NF.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.