This chapter provides notes and tutorial examples on identity constraints. Topics include introduction of 'unique', 'key' and 'keyref' identify constraints; XML and XSD examples of using identity constraints.
A "unique" identify constraints on repeating sub elements is like a UNIQUE constraint in a database table.
Values must be unique, if exist.
A "key" identify constraints on repeating sub elements is like a PRIMARY KEY constraint in a database table.
Values must exist and be unique.
A "keyref" identify constraints on repeating sub elements is like a FOREIGN KEY constraint in a database table.
Values must exist and refer to values of another "key" identity constraint.