Re: Generalizations




"shane" <shane@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:fs4hrj$7tc$1@xxxxxxxxxxxxxxxxxx
I hope it is ok to ask this here.
Im having trouble with ERD's.
I have been given a definition on which to draw an ERD. I did so, and
began
transforming the entities and relationships to relations using the
following
steps
Step 1) Transform entities
Step 2) Transform weak entities
Step 3) Transform Relationships
Step 4) Transform Generalizations
Step 5) Simplify.

When I came upon step 4 I realised I had two opportunities to generalize.
A
Doctor and a Patient (Both with SSN as their primary keys) could both be
specializations of a 'People' entity.
Likewise Pharmacy and Pharmaceutical company are both specializations of
a 'company' entity.
I dont understand why we have the generalizations. It seems to me that we
are
just creating a relation for the sake of it.

Could someone put me onto the right track?
TIA
--

The following might be a little too vague for what you want.

The "generalization/specialization" pattern, like many tools and techniques
in information science, is not strictly necessary. It is possible to model
Doctors and patients without ever making explicit the fact that they are
both "people". Just about everything you need to do with the data can still
be done.

In such a model, if a curcumstance were to arise where a given person were
both a doctor and a patient in the same database, the fact that a givven
SSN might identify a doctor in one context, and a patient in another
context, would be "obvious" to the people working with the data with an
understanding of the subject matter. It would be pretty opaque to the
people working with the data, but with no understanding of the subject
matter. That might or might not be ok.

As to whether generalizations are useful or not, that's another story.
There are many situations where realizing, for instance, that autos and
trucks (lorries?) are both "vehicles" can help the database designer, the
programmer, the interactive user, and the user of reports or other
extracts. It makes things easier, in a lot of situations. Having said
that, I'm quick to add that it's not the silver bullet of data modeling.

The way I learned modeling (which might not be the most usual way) gen-spec
is used for modeling at the ERD level. That is, it forms part of the
conceptual data model. The question might arise about what happens when one
designs a relational schema to conform to the conceptual model, when the
conceptual model contans a gen-spec pattern.

As you stated, the most mechanical transformation of ERD into relational
schema will result in an extra relation for the generalization. The
question might be asked, "is this good design or bad design?" I think this
is what you are really asking. My answer is, "it depends".

And I would suggest that the purely mechanical transformation from ERD to
relational schema masks the fact that some real design work is going on when
this transformation is done. The fact that you can do it without thinking
doesn't mean that you should do it without thinking. It seems to me that in
some situations, the "extra" relation is worth its cost. In others, it
isn't. You will undoubtedly get other insights from other people regarding
this.

Not that, if someone is exposed only to the relational schema, it might
take a little deduction on that person's part to discover that the relations
were intended to mimic a gen-spec pattern.
Deducing design intent from implementation is another whole discipline in
the general field of information systems.


.



Relevant Pages

  • Re: Generalizations
    ... I have been given a definition on which to draw an ERD. ... Step 2) Transform weak entities ... I dont understand why we have the generalizations. ... "is this good design or bad design?" ...
    (comp.databases.theory)
  • Re: transpose results
    ... You need to transpose or ... transform the data into multiple columns. ... This is just a one-time scenario, so poor db design is not an issue - I'll ... If IdTable is the primary key of the table, the following query will ...
    (microsoft.public.access.queries)
  • Re: Using GROUP BY in query expression on MEMO fields it truncates data in MEMO fields to first 255
    ... |> I would do something like that, but unfortunately I already have TRANSFORM ... |> Company.Comments PIVOT Tables_Reference.Code_table ... | Comments will return me full value of MEMO field? ... this can not be applied in Design you must manually change SQL, ...
    (microsoft.public.access.reports)
  • Re: Using GROUP BY in query expression on MEMO fields it truncates data in MEMO fields to first 255
    ... |> I would do something like that, but unfortunately I already have TRANSFORM ... |> Company.Comments PIVOT Tables_Reference.Code_table ... | Comments will return me full value of MEMO field? ... this can not be applied in Design you must manually change SQL, ...
    (microsoft.public.access.queries)
  • Re: Report shows null values, how to convert to a zero
    ... Open the report in design view, and set the Format property of this text box ... the query in SQL View, and add Nzaround the ... TRANSFORM SumAS SumOfQuantity ...
    (microsoft.public.access.reports)