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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:19:35+00:00 2026-05-14T19:19:35+00:00

So, I’ve been reading up on identifying vs. non-identifying relationships in my database design,

  • 0

So, I’ve been reading up on identifying vs. non-identifying relationships in my database design, and a number of the answers on SO seem contradicting to me. Here are the two questions I am looking at:

  1. What’s the Difference Between Identifying and Non-Identifying Relationships
  2. Trouble Deciding on Identifying or Non-Identifying Relationship

Looking at the top answers from each question, I appear to get two different ideas of what an identifying relationship is.

The first question’s response says that an identifying relationship "describes a situation in which the existence of a row in the child table depends on a row in the parent table." An example of this that is given is, "An author can write many books (1-to-n relationship), but a book cannot exist without an author." That makes sense to me.

However, when I read the response to question two, I get confused as it says, "if a child identifies its parent, it is an identifying relationship." The answer then goes on to give examples such as Social Security Number (is identifying of a Person), but an address is not (because many people can live at an address). To me, this sounds more like a case of the decision between primary key and non-primary key.

My own gut feeling (and additional research on other sites) points to the first question and its response being correct. However, I wanted to verify before I continued forward as I don’t want to learn something wrong as I am working to understand database design.

  • 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-14T19:19:36+00:00Added an answer on May 14, 2026 at 7:19 pm

    The technical definition of an identifying relationship is that a child’s foreign key is part of its primary key.

    CREATE TABLE AuthoredBook (
      author_id INT NOT NULL,
      book_id INT NOT NULL,
      PRIMARY KEY (author_id, book_id),
      FOREIGN KEY (author_id) REFERENCES Authors(author_id),
      FOREIGN KEY (book_id) REFERENCES Books(book_id)
    );
    

    See? book_id is a foreign key, but it’s also one of the columns in the primary key. So this table has an identifying relationship with the referenced table Books. Likewise it has an identifying relationship with Authors.

    A comment on a YouTube video has an identifying relationship with the respective video. The video_id should be part of the primary key of the Comments table.

    CREATE TABLE Comments (
      video_id INT NOT NULL,
      user_id INT NOT NULL,
      comment_dt DATETIME NOT NULL,
      PRIMARY KEY (video_id, user_id, comment_dt),
      FOREIGN KEY (video_id) REFERENCES Videos(video_id),
      FOREIGN KEY (user_id) REFERENCES Users(user_id)
    );
    

    It may be hard to understand this because it’s such common practice these days to use only a serial surrogate key instead of a compound primary key:

    CREATE TABLE Comments (
      comment_id SERIAL PRIMARY KEY,
      video_id INT NOT NULL,
      user_id INT NOT NULL,
      comment_dt DATETIME NOT NULL,
      FOREIGN KEY (video_id) REFERENCES Videos(video_id),
      FOREIGN KEY (user_id) REFERENCES Users(user_id)
    );
    

    This can obscure cases where the tables have an identifying relationship.

    I would not consider SSN to represent an identifying relationship. Some people exist but do not have an SSN. Other people may file to get a new SSN. So the SSN is really just an attribute, not part of the person’s primary key.


    Re comment from @Niels:

    So if we use a surrogate key instead of a compound primary key, there is no notable difference between use identifying or non-identifying relationship ?

    I suppose so. I hesitate to say yes, because we haven’t changed the logical relationship between the tables by using a surrogate key. That is, you still can’t make a Comment without referencing an existing Video. But that just means video_id must be NOT NULL. And the logical aspect is, to me, really the point about identifying relationships.

    But there’s a physical aspect of identifying relationships as well. And that’s the fact that the foreign key column is part of the primary key (the primary key is not necessarily a composite key, it could be a single column which is both the primary key of Comments as well as the foreign key to the Videos table, but that would mean you can store only one comment per video).

    Identifying relationships seem to be important only for the sake of entity-relationship diagramming, and this comes up in GUI data modeling tools.

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

Sidebar

Related Questions

No related questions found

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.