Author : MD TAREQ HASSAN

What is index?

Index data structure

Index types

Creating indexes in SSMS

Step-1

Creating indexes in ssms Step 1

Step-2

Creating indexes in ssms Step 2

Step-3

Creating indexes in ssms Step 3

Step-4

Creating indexes in ssms Step 4

Step-5

Creating indexes in ssms Step 5

More: https://www.mssqltips.com/sqlservertip/5573/creating-indexes-with-sql-server-management-studio/

Creating Indexes using T-SQL

-- Create a nonclustered index on a table or view
CREATE INDEX i1 ON t1 (col1);

-- Create a clustered index on a table and use a 3-part name for the table
CREATE CLUSTERED INDEX i1 ON d1.s1.t1 (col1);

-- Syntax for SQL Server and Azure SQL Database
-- Create a nonclustered index with a unique constraint
-- on 3 columns and specify the sort order for each column
CREATE UNIQUE INDEX i1 ON t1 (col1 DESC, col2 ASC, col3 DESC);

More: https://docs.microsoft.com/en-us/sql/t-sql/statements/create-index-transact-sql#syntax