What is the difference between UNIQUE and UNIQUE KEY? Which is better?
For Example:
CREATE TABLE `table1` (
attr1 INT PRIMARY KEY AUTO_INCREMENT,
attr2 INT,
attr3 INT,
attr4 INT,
UNIQUE (attr3,attr4)
);
AND
CREATE TABLE `table1` (
attr1 INT PRIMARY KEY AUTO_INCREMENT,
attr2 INT,
attr3 INT,
attr4 INT,
UNIQUE KEY `constraintName` (attr3,attr4)
);
My question is particularly about usage of UNIQUE and UNIQUE KEY keywords and the difference of results in execution of each.