When queries are run against a database, an index on that database basically helps in the way the data is sorted to process the query for faster and data retrievals are much faster when we have an index.
There are basically two types of indexes that we use with the SQL Server
Clustered Index-
1. It will format the entire table means physically sort the table.
2. Only one clustered index can be created for a table.
3. Data will be located in the leaf level.
4. By default, primary key will create clustered index on the table.
Non-Clustered Index
1. It won’t touch the structure of the table.
2. It forms an index table as reference to the exact data.
3. A reference to the data will be located in the leaf level.
4. For a table, we can create 249 non clustered indexes.