Instruction
Boom! The insertion failed because we already have a row with the name value 'Monopoly'. Our new constraint takes care of that.
UNIQUE is indeed very similar to PRIMARY KEY, which we learned in the previous part. We sometimes say that UNIQUE creates an alternate key for the table.
Exercise
It's time for you to create your own board_game table with a UNIQUE column. Remember the columns we have:
idis always auto-generated and is the primary key.nameis a text of up to 32 characters (and it must be unique!).genreis also a text of up to 32 characters.min_playersandmin_ageare integers.priceis a decimal value of up to 5 digits, 2 of which are after the decimal point.
Remember that the UNIQUE constraint is placed after the column type!
Stuck? Here's a hint!
The price column should be of type decimal(5, 2), id should be GENERATED ALWAYS AS IDENTITY PRIMARY KEY and name should be UNIQUE.



