Separate foreign keys with shared ID space
From: Robert Brown <robertbrown1971_at_yahoo.com>
Date: 27 Jul 2004 16:13:08 -0700
Message-ID: <240a4d09.0407271513.43dfecc7_at_posting.google.com>
Let's say I have a type hierarchy: (just an example)
Date: 27 Jul 2004 16:13:08 -0700
Message-ID: <240a4d09.0407271513.43dfecc7_at_posting.google.com>
Let's say I have a type hierarchy: (just an example)
the general entity customer:
CREATE TABLE customer(customer_id int, customer_name varchar(250), customer_type int)
three specific customer subtypes: 1 - business, 2 - home, 3 - university
represented by the following three tables (being subtypes, they share ID space for customer_id)
CREATE TABLE business_customer(customer_id int, business_sector int,
... )
CREATE TABLE home_customer(customer_id int, household_income_bracket
int, ...)
CREATE TABLE university_customer(customer_id int, number_students int,
...)
Thanks!
- Robert