Solved

Help with table design?

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

831 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