SQL CREATE INDEX Statement

SQL CREATE INDEX Statement

The CREATE INDEX statement is used to create indexes in tables.
Indexes are used to retrieve data from the database very fast. The users cannot see the indexes, they are just used to speed up searches/queries

CREATE INDEX Syntax

Creates an index on a table. Duplicate values are allowed:
CREATE INDEX index_name
ON table_name (column1column2, ...);

Example:
CREATE INDEX idx_lastname
ON Persons (LastName);

Example:
CREATE INDEX idx_pname
ON Persons (LastName, FirstName);

Source: https://www.w3schools.com/sql/sql_create_index.asp

Comments

Popular posts from this blog

Lab Network 2024

Step to publish your static html web page to GitHub

Tutorial OOP(reversion java)