Oracle create index syntax

Oracle's index can be divided into 5 kinds, they include unique index, composite index, reverse key index, bitmap index and function-based index.

1. Standard syntax for creating indexes

The following is the quoted content:  
CREATE INDEX index name ON table name (column name) 
TABLESPACE table space name;

E.g:

The following is quoted:  
CREATE INDEX idx_of_imsi ON uim_auth_file(imsi) TABLESPACE users;

2. Create a unique index

The following is the quoted content:  
CREATE unique INDEX index name ON table name (column name) 
TABLESPACE table space name;

E.g:

The following is the quoted content:  
CREATE UNIQUE INDEX idx_of_imsi ON uim_auth_file(imsi) TABLESPACE users;

3. Create a composite index

The following is the quoted content:  
CREATE INDEX index name ON table name (column name 1, column name 2) 
TABLESPACE table space name;

E.g:

The following is the quoted content:  
CREATE INDEX idx_of_imsi ON uim_auth_file(iccid,imsi) TABLESPACE users;

4. Create a reverse key index

The following is the quoted content:  
CREATE INDEX index name ON table name (column name) reverse 
TABLESPACE table space name;

E.g:

The following is quoted:  
CREATE INDEX idx_of_imsi ON uim_auth_file(imsi) reverse TABLESPACE users;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325709842&siteId=291194637