Nicola
> On Tuesday, 16 March 2021 at 23:23:28 UTC+11, Nicola wrote:
> > On 2021-03-13, Jaime Alvarez Benayas <
jaime.alva...@gmail.com> wrote:
Good explanation, using terms the seeker may be more familiar with.
> Note that the "circularity" in that diagram is only apparent (ERD are
> misleading).
So, why in heavens name, do professors teach ERD ?
Why, since we have had IDEF1X for Relational Data Modelling since 1983 (established and well-known international standard since 1993), do professors suppress that, and instead “teach”; push; shove; market; propagate the broken ERD, which is a pre-Relational artefact ?
Oh, the famous cancer in academia, the not-invented-here syndrome. Imbeciles like Stonebraker and Chen are academics to be revered, even when they are proved wrong. Non-academics and anything they might come up with, without using the glorious inventions of the motherland, are to be suppressed. This is not science, it is communism. The political ideology of the pig poop eaters.
> In fact, if you turn that diagram into a relational schema,
> the result is a directed *acyclic* graph (where you take the relation
> schemas as nodes and the foreign keys determine the directed edges).
To be clear. Yes, for Relational Normalisation, the first step is to Normalise the data into the **Data Hierarchies**, and they must be “trees”, otherwise known as DAGs. But the trees or DAGs or graphs are not exposed; not visible, in a simple exercise such as this. Thus your statement, though correct, may confuse.
The Data Hierarchies are Normalised in the First Wave. Each hierarchy begins with an Independent entity, and flows into many Dependent entities.
>>>>
Now we get to the second article that is absent in ERD, that is a specific Relational requirement, as provided in IDEF1X:
__ Independent vs Dependent entities.
Trying to model data Relationally, without using Relational concepts, is guaranteed to fail. The obsession of “theoreticians”, using tools that are guaranteed to fail. How on earth is this “teaching Relational Data Modelling” ???
Now we get to the third article that is absent in ERD, that is a specific Relational requirement, as provided in IDEF1X:
__ Identifying vs Non-Identifying relations,
__ which is based on the Relational Key.
Both of which are suppressed by academia; the textbooks; the professors.
While I accept that this is a simple exercise, and that not all Relational requirements need to be exposed in each such, the resolution that is allegedly called for; the goal of the exercise, is subverted because the very fundamentals [Relational concepts] that do provide resolution are missing; not taught.
For the exercise, we can:
- Either treat it as a simple classroom one, intended to expose just one aspect, and devoid of Relational concepts, and thus a fraud because it is marketed and sold as “Relational Data Modelling”. That is broken, as per the seeker, FORTY YEARS OUT-OF-DATE, and both you and I are forced to provide the minimal Relational concepts, in order to obtain the resolution to the question.
- Or we can be honest human beings and actually teach Relational concepts under the label of “Relational Data Modelling”. Which is why I provided a Data Model that exposes the basic Relational concepts (Independent/Dependent entities; Relational Keys; Identifying/Non-Identifying relations), and thus a far greater understanding of the elements being juggled around in the exercise.
But the poor students who pay good money for what passes as “science”, as “education” these days, are not taught genuine science, and instead are force-fed outdated and obsolete concepts as “science”, force-fed anti-Relational concepts as “Relational”, and the real Relational Model is suppressed. (Nicola, you stand out as the single academic attempting to cross the great divide, to actually delve into the Relational paradigm.)
<<<<
Ok, I see that you are limiting your evaluation to Entity level (not Key or Attribute level). I will provide that as well.
https://www.softwaregems.com.au/Documents/Student_Resolutions_2020/comp_databases_theory/Alva%20Jaime%20DM%20B.pdf
After the First Wave, after the Data Hierarchies are resolved, as trees; DAGa; graphs, which means no circular references; no Cyclic Graphs, we are ready to commence the Second Wave. Here we have entities that join two Data Hierarchies. Eg. SalesOrder identifies both a Customer (from the Party hierarchy) and a Part (from the Object hierarchy). Technically, these are Binary entities. Whereas in the First Wave, Trees; DAGs, are demanded, in the Second Wave, that constraint does not [cannot] apply, the entities being established will not conform because they join two trees.
In my Data Model (link above), the [First Wave] Data Hierarchies are not very deep, as it is a classroom exercise, but it remains that they must be understood properly:
- Department
--- Course
- Person
- Title
--- Book
And the following are [Second Wave] Binaries:
- Teacher
- CourseTeacher
- Author
- Editorial
> Now, the question here is rather whether there are some *path
> restrictions*, that is, restrictions on how instances of an ancestor
> entity (Department) are related to instances of the common child T-C:
(I would not use the term “common child” or common parent/ancestor”. Just Parent and Child, the precise meaning of which is already difficult to maintain.)
> must a teacher teach in courses organized by the teacher's department?
> In courses that are *not* organized by the teacher's department? Any
> courses? Addressing this type of question does not change the diagram
> above, though; but it influences how foreign keys migrate from top to
> bottom.
>
> > Given my assumptions, I consider the example [Course (C) - department
> > (D) - teacher (T)]. I deduce that the only relationship which is
> > redundant is between course and teacher since:
> Which is wrong. How would you know who teaches what without that?
>
> > However, in the example given, the redundant relationship is Teacher
> > and Department.
> ? Is this an answer given to you by someone?
>
> > The reasoning is that if the courses a teacher teaches
> > are known and the department to which each course belongs is also
> > known, it can be deduced to what department belongs each teacher.
> Why? Who said that a teacher teaches only courses in her own department?
> And even if that were the case, the relationship between Department and
> Teacher would *not* be redundant, because it represents a different
> fact. What if next year Prof. John Doe goes on sabbatical? Shall we
> forget that he belongs to a department because he doesn't teach that
> year?
Good discussion of the considerations. I would add two more.
1. In the real world, Teacher means someone who is accredited to teach, which means accredited **by** a Department. A Teacher is prevented from teaching in any old Department (where he is not accredited).
2. A Teacher may well have expertise in, and therefore be accredited in or qualified by, more than one Department. Joe Blogs teaches Mathematics under Department[Science], and Philosophy under Department[Humanities].
3. Sabbatical can be a CourseTeacher row, to establish that the Teacher remains with the Department (and gets paid), and must teach at least one Course (in order to be a Teacher).
> In your model, each teacher must always be assigned to at least one
> course. With
>
> (a) such an (unrealistic) constraint, *and*
Why is that constraint “unrealistic” ? In the real world, it is a common; even pedestrian, requirement. We have been implementing such in Relational databases since 1983.
> (b) with the additional constraint that teachers work only in their own
> department,
In order to avoid confusion, I would not use the term “their department”, because the teacher does not own a department, rather I would hold that which is shown in the data hierarchy:
__ each Department QUALIFIES 1-to-n Teachers.
Thus the Teacher belongs to a Department, not vice versa.
Thus a Teacher can teach only in a Department that he is qualified in.
In the same vein as [a], a Department cannot exist unless it has least one Teacher.
> it is true that you can infer the department of a teacher by looking at
> the courses taught by that teacher. But still, you need the
> Teacher-Department relationship for at least two reasons: first, it is
> semantically an important and distinct relationship in the application
> domain (ask yourself: does a teacher belongs to a department because he
> teaches a course in that department, or does he teach certain courses as
> a consequence of belonging to a given department?
That is correct. In any case, the Teacher IS QUALIFIED IN [belongs to; empowers] 1-to-n Departments, not vice versa.
> This is a point also
> Derek makes in a sibling post: what comes first? What depends on what?
> Meaning is king); and second, it allows you to easily enforce (b) (via
> a common ancestor referential constraint).
Aka [Declarative] Relational Integrity, as opposed to [Declarative] Referential Integrity.
I merely articulate the Relational Model, IDEF1X, and genuine Relational Data Modelling.
> On Wednesday, 17 March 2021 at 03:03:00 UTC+11, Nicola Vitacolonna wrote:
> > On 2021-03-13, Jaime Alvarez Benayas <
jaime.alva...@gmail.com> wrote:
>
> I have not made all the cardinalities explicit in the diagram, but that
> does not matter for my point below. The labels on the relationships are
> missing as well, as they are missing in your ERD—but, again, this not
> strictly relevant to my point.
I accept that that missing info is not relevant to your point. But it is relevant to the process of Data Modelling: filling in those two categories of missing info will.
__ a. improve understanding of the data model and
__ b. improve its accuracy.
Thus when teaching Relational Data Modelling, Cardinality and Verbs that define relations must not be omitted (as they evidently are). The only allowance is, in simple exercises, the distinction between 0-to-n and 1-to-n can be overlooked, they can be considered “equal” for classroom purposes.
> It is obvious from the diagram above that (a) nothing is redundant (wrt
> to the limited information provided), *no matter how you fill in the
> missing cardinalities*, and (b) the "circularity" in your ERD is an
> artifact (the diagram above, seen as a graph, is a DAG).
What is seen; what is visual; what is semantic, is one data hierarchy (one DAG), plus two Binaries.
(And in my DM, two data hierarchies (two DAGs), plus two Binaries.)
> artefact
I categorically state, the pig poop herd purposely draw “circles” in their non-Relational ERDs in order to hammer is the falsity that “circles” are allowed. Yes, absolutely, when the DM is drawn top-to-bottom, such that the hierarchies are positioned logically, that contrived nonsense disappears. A “circle” will occur at every Binary entity, but it will not look like a visual circl when the DM is drawn properly, only when it is contrived to form a “circle”. As evidenced.
> Besides,
> compared to your first example, here there is not even a "common
> ancestor" situation
(In mine, there is. And it has meaning. And it provides Relational integrity.)
Yes. Well, when the data has been modelled Relationally, and erected using IDEF1X (my link above, page 2), that issue disappears:
- there is no relation between Author and Editorial
- there are no redundant relations
> Let's say that both A-E and A-B mean "Contribution", and that the
> relationship between Editorial and Book is "reviews/is reviewed in".
> *If* the following constraints hold "in the real world":
>
> (1) each time an author A makes a contribution to a book B then A makes
> a contribution for the editorial in which B is reviewed, and
>
> (2) each time A makes a contribution to an editorial E then there is
> a book reviewed in E to which A has contributed,
That is not a set of of constraints one would find in the real world, it is a set of of constraints that is contrived for classroom purposes. Just don’t call it “real world”.
You are introducing a new notion Contribution, that is not in the original question. Absurd as it is, ok, let’s model that, in order to validate it, and to perform some genuine modelling. Paper is cheap. Page 3 in the DM linked above.
To the eye, to the mind, the Book-centric Contribution is more logical than the Author-centric. That model proves [when compared with the solution, page 2) that there is no need for Contribution entity, it is redundant. Every element can be derived from the simpler solution. The notion of Contribution is merely a View (UNION DISTINCT) of Author and Editorial. Whereas Author and Editorial are each explicit facts; events, Contribution is not, it is a classification; a intellective concept only, it is a Collection, that can be derived from the facts.
> Note that constraints (1) and (2) above are not implied by the
> cardinalities in the diagram.
I wouldn’t look for considerations re [1][2] in the cardinalities, rather in the whole model,
Cheers
Derek