When creating new MySQL database table it is important to create a primary key or unique index. When a primary key or unique index exists, lookup and count operations will be more efficient.
A primary key is a column that can uniquely identify every row in the table. If there is no natural key, then auto-increment can be used to create a synthetic key.
If it is still not possible to create a primary key then a unique index should be created. A unique index is a column or set of columns that is known to be unique.
When creating a new table in phpMyAdmin, select PRIMARY from the Index dropdown on the column that will be the primary key. Check the box in the A_I column if this will be an auto incrementing key.
While on the Structure tab for the table, click Primary in the Action column next to the column name.
When prompted, click OK.
The easiest way to create a unique key in phpMyAdmin is to create the table first. Once the table is created, select the check boxes next to the columns that are unique when combined, and click Unique underneath the table.
© 2021 Appian. All rights reserved.