Provide index definitions in addition to the column definitions.
mysql> CREATE TABLE t
-> (
-> id INT NOT NULL,
-> last_name CHAR(30) NOT NULL,
-> first_name CHAR(30) NOT NULL,
-> UNIQUE (id),
-> INDEX (last_name, first_name)
-> );
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> drop table t;
Query OK, 0 rows affected (0.00 sec)
Related examples in the same category