Solved

Help with table design?

Posted on 2009-07-10
2
216 Views
Last Modified: 2012-05-07
hi,

Can you take a look at my tables and see if I have correct PK & FK between tables.

MembersTable(userid,lname,fname,phone,office,createddate,createdby,modifieddate,modifiedby)
ProjectsTable(pid,pname,pstatus,startdate,enddate,customer,assigner,assignee,createddate,createdby,modifieddate,modifiedby)
TasksTable(tid,pid,taskname,parenttaskid,tdetail,tstatus,ttype,startdate,enddate,customer,assigner,assignee,createddate,createdby,modifieddate,modifiedby)
TaskTypesTable(ttid,taskType)
task might have a project. project will have at least one task.
userid will be used in assigner, assignee,createdby,modifiedby
Do I make assigner, assignee, createdby,and modifiedby as FK in ProjectsTable & TasksTable?

Thanks.
0
Comment
Question by:dkim18
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 31

Accepted Solution

by:
RiteshShah earned 300 total points
ID: 24828582
well, it is good to have FK for UserID so that even by mistake nothing could be entered in child table which is not exists in parent table.
0
 
LVL 60

Assisted Solution

by:chapmandew
chapmandew earned 200 total points
ID: 24830361
You'll want foreign keys for:

Members.UserID to Projects and Tasks (can't tell what fields...they should be named the same)
Tasks

Pretty much any type of lookup table you'll want to create a foreign key for integrity purposes.  You might also want to cosinder being a little more descriptive on your field names....for example, you could potentially create a FK from your members table to your modifiedby, createdby, customer, assigner fields, etc.  You know what I mean?
0

Featured Post

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question