Re: Schema Relationship Question

From: David Portas <REMOVE_BEFORE_REPLYING_dportas_at_acm.org>
Date: Thu, 4 Oct 2007 01:27:35 +0100
Message-ID: <odCdneOZVYXgrpnanZ2dnUVZ8sSrnZ2d_at_giganews.com>


"JamesHoward" <James.w.Howard_at_gmail.com> wrote in message news:1191447896.562688.246640_at_r29g2000hsg.googlegroups.com...
>I have a set of predefined constants with a set of predefined
> relationships and am looking for a way to link them if possible to
> ensure data integrity.
>
> An example would be if I wanted to keep track of programs and I have a
> table Programs with rows operating system type and programming
> language. If both operating system type and programming language are
> foreign keys to reference tables (just tables with a primary key and a
> name to the element they are referencing) is there a way to ensure
> data integrity for possible nonsensical pairings such as programming
> language c# and operating system unix?
>
> Thanks in advance,
> Jim Howard
>

That could be four tables for example. The constraint you refer to would be a referential constraint between Programs and ValidPrograms.

Programs {os, language}
ValidPrograms {os, language}
OS {os}
Language {language}

-- 
David Portas
Received on Thu Oct 04 2007 - 02:27:35 CEST

Original text of this message