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

Instruction

Nice! As you can see, the query failed. That's what's supposed to happen. The database won't allow you to duplicate the primary key column, because it must always be unique.

Now, what will happen if we try to insert a NULL value instead?

Exercise

Add a new movie with a NULL ID value. You can use the template code we have prepared for you or you can write your own.