Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 875261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:14:22+00:00 2026-05-15T11:14:22+00:00

This is more or less a best-practice question: I’m working on a site that

  • 0

This is more or less a best-practice question:

I’m working on a site that requires me to relate some tables to several different tables.
For instance, I have a Comments-table, that I would like to relate in a way such as one might comment on entities in Table A, but also in Table B separately.

Similarly, I have a rating-table that I would like to do the same with, so that one could rate different aspects in the site.

I’ve touched upon one method that implies having a loose relation with a Relationships-table with a PrimaryKey(Guid) and ForeignKey(Guid), and then using Guids as Primary key in both the Comments-table and the Rating-table – However this implies I’m gonna need Guid as primary key in the other tables as well.

Anyone have any great ideas here? Greatly appreciated 🙂

PS. If it’s interesting, I’m creating an ASP.NET MVC2 app with an ORM (either EF, Linq2Sql or NHibernate.. doesn’t really matter :))

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:14:22+00:00Added an answer on May 15, 2026 at 11:14 am

    You could use a single comments/ratings table, but use a separate table for each related entity to maintian the comment to entity relationship. If you had Posts and Pages, each with comments, it would look something like this:

    Comments
     - CommentID
     - CommentText
    
    Posts
     - PostID
     - Other fields
    
    Pages
     - PageID
     - Other fields
    
    PostComments
     - PostID
     - CommentID
    
    PageComments
     - PageID
     - CommentID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is more of a design question. I am working on a website and
I'm more or less Java programmer, so this might be a stupid question, but
This might be a very simple question, but more or less, I'm asking to
So this is more or less an implementation question, this is the senario I
I'm looking for some best practice advice here. I have a library that I'd
I use C# code more-or-less like this to serialize an object to XML: XmlSerializer
This more of a style question, rather than a how to. So I've got
Ok, I'm going to try to make this more clear because my last question
This is more of a specific question on a specific case. Here is what
This is more of an academic inquiry than a practical question. Are there any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.