Data Definition Language, CREATE INDEX (Part 2 of 2)
Format:
CREATE {UNIQUE} INDEX index_name
ON table_name (
column_name1 {ASC | DESC},
column_name2 {ASC | DESC},
...);
A simple index contains only a single column.
A composite index contains multiple columns from a single table.
The index applies to all the columns in the index definition.
These columns do not have to be adjacent in the table.
Instead, they can be taken from any column in any order.
The order in the index definition is important and is defined left to right, going from major to minor sort order.
Your can create multiple indices on the same table.
ASC means ascending sort order, which is the default and does not need to be specified.
DESC means descending sort order and must be specified to reverse the sequence.
UNIQUE forces the combination of indexed columns to be unique.
> Access, MySQL, and SQL Server index names must be unique within a table.
> DB2, Oracle, and PostgreSQL index names must be unique within the database.