Re: How to represent a total-and-exclusive relation into a relational database
From: -CELKO- <jcelko212_at_earthlink.net>
Date: 19 Jan 2005 17:32:06 -0800
Message-ID: <1106184726.608986.206890_at_z14g2000cwz.googlegroups.com>
Date: 19 Jan 2005 17:32:06 -0800
Message-ID: <1106184726.608986.206890_at_z14g2000cwz.googlegroups.com>
>> that the UNIQUE clause above is useless since 'vin' is our primary
No, the UNIQUE is redundant, but the extra UNIQUE constraints help
queries. You can also use UNIQUE (vehicle_type, vin) to change the
order of the index.
When I go down the hierarchy to a table with (vin, vehicle_type) as
its primary key, I need to have a UNIQUE constraint for the REFERENCES
clause that has both columns in the parent table.
This depends on the indexing methods in your SQL product, of course.
Received on Thu Jan 20 2005 - 02:32:06 CET
key, I can not see how we could get any vin-vehicle-type pair that are
not unique. Did I miss something ? <<