Hi, I have a table called product_attributes in a MySQL
Database. It consists of a product SKU (foreign key), an attribute label and an attribute value. I need to ensure that combinations of SKU and attribute labels are unique.
EXAMPLE -
inserting this would be legal
{001, 'weight', '100 lbs'}
{001, 'color', 'blue'}
{002, 'weight', '200 lbs'}
This would be illegal
{001, 'weight', '100 lbs'}
{001, 'weight', '200lbs' }
-How can enforce this constraint?
-Do I have to do this in my server-side language or can I configure my database to enforce this?
-What is this type of constraint called?