Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 1 foreign key reference PK in multiple tables

Author  Topic 

sarahmfr
Posting Yak Master

214 Posts

Posted - 2011-03-22 : 10:51:47
Assignment table(assignmentid pk,title,etc.,assignmenttype(1=forum,2=journal,etc),refid (id of a forumthread,or id of a journal)

_______________________

forum table(threadid pk,threadtitle,graded y/n,etc.

________________

journal table(journalid,journaltitle,gradedy/n.etc.)

________________

is it ok to use refid as a foriegn key referencing forumid in fourm table if the assignment type is forum

and refid is a foreign key referencing journalid in journal table if assignment type is journal

how this can be accomplised in the best way to improve performance

I thought of doing the following

adding the following two tables journalassign(journalid,assignmentid)

and forumassign(forumid, assignm)

___________________________

but I have similar situations in other tables

example:

lessontools(lessonid + toolid pk, tooltype (1=dropbox,2=,etc.)

dropbox(dropboxid, etc)

___________________

thanks



sarah

X002548
Not Just a Number

15586 Posts

Posted - 2011-03-22 : 13:24:55
When is the assignment due?

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -