Indexes :

By using Indexes DBE can able to identify data at a faster way or searching will become faster. 1) clustered Index 2) Non-clustered Index

Difference between Clustered and Non-clustered index:

Clustered:

-> Only one clustered index is allowed per table -> Data is stored in leaf pages Consider the below table,
EidfnamelnamesalarydeptDOJ
1
2
3
4
.
.
.
80
.
.
.
.
.
336000
-> Here will get to know the 80th employee details using B-Tree is as shown below.. B-Tree

Non-clustered:

-> We can create any number of non-clustered indexes per table -> In case on non-clustered indexes leaf pages contains pointers to actual rows. Note -> By default clustered index will be created when you create a primary key constraint. -> It is always better to create Indexes on the tables which is subjected to very less modifications(or) data updations. Syntax: For clustered Index: create clustered index on (col1,col2....) For Non-clustered Index: create non-clustered index on table(col1,col2...)