Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesDatabase Management

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 Dev Shed Forums Sponsor:
  #1  
Old October 31st, 2002, 10:32 AM
MrFerrari MrFerrari is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 2 MrFerrari User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Database Design Problems

Hey, I'll *try* to explain the problem im having...I need to know how to set up some tables.
I have a table called "projects" and each project has "requirements". I want there to be up to 4 levels (categories as I named the table) of requirements. BUT a requirement does not have to have a category, and a category obviously does not have to have a requirement. Also, how do I show the parent relationships?

For example how do I show that if category one, has category two below it, AND has a requirement below it? The Idea's i've had and I don't think are right, is having a "parent" table, which falls apart when you have a category, or requirement, with no parent (other than the project itself). Having just a category table, and having category 1, cagegory 2, category 3, and category 4 rows in my requirements table, which once again falls apart because it has no way of showing parent relationships for the categories *sigh*. I'm sure I should know this but my brain doesn't want to work right now. I hope that explains it somewhat. If not, feel free to e-mail me @ URL and I'll even send you the database hah.

Any help would be greatly appreciated!!
Thank you.

Pat

Reply With Quote
  #2  
Old October 31st, 2002, 10:43 AM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,817 jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 4 Days 7 h 14 m 56 sec
Reputation Power: 1098
There are several threads involving this category / sub category issue that show several different methods of doing it. Search and see if you can find one. I would probably do it something like this. (and this is only one way)

table.projects
ID name
1 My Project

table.categories
ID parent category
1 0 label1
2 1 label2
3 0 label3

(label2 is a subcategory of label1)

table.requirements
ID project_ID category_ID requirement
1 1 2 Make it work right

(requirement is My Project and falls in the label2 category)
__________________
# Jeremy

Explain your problem instead of asking how to do what you decided was the solution.

Reply With Quote
  #3  
Old October 31st, 2002, 10:50 AM
MrFerrari MrFerrari is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 2 MrFerrari User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks!

Wow, thanks for the quick reply. I was getting confused for some reason about the category's parent. This head cold's gettin to me.

Thanks again

Pat

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Database Design Problems

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap