
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
For example, in a police database, column VEHICLE.VIN could be NULL (which makes sence, let's consider a situation when witnesses describe a hit-and-run accident, then number plate and/or VIN may be not known). How to implement a requirement that if VIN is known, it has to be unique? I've created a separate entity for VIN and removed VIN column from VEHICLE table CREATE TABLE VEHICLE(VEHICLE_ID INT NOT NULL PRIMARY KEY, ... ); CREATE TABLE VIN(VEHICLE_ID INT NOT NULL PRIMARY KEY, VIN VARCHAR(30) UNIQUE); The technique is called inheritance of primary key
| <-- __Chronological__ --> | <-- __Thread__ --> |