SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 single table or two tables?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ahmeds08
Aged Yak Warrior

India
583 Posts

Posted - 07/16/2014 :  03:46:30  Show Profile  Send ahmeds08 a Yahoo! Message  Reply with Quote
Hi,
I have a table which stores the details of a project,its fine till here.
Now we have intorduced the concept of child projects,i.e each project can have multiple child projects.
So,whats the best way to go.
1.single table with parent and child projects or
2.seperate table for projects and child projects,where child project table will have link to main projects table with project_id as fkey.

Thanks,
Javeed.

Javeed Ahmed

James K
Flowing Fount of Yak Knowledge

3573 Posts

Posted - 07/16/2014 :  06:31:05  Show Profile  Reply with Quote
Either one, depending on what you feel comfortable with and depending on the nature of the data would work.

If both parent and child projects have exactly similar (or almost similar) characteristics, I would tend towards using a single table with an additional column for parent project id.

If you were to use two tables, you would need to have two similar tables with same columns. Also, some day, if you decide that you want to have more levels - i.e., grand children - using one table would make it easier.
Go to Top of Page

ahmeds08
Aged Yak Warrior

India
583 Posts

Posted - 07/16/2014 :  07:51:19  Show Profile  Send ahmeds08 a Yahoo! Message  Reply with Quote
Thanks James

Javeed Ahmed
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000