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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:36:15+00:00 2026-06-14T04:36:15+00:00

Assume i have a ticket/question that can have zero or many replies. I can

  • 0

Assume i have a ticket/question that can have zero or many replies.

I can relate ‘reply’ and ‘ticket’ tables in two ways.

First method:

Ticket(**ticket_id**, title, message) //ticket_id: PK
Reply(**reply_id**, reply_message, ticket_id) //reply_id: PK and ticket_id: FK

Second Method:

Ticket(**ticket_id**, title, message) //ticket_id: PK
Reply(**reply_id**, **ticket_id**, reply_message) //reply_id: PK and ticket_id: FK & PK

In my opinion, both of them are correct.

As i see it, the Reply in second method is considered Weak entity because reply is strongly tied to ticket. However, i prefer the first method because its easier to deal with at the programming level; in first method, we only have to handle one PK. Do you agree? Why and Why Not?.

NOTE: ticket and reply are mock-up samples.

  • 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-06-14T04:36:16+00:00Added an answer on June 14, 2026 at 4:36 am

    As i see it, the Reply in second method is considered Weak entity…

    Correct.

    …because reply is strongly tied to ticket.

    Not sure what you mean by that. It is weak because it cannot be identified without attributes migrated from the parent.

    However, i prefer the first method because its easier to deal with at the programming level; in first method, we only have to handle one PK. Do you agree? Why and Why Not?.

    Well, it depends 😉

    The strong entity and non-identifying relationship (your “first method”):

    • May be friendlier to client code, especially if you use ORM.
    • Prevents the parent PK from propagating further down the table hierarchy1, which:
      • Will make child FKs leaner.
      • Will “cut” the ON UPDATE CASCADE and prevent it from propagating further down the table hierarchy.

    The weak entity and identifying relationship (you “second method”):

    • Results in a PK that is a good candidate for a clustering key.2
    • Avoids additional index on FK3, since primary index covers both fields4. Every additional index costs space and performance (when modifying data).
    • Propagates the parent PK down the table hierarchy1, which:
      • May allow you to avoid some JOINs.
      • May be necessary for correctly modeling certain kinds of diamond-shaped dependencies.

    All in all, neither solution is absolutely “better” – it’s a matter of choosing the right balance.


    1 Not (yet) relevant in your case, since you don’t (yet) have any tables that reference Reply.

    2 Many (but not all) DBMSes allow clustering only on the PK. In your case, clustering on {ticket_id, reply_id} (note the order of fields) would store all replies connected to the same ticked physically close together, dramatically reducing I/O for certain kinds of queries.

    3 Which would otherwise be necessary for efficiently enforcing the referential integrity when deleting or modifying rows from Ticket.

    4 Assuming you change the order to {ticket_id, reply_id}.

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

Sidebar

Related Questions

Assume I have two tables, Student Test Id Name TestId Type StudentId -- ----
Assume I have a two tables, A and B. Table A has a primary
Assume you have 3 given tasks. You can run them either using process or
Assume I have two vectors represented by two arrays of type double , each
assume I have two objects article and comment . What I would like to
assume you have a function that polls some kind of queue and blocks for
Assume I have 2 controllers that handle 2 parts of the page - header
Assume I have an Activity which contains two FrameLayouts (let's call them FrameA and
First, I'd like to thank anyone that can get me through this in advance.
Assume you have a structure of commented html, that comes from server (it's commented

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.