ON ten_bang (ten_cot);
Unique Index is a unique index, used to increase performance and ensure data integrity. A unique index does not allow any duplicate values to be inserted into the table. Basic syntax is as follows.
CREATE UNIQUE INDEX ten_index
ON ten_bang (ten_cot);
Composite Index is a combined index for two or more columns in a table. Its basic syntax is as follows:
CREATE INDEX ten_index
ON ten_bang (cot1, cot2);
Note :
Implicit Index is an index that is created automatically by the Database Server when a table is created. Default indexes are automatically created for Primary key constraints and Unique constraints.
When you don't need to use INDEX, you can DROP according to the following syntax:
DROP INDEX ten_index;
You should be careful while deleting an index, because then the performance may be slower or not improved.
Although INDEX is intended to improve Database performance, sometimes you should avoid using them. Here are some cases you need to consider to decide whether to use INDEX:
In the next article, Quantum will discuss with you how to use the ALTER TABLE command in SQL. Have you remembered to it!
Previous lesson: Create a temporary name using ALIAS in SQL
Next lesson: ALTER TABLE statement in SQL