On Saturday, 12 June 2021 at 04:48:27 UTC+10, Nicola wrote:
On 2021-06-11, Derek Ignatius Asirvadem wrote:
That Bridge problem is from my days of hard labour at TTM gulag.Not directly relevant to the topic of this thread, and possibly not
relevant to the formulation of that problem, but... your
Solver_Not_Composer constraint only ensures that the solver is not the
main composer. But nothing in that model prevents a solver to be the
same as the second composer (i.e., SolverID may be Composer_Id_2).
I would have designed the model differently:
Person[PersonId | LastName FirstName ...]
Problem[ComposerId.PersonId ProblemNo | Name Score ...] ProblemStakeholder[ComposerId ProblemNo StakeholderId.PersonId Role] JointComposer[ComposerId ProblemNo JointComposer.StakeholderId] Solver[ComposerId ProblemNo Solver.StakeholderId]
where ProblemStakeholder is an exclusive generalization of JointComposer
and Solver. Then, a simple check constraint on ProblemStakeholder (ComposerId ≠ StakeholderId) plus the exclusive subtyping would prevent composers to be solvers of their own problems.
An upper-bound on the
maximum number of composers or solvers for a problem could be added as
in your model.
Relationships:
1. Each Person invents 0-N Problems
2. Each Problem has 0-N ProblemStakeholders
3. Each ProblemStakeholder is one of JointComposer or Solver
What in heavens name is “exclusive generalization”, do you have a definition or link ?
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.
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
On Monday, 14 June 2021 at 01:13:54 UTC+10, Nicola wrote:
On 2021-06-13, Derek Ignatius Asirvadem wrote:
So in the previous model 12.2 Jun 21, I as DBA policeman re what goes
into the db, allowed your Role, but insisted on the required
Discriminator Staketype. In the next iteration, I will give
ComposerType. (This is modelling, yes, we have many iterations). You
tell me what you want.
The latest revision, with ComposerType, is fine.
Nicola
On Monday, 14 June 2021 at 01:13:54 UTC+10, Nicola wrote:
On 2021-06-13, Derek Ignatius Asirvadem wrote:
So in the previous model 12.2 Jun 21, I as DBA policeman re what goes
into the db, allowed your Role, but insisted on the required
Discriminator Staketype. In the next iteration, I will give
ComposerType. (This is modelling, yes, we have many iterations). You
tell me what you want.
The latest revision, with ComposerType, is fine.
AFAIC, the data modelling is not quite complete, not resolved. I was expecting a response from you to continue, and bring it to
a conclusion. Eg. the obvious evaluation as the DMs stand is, to
progress both yours and mine. Not is the sense of competition, but
for understanding.
Eg. in mine, if Composer and Solution have common attributes (other
than that in Person), that would be Normalised into a Subtype cluster.
Which leads to yours. If not, four tables are the irreducible (“non-redundant”) set.
On Wednesday, 16 June 2021 at 19:35:35 UTC+10, Nicola wrote:
On 2021-06-15, Derek Ignatius Asirvadem wrote:
AFAIC, the data modelling is not quite complete, not resolved. I was expecting a response from you to continue, and bring it to
a conclusion. Eg. the obvious evaluation as the DMs stand is, to
progress both yours and mine. Not is the sense of competition, but
for understanding.
Eg. in mine, if Composer and Solution have common attributes (other
than that in Person), that would be Normalised into a Subtype cluster. Which leads to yours. If not, four tables are the irreducible (“non-redundant”) set.
I think I have already justified my preference for my version, which is
what you are saying: I'd use a cluster because that allows me to extend
the model with information common to both composers and solvers.
Another reason is that the exclusivity between composers and solvers is
more explicit (because of exclusive subtyping), although
implementation-wise Solver_Not_Composer would not be a very different constraint.
Btw, wouldn't you also need a Composer_Not_Solver constraint
associated to Composer?
Btw, wouldn't you also need a Composer_Not_Solver constraint
associated to Composer?
Why ?
On Thursday, 17 June 2021 at 05:02:53 UTC+10, Nicola wrote:
On 2021-06-16, Derek Ignatius Asirvadem wrote:
Btw, wouldn't you also need a Composer_Not_Solver constraint
associated to Composer?
Why ?Consider this:
1. Insert Alice and Bob.
2. Insert bridge problem B with (primary) composer Alice.
3. Insert solution of B by Alice.
(Prevented by Solver_Not_Composer)
4. Insert solution of B by Bob.
5. Insert secondary composer Bob for problem B
What does prevent 5?
On Thursday, 17 June 2021 at 05:02:53 UTC+10, Nicola wrote:
On 2021-06-16, Derek Ignatius Asirvadem wrote:Consider this:
Btw, wouldn't you also need a Composer_Not_Solver constraint
associated to Composer?
Why ?
1. Insert Alice and Bob.
2. Insert bridge problem B with (primary) composer Alice.
3. Insert solution of B by Alice.
(Prevented by Solver_Not_Composer)
4. Insert solution of B by Bob.
5. Insert secondary composer Bob for problem B
What does prevent 5?
Chronology and Sanity.
The set of ACID Transactions that make up that database is not shown.
As discussed severally, the database is incomplete without them.
All such (as above) issues and nuances are easily covered in the
Transactions that have to exist.
On Thursday, 17 June 2021 at 18:37:51 UTC+10, Nicola wrote:
On 2021-06-16, Derek Ignatius Asirvadem wrote:
On Thursday, 17 June 2021 at 05:02:53 UTC+10, Nicola wrote:
On 2021-06-16, Derek Ignatius Asirvadem wrote:Consider this:
Btw, wouldn't you also need a Composer_Not_Solver constraint
associated to Composer?
Why ?
1. Insert Alice and Bob.
2. Insert bridge problem B with (primary) composer Alice.
3. Insert solution of B by Alice.
(Prevented by Solver_Not_Composer)
4. Insert solution of B by Bob.
5. Insert secondary composer Bob for problem B
What does prevent 5?
Chronology and Sanity.
Ok, understood. As you say:
The set of ACID Transactions that make up that database is not shown.
As discussed severally, the database is incomplete without them.
Which leaves room for speculation about whether you forgot a constraint
or it was done intentionally.
The set of ACID Transactions that make up that database is not shown.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 403 |
Nodes: | 16 (2 / 14) |
Uptime: | 47:35:21 |
Calls: | 8,407 |
Calls today: | 2 |
Files: | 13,174 |
Messages: | 5,905,328 |