Re: Schema Relationship Question

From: JOG <>
Date: Thu, 04 Oct 2007 00:15:13 -0000
Message-ID: <>

On Oct 3, 10:44 pm, JamesHoward <> wrote:
> 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

Well, those non-viable pairings are part of your data. You could have an ugly hard coded check constraint, or alternatively create a table containing those disallowed pairings, and check select against it on any insertion into your programs table. I'd check out the particular flavour of RDBMS you are using on google for appropriate syntax. Good luck. Received on Thu Oct 04 2007 - 02:15:13 CEST

Original text of this message