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 147141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:43:45+00:00 2026-05-11T08:43:45+00:00

Lets say you have the following entities in your database: Image http://lh6.ggpht.com/_UpGtM3B8h1U/Sa7SqfWmgDI/AAAAAAAAAHE/epqtm7EnoFg/test.gif You want

  • 0

Lets say you have the following entities in your database:

Image http://lh6.ggpht.com/_UpGtM3B8h1U/Sa7SqfWmgDI/AAAAAAAAAHE/epqtm7EnoFg/test.gif

You want to be able to add a note to all three of the other entity tables (User, Client and Project). How would you set this up?

  1. Add a tableName and a FKId to the Note table?
  2. Create a separate table for each associated Note group (ie., ClientNote, UserNote)
  3. Create a separate field in Note for each Foreign key (UserId, ClientId, etc)

I seem to be going back and forth between option 2 and 3, although I’d be up for 1 if there were an elegant implementation. Option 2 is attractive because there are no nulls. Option 3 is attractive because a note feels like a note no matter what it is associated with.

Any thoughts?

  • 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. 2026-05-11T08:43:46+00:00Added an answer on May 11, 2026 at 8:43 am

    I would typically go with option 2. I don’t stress about the number of tables in a database within reason.

    The big question is, are these notes going to be handled as a single item? For example, are you going to ever say, ‘Show me all notes, regardless of whether it’s for a client or user or project.’ I can’t think of any situations where that would be useful. You’re going to typically say, ‘Show me THIS CLIENT’S notes’ or ‘Show me THIS PROJECT’S notes.’

    Since they are not logically one item I suggest not trying to model them physically as one item.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 66k
  • Answers 66k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer From the PIL docs: getpixel im.getpixel(xy) => value or tuple… May 11, 2026 at 11:35 am
  • added an answer Use GROUP BY: select value, count(*) from table group by… May 11, 2026 at 11:35 am
  • added an answer Based on your edit, I think you're looking for this:… May 11, 2026 at 11:35 am

Related Questions

Let's say you have the following chunk of code: <div id=container> <someelement>This is any
Let's say you have a class called Customer, which contains the following fields: UserName
Let's say you have a domain entity User and you want to support the
Let's say you are a GM dba and you have to design around the
Let's say you have two tables, Users and UserRoles. Here's how the two tables
Lets say you have interface definition. That interface can be Operation . Then you
Using Rails v2.1, lets say you have an action for a controller that is
When creating a web application, and lets say you have a User object denoting
Lets say that you have websites www.xyz.com and www.abc.com. Lets say that a user
How do you split a string? Lets say i have a string dog, cat,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.