Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Primary keys – the basics
3. Primary keys – Missing values
Single-column primary keys
Multi-column primary keys
NOT NULL
Review

Instruction

Great! As you can see, each id was indeed unique, and they were, generally speaking, consecutive numbers. One number was missing (7), but nothing particular happened. You will, however, discover soon enough that no two rows can share the same value in the primary key column.

Exercise

Okay, let's add a movie with ID of 7, so that there is no gap in numbering. Its title is 'Titanic', and it was produced in 1997.

Stuck? Here's a hint!

Type:

INSERT INTO movie VALUES (7, 'Titanic', 1997);