previous | index | next

Primary Key Constraints

To indicate that a column represents a unique key, add a PRIMARY KEY constraint to the column definition: Customer Table With Primary Key.

Note that primary keys must also have a NOT NULL constraint.

When the customer table is defined like this, an attempt to do:

   INSERT INTO customer
          VALUES (3,  'Britney Spears',  'Lost in CA',  -1234);

will not be allowed because it generates a duplicate key.


previous | index | next