Prev | Current Page 67 | Next

Richard Niemiec

"Oracle Database 10g Performance Tuning Tips & Techniques"

In the preceding example, the UPS_Tracking_Number
column will not contain duplicate values.
To enforce the constraint, Oracle will create a unique index on the UPS_Tracking_Number
column. If there is already a valid unique index on the column, Oracle will use that index to
enforce the constraint.
A column with a UNIQUE constraint may also be declared as NOT NULL. If the column is
not declared with the NOT NULL constraint, then any number of rows may contain NULL values,
as long as the remaining rows have unique values in this column.
In a composite unique constraint that allows NULLs in one or more columns, the columns
that are not NULL determine whether the constraint is being satisfied. The NULL column always
satisfies the constraint, because a NULL value is not equal to anything.
Primary Key Values
The PRIMARY KEY integrity constraint is the most common type of constraint found in a database
table. At most, only one primary key constraint can exist on a table. The column or columns that
comprise the primary key cannot have NULL values.
In the preceding example, the Order_Number column is the primary key. A unique index
is created to enforce the constraint; if a usable unique index already exists for the column, the
primary key constraint uses that index.
Chapter 1: Getting Started with the Oracle Architecture 17
Referential Integrity Values
The referential integrity or FOREIGN KEY constraint is more complicated than the others we have
covered so far because it relies on another table to restrict what values can be entered into the
column with the referential integrity constraint.


Pages:
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
Meble Gabi Kalkulator kredytowy pit 37 druk kasyno rozrywka i hobby