•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Database Design section within the Web Development category of DaniWeb, a massive community of 331,673 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,067 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Database Design advertiser:
Views: 344 | Replies: 3 | Solved
![]() |
•
•
Join Date: Apr 2008
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 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
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
•
•
Join Date: Apr 2008
Posts: 9
Reputation:
Rep Power: 0
Solved Threads: 2
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.
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.
•
•
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 172
Reputation:
Rep Power: 1
Solved Threads: 20
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.
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
"Others make web sites. We make web sites work!"
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Marketplace (Sponsored Links)
Similar Threads
- headers and expandable columns in php (PHP)
- Custom Ecommerce (eCommerce)
- Collapsible table sorting problem (JavaScript / DHTML / AJAX)
- javascript works in IE but not working in firefox (JavaScript / DHTML / AJAX)
- can anyone make this tree table sort correctly? (JavaScript / DHTML / AJAX)
- Overfloat? IE6/win? (HTML and CSS)
- IE6 minwidth/img issue (HTML and CSS)
- To go graphical, or not ? (Site Layout and Usability)
Other Threads in the Database Design Forum
- Previous Thread: Help with simple database design!!
- Next Thread: Help, I'm Drowning


Linear Mode