Re: Primary Key, Unique Key
Posted in 1998
Art S. Kagel — — source: Informix-list mailing list archive (1991-1998)
Lee Wan Ling wrote: > > Hi there, > Can anyone enlighten me on the differences between a primary > key and a unique key? When should I use a primary key and when should I > use the unique key constraint? > Thanks! They are basicaly the same. Use PRIMARY KEY when there will be references to the key in another table as a FOREIGN KEY (if you use the FOREIGN KEY constraint there then it is required) and UNIQUE constraint otherwise. This will document which keys are identifiers and which are just unique attributes. Art S. Kagel