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

Instruction

Great. As you can see, we have successfully created the table. Now take a look at the contents of the table and study it closely.

There are two movies with the same title now: 'The Kid'. In our previous table, this situation would have been forbidden, since the column title was the primary key, and the values for the column title would have been considered as "duplicated." Now, it is possible; one movie comes from 1921, and the other was produced in 2000. Together, these two values are unique for each of the two movies.

Exercise

Let's say we want to direct another movie under the title 'The Kid' in 2016. The genre will be 'drama'. Put that information into the movie table.

Stuck? Here's a hint!

Type:

INSERT INTO movie VALUES ('The Kid', 2016, 'drama');