Search⌘ K

Solution: Create Indexes

Understand how to create unique indexes on table columns to enforce data integrity by preventing duplicates. Learn how to test index constraints by attempting to insert duplicate data, reinforcing control over your database entries.

We'll cover the following...

Solution

Below is the solution to this challenge:

MySQL
/* Implement here */
create unique index products_name_uidx on products(name);
insert into products(name, price) values ('The Godfather', 90.00);
...