SQL CREATE INDEX Keyword
The CREATE INDEX command is used to create indexes on columns in a table. Indexes make it faster to search for data but do not change the table’s visible structure. Indexes allow duplicate values unless defined as UNIQUE.
SQL CREATE INDEX Syntax
CREATE INDEX index_name ON table_name (column1 column2 ...)
SQL CREATE INDEX Example
This creates an index named idx_lastname on the last_name column of the Patients table. It helps speed up queries that search for patients by last name.
CREATE INDEX idx_lastname ON Patients (last_name)

SQL CREATE INDEX on Multiple Columns Example
To create an index on two or more columns include the column names separated by commas.
This creates a combined index on the last_name and gender columns.
CREATE INDEX idx_name_gender ON Patients (last_name, gender)
