Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2003
    Posts
    2

    Circular Reference?

    Hi,

    I'm just curious about a particular design issue. I'll just talk about the 3 tables involved. The three tables are tblUsers, tblContent, and tblLogs.

    Here's what I want to do:

    1) tblUsers is related to tblContent because any content created should have a user associated with it (ie. author of the content)

    2) tblLogs is related to tblUsers because I want to log any activity performed by any particular user

    3) tblLogs is related to tblContent because I want to log any activity performed on any content by a particular user

    Is this an example of a circular reference? Do I need to be concerned about this situation? If so, how do I fix it??

    Thanks in advance

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171

    Re: Circular Reference?

    It sounds like it will be OK, because the users have different roles in the relationships - the user who is the author of the content vs. the user who performed some other logged activity on the content.

    As an aside, don't you think Users, Content and Logs would be better table names than tblUsers, tblContent and tblLogs? The "tbl" prefix does nothing useful, but makes the SQL harder to follow - IMHO

  3. #3
    Join Date
    Mar 2003
    Posts
    2

    Wink

    Thanks for your prompt reply!

    The only reason I'm using 'tbl' is because a client wants me to follow their naming standards. I'm all for getting rid of the prefix.

  4. #4
    Join Date
    Apr 2003
    Location
    Nanjing, China
    Posts
    5
    I prefer to divide tblLogs into two tables, one for user activities unrelated to content such as login and logout, the other for user activities performed on content.

    Following is my solution:

    tblUsers (UserID PK, Name, ...);
    tblContent (ContentID PK, Author FK, ...);
    tblUserLogs (UserLogID PK, UserID FK, Activity, ...);
    tblContentLogs (ContentLogID PK, UserID FK, ContentID FK, Activity, ...)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •