Re: Design question regarding data typing

From: Marshall Spight <marshall.spight_at_gmail.com>
Date: 24 Feb 2006 09:48:44 -0800
Message-ID: <1140803324.846472.176660_at_p10g2000cwp.googlegroups.com>


Jacob JKW wrote:
> Sure. I was trying to explain that one column of my Insitutions table
> was the foreign key InstitutionTypeId which indexes the name (and
> description) of the type of institution (which in this simplification
> can be either "school" or "bank"). I have this in addition to separate
> Banks and Schools tables. The reason for using the InstitutionType
> descriptor (or as I gather it's called from Roy's post above,
> "discriminant") is so that if I want summary instituition data from
> Insitutions I can easily figure out the institution type without having
> to scan for each InstutionId foreign key of interest in Banks Schools.
> And that's the kludge that's causing me such consternation. :-( It just
> reeks of bad form.
>
> Am I making any sense?

Hi,

What you are describing is actually the canonical way to model a base type and two subtypes in SQL. I am unclear why you object to the design; you haven't said anything negative about it so far besides the fact that you don't like it.

Marshall Received on Fri Feb 24 2006 - 18:48:44 CET

Original text of this message