From Newsgroup: comp.databases.theory
On 2021-06-12, Derek Ignatius Asirvadem <
derek.asirvadem@gmail.com> wrote:
What in heavens name is rCLexclusive generalizationrCY, do you have a definition or link ?
Ok, read: exclusive basetype.
An upper-bound on the
maximum number of composers or solvers for a problem could be added as
in your model.
It is already there:
- the cardinality in Composer_2 means max 1 JointComposer
- the Constraint /Solver_Max_4/ means exactly that.
The DDL link gives all DDL including the Functions called by the Constraints.
Sure, I didn't mean that your model was lacking those constraints, just
that in my variant they could also be easily enforced.
Relationships:
1. Each Person invents 0-N Problems
2. Each Problem has 0-N ProblemStakeholders
3. Each ProblemStakeholder is one of JointComposer or Solver
Fine.
You need:
__ ProblemStakeholder needs a reference for the StakeholderId FK
__ 4. Each Person claims 0-N ProblemStakeholders
Erect the model and have a good look. Although it is fine, and it
works, it is just not straight-forward (a desirable element in logic).
Rather than fixing-up the Bridge model, which had a specific
argumentation purpose, I would erect a logically straight-forward
model. Ends up with fewer Facts.
____ https://www.softwaregems.com.au/Documents/Article/Normalisation/Bridge%202.pdf
You may update the rendition of my version using exclusive subtyping,
because that is what I meant. Then, Solver_Not_Composer, Solver_Not_JointComposer, and JointComposer_Not_Composer all reduce to
a single check in StakeHolder.
Regarding your version, I am not sure what Composer_Primary_Max_! and, especially, Composer_Secondary_Max_! mean. I believe that the former
should enforce one ("max" = at most? Shouldn't it be "exactly"?)
primary composer for each problem.
In reply, I would change it as follows (using parentheses, and / as
a separator between the primary key and other attributes):
Person(PersonId / LastName ...)
Problem(ProblemName / Score ...)
ProblemStakeholder(PersonId ProblemName / Role)
Composer(Composer.PersonId ProblemName)
Solver(Solver.PersonId ProblemName / Solution Date)
Relationships:
Each Person acts as 0-N ProblemStakeholders
Each Problem is built around 1-N ProblemStakeholders
Each ProblemStakeholder is an excl. basetype, one of {Composer, Solver}
Additional constraints:
1. A problem must have at least one [exactly one] primary composer.
2. A problem can have at most M composers.
3. A problem can have at most N solvers.
Here, I am assuming that Role ranges over {primary,secondary,solver}.
This is slightly less straightforward, but it would allow me to record additional information about problem stakeholders regardless of their
role.
Nicola
--- Synchronet 3.21d-Linux NewsLink 1.2