Unique index example
SQL
Easy
2 views
Problem Description
Prevent duplicate SKU in Products using a unique index.
Output Format
DDL statement(s)
Sample Test Case
Output:
Unique index created
Constraints
Assume sku column exists
Official Solution
CREATE UNIQUE INDEX uq_products_sku ON Products(sku);
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!