CREATE INDEX in SQL

HOW TO CREATE INDEX IN SQL?

Theย CREATE INDEXย statement in SQL is used to create indexes in tables. Indexes are used for faster retrieval of records which speed up queries.

Syntax of CREATE INDEX in SQL server. It allow duplicate values

CREATE INDEX <index_name>

ON <table_name> (column_name1..column_nameN);

Syntax of CREATE UNIQUE INDEX in SQL server. It donโ€™t allow duplicate values

CREATE UNIQUE INDEX <index_name>

ON <table_name> (column_name1..column_nameN);

Example of Create Index-

CREATE INDEX ind_name ON Persons (LastName, FirstName);

Syntax of DROP INDEX in SQL server-

DROP INDEX <table_name.index_name>;


Posted

in

Tags:

Comments

Leave a Reply