A clustered
index sorts and stores the data rows of the table or view in order based on the
clustered index key. The clustered index is implemented as a B-tree index structure that supports fast
retrieval of the rows, based on their clustered index key values.
Example:
CREATE TABLE SAMPLE10
(
ID INT ,
NAME VARCHAR(10),
TYPE_DESC VARCHAR(50)
)
Syntax:
CREATE <Index type> INDEX <Index name> ON <Table name> (Column1,Column2,...)
Creating index on single column:
CREATE CLUSTERED INDEX
IDX_SAMPLE10_CLU ON SAMPLE10 (ID)
Result:
No comments:
Post a Comment