How to use Unique Composite Key
问题 I have a table Item(ItemName*, ItemSize*, Price, Notes) I was making composite key of (ItemName,ItemSize) to uniquely identify item. And now after reading some answers on stackoverflow suggesting the use of UNIQUE i revised it as Item(ItemID*, ItemName, ItemSize, Price, Notes) But How to apply UNIQUE constraint on ItemName and ItemSize please correct if there is something wrong in question 回答1: ALTER TABLE Items ADD UNIQUE INDEX(ItemName, ItemSize); and here's an article explaining how to