A2.3 MEALS Database Normalization |
||||||||||||||||||||||||||||||||||||
|
The Seasoned Steak 'n Side is a restaurant started by a chef sommelier. Her minimalist menu began with a small selection of specially designed dinners, each of which included a specially seasoned main course, a specially seasoned side dish and just the right wine. The menu is a BCNF relation, with a composite primary key consisting of all three columns together. Notice that even though the table is in BCNF, there are still redundancies. Columns: 3, Rows: 8
Both the side dish and the wine were dependent on the main dish. Because of special seasonings, the salmon could not be served with the baked potato and the beef steak could not be served with white rice. The chief chef sommelier was a real stickler on this. Also, fish (e.g., Salmon) must be served with a white wine (e.g., Pinot Grigio, Chardonnay) and beef with a red (Cabernet Sauvignon, Pinot Noir). No exceptions. Notice the relation contains multi-valued dependencies (MVDs). The main dish (salmon or beef) determines the possible side dishes and the wines, hence they are dependent. However, a main dish doesn't just determine a single side dish, but only that it is one of a multi-valued set. Salmon steak will only be served with mashed potatoes or white rice, not with a baked potato. Beef steak will only be served with either a baked potato or mashed potatoes, but not white rice. (If these were regular single valued dependencies, Salmon steak could determine either the side dish as either mashed potatoes or white rice, but it couldn't be more than one.) The relation is in BCNF but not 4NF when we remember that:
Assignment:
When you are through, confirm you created your database correctly using the autograder. |