User Name Password Register
DaniWeb IT Discussion Community
All
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 402,652 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 2,149 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: Programming Forums
Views: 828 | Replies: 3 | Solved
Reply
Join Date: Apr 2008
Posts: 8
Reputation: jinx_uk_98 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jinx_uk_98 jinx_uk_98 is offline Offline
Newbie Poster

expandable tables?

  #1  
Apr 30th, 2008
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2008
Posts: 9
Reputation: bcasp is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 2
bcasp bcasp is offline Offline
Newbie Poster

Re: expandable tables?

  #2  
Apr 30th, 2008
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.
Reply With Quote  
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 174
Reputation: trudge is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 20
trudge trudge is offline Offline
Junior Poster

Re: expandable tables?

  #3  
May 1st, 2008
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!"
Reply With Quote  
Join Date: Apr 2008
Posts: 8
Reputation: jinx_uk_98 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jinx_uk_98 jinx_uk_98 is offline Offline
Newbie Poster

Re: expandable tables?

  #4  
May 8th, 2008
thats great guys, many thanks
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Database Design Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Database Design Forum

All times are GMT -4. The time now is 3:16 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC