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

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.

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.

thats great guys, many thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.