NONCLUSTERED

NONCLUSTERED is a type of index in SQL that does not rearrange the physical order of the data in the table. Instead, it creates a separate object within the database containing a sorted list of references to the data, giving the database engine the ability to locate data quickly without having to search every row in a table. One table can have multiple nonclustered indexes.

Example

CREATE NONCLUSTERED INDEX idx_employee_lastname
ON Employee(LastName);

Output

Command(s) completed successfully.

Explanation

The above SQL command creates a nonclustered index, idx_employee_lastname, on the LastName column of the Employee table. This index helps in swiftly accessing the rows in the Employee table based on the LastName field. The confirmation message “Command(s) completed successfully.” implies that the index has been created successfuly.

For in-depth explanations and examples SQL keywords where you write your SQL, install our extension.