Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old November 14th, 2003, 06:00 PM
lg lg is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 14 lg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 55 m 43 sec
Reputation Power: 0
The best way top design a database

Hi,

I must design a database with 2 tables. One is a Company table where I have cie name, address and so on. The second one is a Category table. Each company must be classified in at least one category.

What's the best way to do this? Is it better to have a field in my Company table where I will store Category ID (remember I can have more than one category) or is it better to create an intermediate table where I will have a record for each couple Company-Category ?

Thanks for your help.

Reply With Quote
  #2  
Old November 14th, 2003, 07:20 PM
prycejones prycejones is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 87 prycejones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 44 sec
Reputation Power: 2
Send a message via ICQ to prycejones
RE: The best way top design a database

Hello lg,

I agree with the option of having another table with companies and catagories.

There may be a time in the future that a company can have many categories so if you limit this in your company table you will have to do a re-write if you dont have enough space on the company table.

Company table: companyID, name, other details, etc

Categories table: catID, name, other details, etc

CompCat table: companyID, catID

Use the categories table to validate any new company records and then simpy add any new CompCat records when you like.

HIH

Good Luck


Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > The best way top design a database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway