Sql indexes

This article is tagged with: Sql indexes and mysql

sql indexes

CREATE INDEX
Creates an index named ‘idx_test’ on the first_name and surname columns of
the users table. In this instance, duplicate values are allowed.
CREATE INDEX idx_test
ON users (first_name, surname);
CREATE UNIQUE INDEX
Creates an index named ‘idx_test’ on the first_name and surname columns of
the users table. In this instance, duplicate values are allowed.
CREATE UNIQUE INDEX idx_test
ON users (first_name, surname);
DROP INDEX
Creates an index named ‘idx_test’ on the first_name and surname columns of
the users table. In this instance, duplicate values are allowed.
ALTER TABLE users
DROP INDEX idx_test;

what is an index in sql

"An index is an on-disk structure associated with a table
or view that speeds retrieval of rows from the table or view.
These keys are stored in a structure (B-tree) that enables SQL Server
to find the row or rows associated with the key values quickly and efficiently."

This article is tagged with: Sql indexes and mysql