Re: modeling either/or relationship...



David Cressey schrieb:
"Volker Hetzer" <volker.hetzer@xxxxxxxx> wrote in message
news:drd0q3$idc$1@xxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi!
I've got to model electrical constraints on a net of a pcb.
So, a net can be constrained either by layer,net class (and constraint
name)
or constraint class (and constraint name).

The problem I have is that a constraint (with a name and a bunch of
attributes)
can be either
- a "free constraint, adressed by layer, net class and name or
- a "bound constraint", adressed by the constraint class name.
A constraint cannot be both.

I can enforce this easily with a table constraint (id set1 xor id set2 is
true), but
can I put this into an ER diagram too?

Lots of Greetings!
Volker

Look up "generalization specialization relational model" on the web.
Did that before asking here. (I saw your response to a related question.)
What I saw was that triangle thingy. Can I assume that when some tools
have a "subcategory relationship" looking like "0||", that they mean the
same? If yes,

then, change of problem description:
I'm looking for a database design tool that, when doing that subcategory
relationship, creates code that enforces the constraint that an object
can belong to only one subcategory.

What I'm currently doing is to have three tables (root + 2 subs),
root has a type field and each sub has a type field too and a constraint
forcing the sub type to be of a particular value. Sub name and type
have to exist in root and there is only one row per name in root.
My current database tool (dezign) is useless with subcategories, so
I have to fiddle with two non identifying 1:n relationships instead
of a subcategory relationship.

Lots of Greetings and thanks for bothering!
Volker
.



Relevant Pages

  • Re: Drop Primary Key with SQL/VBA
    ... > constraint there still is the primary key on that field. ... Public Sub CreateTable() ... Dim strSQL As String ...
    (microsoft.public.access.queries)
  • Re: Having problems creating class with array
    ... Public secSection(1 To intMaxSections) As Section ... 'Initialize empty section with empty constraints ... For the Constraint classs that would be: ... Private Sub Class_Initialize ...
    (microsoft.public.vb.general.discussion)
  • Re: Drop Primary Key with SQL/VBA
    ... >> constraint there still is the primary key on that field. ... > Public Sub CreateTable() ... > Dim strSQL As String ... > then open new tblCustomer in design view, ...
    (microsoft.public.access.queries)