Another way to enforce uniqueness is to add a UNIQUE index rather than a PRIMARY KEY to a table.
mysql>
mysql> CREATE TABLE person
-> (
-> last_name CHAR(20) NOT NULL,
-> first_name CHAR(20) NOT NULL,
-> address CHAR(40),
-> UNIQUE (last_name, first_name)
-> );
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> drop table person;
Query OK, 0 rows affected (0.00 sec)
Related examples in the same category