4/5/2024 0 Comments Functional dependency 3nfSo we have two overlapping candidate keys. So (Pizza, Topping) must be unique and therefore is also a candidate key. We also know intuitively that a given topping cannot belong to different types simultaneously. So in any table that has only one candidate key and is in 3NF, it is already in BCNF because there is no column (either key or non-key) that is functionally dependent on anything besides that key.īecause each pizza must have exactly one of each topping type, we know that (Pizza, Topping Type) is a candidate key. The reason is that the functional dependency X -> Y is of course true if Y is a subset of X. Here is the more technical version.īCNF acts differently from 3NF only when there are multiple overlapping candidate keys. That was the explanation that an 8 year-old might understand. We should use a separate table for this, so we write down that fact in only one place. We need to prevent these sorts of mistakes, to make mozzarella always be cheese. Wait a second, mozzarella can't be both a cheese and a meat! And sausage isn't a cheese! So we order two pizzas and choose the following toppings: Pizza Topping Topping Type Your pizza can have exactly three topping types:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |