I have copied the create statement to clipboard. Its showing
Key portion:
PRIMARY KEY (ID),
KEY contID (contID)
What does the KEY refers to and What type of KEY it is?
I have copied the create statement to clipboard. Its showing
Key portion:
PRIMARY KEY (ID),
KEY contID (contID)
What does the KEY refers to and What type of KEY it is?
KEY creates an index (or key) on the column for faster look up on that column in queries. Generally you would use KEY on a column that is used in joins and WHERE clauses.
From 13.1.14. CREATE TABLE Syntax
{INDEX|KEY}
KEY is a synonym for INDEX
The PRIMARY KEY for a table represents the column or set of columns that you use in your most vital queries. It has an associated index, for fast query performance.