108 reputation
17
bio website
location
age
visits member for 1 year, 10 months
seen Sep 16 at 16:18

Sep
16
awarded  Citizen Patrol
May
2
comment How to model a 1..1 Composition Relationship
Thanks. You revived a rather old-ish thread but reviewing it this looks like the most accurate way to tackle this problem.
May
2
awarded  Scholar
May
2
accepted How to model a 1..1 Composition Relationship
May
1
awarded  Student
Jan
20
awarded  Notable Question
Jul
1
awarded  Popular Question
Dec
25
awarded  Tumbleweed
Dec
18
revised Oracle XE TNS Listener fails to start
added 482 characters in body
Dec
18
asked Oracle XE TNS Listener fails to start
Nov
20
comment How to model a 1..1 Composition Relationship
It is a 1:1 relationship, or more precisely a 0..1 : 1 relationship: Every Event owns exactly one time point, and each record from the other table owns exactly one time point. So a time point is always owned either by one event or by a record from the other table.
Nov
16
comment How to model a 1..1 Composition Relationship
@ypercube: I have removed the confusing part. It is not relevant to the question. The updated "update" section explains the main point for having two entities: TimePoint can be owned by a record from a different table instead.
Nov
16
revised How to model a 1..1 Composition Relationship
deleted 250 characters in body
Nov
16
comment How to model a 1..1 Composition Relationship
@ypercube: I need to use a separate identifier for the TimePoint because it can be referenced from different tables (see my update)
Nov
16
comment How to model a 1..1 Composition Relationship
@Joel: I think the confusion is because ypercube has suggested to use the PRIMARY key as a foreign key at the same time. That restricts on what you can point to.
Nov
16
awarded  Supporter
Nov
16
comment How to model a 1..1 Composition Relationship
As for the On-the-Other-Hand part: The Event only points to the first occurrence of the TimePoint. The time point can be either a single occurrence or reflect a recurrence. Maybe it would be interesting to discuss the general model of this, but I'd rather keep this out of this thread - it is really just one instance for an issue that we have in multiple places.
Nov
16
comment How to model a 1..1 Composition Relationship
"Each record in table A can have only one record in table B, and that record must be the same as in table A." - can you rephrase that? Am not sure how a record from table A can be the same as in table B
Nov
16
awarded  Editor
Nov
16
comment How to model a 1..1 Composition Relationship
Thank you. I have elaborated a bit on why we have two entities in this case. I think in the essence you're suggesting to have 2 foreign keys but make them deferred. I was thinking about this, too. Is this a common practice or do some DBAs consider it a bad design?