Jump to content

design issue


freebsdntu

Recommended Posts

Hi guys, I am designing a database schema for project, where ptitle,pobjective,etc are the attributes.

A project might have series of sub-project, and this sub-project might have its own sub-projects, and it goes on like this. If I want to easily list the hierachy of all the projects, what should be the shema look like?

Ok, the shcema I am thinking of now is like this:

I inlclude a super-project id field, where it is set to 0 if the project does not have any super project, and it is set to the project id of its direct parent project if it is a sub-project of some project. The problem with this design is I don't know how to list the hierachy.

Any hints on the schema? Thank you very much!

Link to comment
Share on other sites

Check out the sticky on normalization and the dev article inside on storing hierarchal data.

Thank you for your reply,fenway,I have browsed through some articles on storing hierarchical data, it is too much complicated, when applied to my case, i mean. So is there any other approach? Maybe I should have asked whether would my design work.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.