Home Forums Database Design Relational Theory Defining keys as sets that must not intersect instead of scalar values that must not be equal RE: Defining keys as sets that must not intersect instead of scalar values that must not be equal

  • TomThomson - Tuesday, December 19, 2017 9:54 AM

    TomThomson - Tuesday, December 19, 2017 9:49 AM

    assuming you can identify each individual "thing" whose multiple versions can't overlap in time [...].So the problem you claim to have for avoiding overlapping intervals is imaginary.

    Your initial assumption begs the question. The whole point of my claim is that the interval is part of what identifies the thing.

    You said: "It doesn't give an example where a count is required to be zero, because in that case an absence of rows won't cause a problem: if there are no relevant rows there are certainly none that overlap" 

    ...which implies a misunderstanding of what I'm suggesting, because that situation cannot possibly occur: if it did then we would have an entity with a key value of the empty set. We cannot have an employment agreement unless the employment agreement spans some interval of time. My claim, very precisely, is that the interval of time, plus the person, functionally determines all other attributes of the employment agreement. Then, by the relational definition of a key, this set of {date, person} tuples is the natural key for the employment agreement.

    If we knew that the granularity only needed to extend to the date level, then this extensional definition would be sufficient. But as you said - repeating what I originally said - this isn't always suitable, because some of these sets need to be intentionally defined. It would be infeasible to extensionally define "instants in time". But whether we define the set intentionally or extensionally doesn't make any difference to the concept, because the concept is still that of a set acting as a key.