Re: Question on Structuring Product Attributes
From: -CELKO- <jcelko212_at_earthlink.net>
Date: Sat, 15 Oct 2011 17:51:48 -0700 (PDT)
Message-ID: <691a212c-7b02-4996-88f1-c437ef47724b_at_gy7g2000vbb.googlegroups.com>
Date: Sat, 15 Oct 2011 17:51:48 -0700 (PDT)
Message-ID: <691a212c-7b02-4996-88f1-c437ef47724b_at_gy7g2000vbb.googlegroups.com>
In this particular case, the way to do this in full, repeat FULL
Standard SQL, is with global CHECK() check constraints. Make and model
information is in the VIN so a regular expression can check it.
CREATE TABLE SUV
REFERENCES Vehicles (vin),
(vin CHAR(17) NOT NULL PRIMARY KEY,
CONSTRAINT vin_in_motor_pool
CHECK (EXISTS
(SELECT *
FROM Vehicles AS V1
WHERE V1.vin = SUV.vin),
CONSTRAINT suv_vin
CHECK (<< regular expression >>),
..
);
Received on Sun Oct 16 2011 - 02:51:48 CEST