0

Hi,

I'm creating a web database as a bit of learning project.

In short it's going to a on-line menu viewer, where people can upload (type in) their food/takeaway food menus.

The problem I'm having is with the design and as each outlet can have a differing number of starters/mains/deserts etc..

inital thoughts were:

Menus
------
Menu_id
Menu_outlet
Starter1
Starter2
Starter3
Starter4
etc...

but what if an outlet has more that 4 starters?

Can anyone point me in the right direction please?

thanks jinx

3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by jinx_uk_98
0

Do some research on normalization.

You might want to consider a simple setup where you have three tables.

Menu
MenuID (Primary Key)
MenuOutlet

Starter
StarterID (Primary Key)
StarterDescription

MenuStarter
MenuID (Primary Key - 1)
StarterID (Primary Key - 2)

This setup allows you to have as many starters as you want for each menu. The MenuStarter table would just use a concatenated primary key that could link those two tables. Hope this makes sense...

Again, some research on normalization would probably help.

0

bcasp is pointing you in the right direction. As a further enlightenment, any time you ask yourself the question 'what if column X has more than Y choices' is an indication that that column should be broken out into a separate table.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.