Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Defining columns with UNIQUE
Adding and removing UNIQUE constraints
Summary

Instruction

Excellent! The new board game had a unique name, so we were able to add the new row successfully. But what would happen if we wanted to enter a row with the same name value?

Exercise

Pretend to be an absent minded user who didn't notice that Monopoly is already in the database.

Try to insert the game: the name is Monopoly, genre is business, min_players is 2, min_age equals 10, and price is listed at 35.20.

Stuck? Here's a hint!

Type:

INSERT INTO board_game (name, genre, min_players, min_age, price)
VALUES ('Monopoly', 'business', 2, 10, 35.20);