If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Database Design for "nested" tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-05-08, 19:54
BARJRD BARJRD is offline
Registered User
 
Join Date: Oct 2008
Posts: 11
Database Design for "nested" tables

I need to design a database with the following requirements:

For each Contract, there can be 1->many Projects
For each Project, there can be 0->many sub-Projects
For each sub-Project, there can be 0->many subsub-Projects
For each subsub-Project, there can be 0->many subsubsub-Projects
For each subsubsub-Project, there can be 0->many subsubsubsub-Projects
....(there can be up to 7 levels of Projects...
For each subsubsubsubsubsubsubsub-Project, there can be 0-many Tasks

I hate to create 7 (identical) Projects tables, especially since there will seldom be more than 3 levels of nesting. However, there will often be data at the lowest level (Task).

Any ideas? I hope this makes sense
Reply With Quote
  #2 (permalink)  
Old 12-05-08, 20:01
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
for your sub-sub-sub-... structure, see this article: Categories and Subcategories
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On