Closed GeoffreyBoom closed 10 years ago
I agree with this, but since m_id is a primary key you can't have:
m_id | type | mitem_id |
1 | wines | 1 |
1 | wines | 18 |
1 | main | 35 |
1 | deserts | 52 |
1 | entree | 69 |
2 | kids | 86 |
2 | wines | 13 |
2 | main | 30 |
... | ... | ... |
Even if when you think about it, one menu has many items of different category.
@GeoffreyBoom do you see a way to associate one menu with multiple menu items while still be able to reference one single menu.
update: I think I forgot the table hasMenuItem
which actually associates 1 menu with many items.
But then what's the purpose of menu, it's definitely redundant.
select menu.m_id, menu_item.name, ingredients.sku, supplies.name
from menu, menu_item, ingredients, supplies
where ingredients.sku = supplies.sku and
menu.mitem_id = menu_item.mitem_id and
menu_item.mitem_id = ingredients.mitem_id and
menu_item.name = "baked-ziti-i" and -- does it for one particular menu item
menu.m_id = 31 -- does it for one particular menu
order by menu.m_id;
does the trick, no?
it's a horrible mess though.
That gets the menu with the menu_item s and the sku and the ingredients of baked-ziti-i, for an example.
Oh, I think I see what you're asking now. well, that's interesting... yeah, definitely something wrong there.
We'll definitely need to talk about that tomorrow.
makes sense to leave this issue open
Accidentally closed it. The close issue button is too easy to click haha
@GeoffreyBoom true fact
I smell redundancy, they seem to have the same values.