Re: semantics of foreign keys: domain specific inequality?

From: Walt <wamitty_at_verizon.net>
Date: Mon, 01 Jan 2007 21:30:39 GMT
Message-ID: <34fmh.2767$T%3.324_at_trndny08>


"David Portas" <REMOVE_BEFORE_REPLYING_dportas_at_acm.org> wrote in message news:1167558445.433757.138830_at_i12g2000cwa.googlegroups.com...
> falcon wrote:
> > I'm trying to figure out how to deal with the relative importance of
> > tables involved in a foreign-key relationship. My actual problem is
> > one of generating HTML pages directly from database schemas (think of
> > ruby-on-rails, django, etc.), and doing it in a way that makes sense
> > for non-technical users (when they have the ability to declare the
> > database schema).
> >
> > Consider two sets of tables:
> >
> > =>school: (school-name, description)
> > =>student: (student-name, description, [school-name])
> >
> > school and student are tables, both have names and descriptions,
> > student has a foreign key to school which indicates that each student
> > has only one school but a school may have many students.
> >
> > =>unix-command: (command-name, description)
> > =>unix-command-parameter: (parameter-name, description, [command-name])
> >
> > unix-command and unix-command-parameters are two tables, each has a
> > name and a description. unix-command-parameter has a foreign key to
> > unix-command which indicates that a command may have many parameters
> > but a parameter and its description are associated with only one
> > command. (think of "grep" as a command and list of grep parameters and
> > descriptions can be obtained by "grep --help")
> >
> > ---------------
> > Both sets of tables have the same basic structure and the exact same
> > foreign key relation ship (one-to-many). However, while both 'school'
> > and 'student' are important entities seperately,
> > 'unix-command-parameter' wouldn't make any sense without
> > 'unix-command.'
> >
>
> Possibly because [command-name] is part of the key in
> unix-command-parameter whereas [school-name] is not so in student? Just
> my guess because you didn't specify any candidate keys.
>
> In ER modelling a foreign key that is a subset of a key in the
> referencing entity is known as an Identifying Relationship; otherwise
> Nonidentifying.
>
> --
> David Portas
>

In some ER modeling tutorials, entities that cannot be identified by their own attributes, but instead must use at least one foreign key as part of any candidate key have a special name. Some texts call them "sub-entities" and others call them "weak entities".

I think you've correctly pegged the difference between student:school on the one hand and unix-command:unix-command-parameter on the other. unix-command-parameter, in the above lingo, is a sub-entity of unix-command. Received on Mon Jan 01 2007 - 22:30:39 CET

Original text of this message