Solved

Help with table design?

Posted on 2009-07-10
2
205 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
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now