| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: How to represent a total-and-exclusive relation into a relational database
-CELKO- a écrit :
> The classic scenario calls for a root class with all the common
> attributes and then specialized sub-classes under it. As an example,
> let's take the class of Vehicles and find an industry standard
> identifier (VIN), and add two mutually exclusive sub-classes, Sport
> utility vehicles and sedans ('SUV', 'SED').
>
> CREATE TABLE Vehicles
> (vin CHAR(17) NOT NULL PRIMARY KEY,
> vehicle_type CHAR(3) NOT NULL
> CHECK(vehicle_type IN ('SUV', 'SED')),
> UNIQUE (vin, vehicle_type),
> ..);
Hi CELKO,
I'm trying to implement you model into mine and I think (And I would like to hear you opinion) that the UNIQUE clause above is useless since 'vin' is our primary key, I can not see how we could get any vin-vehicle-type pair that are not unique.
did I miss something ?
Mathieu Pagé Received on Wed Jan 19 2005 - 11:04:04 CST
![]() |
![]() |