SQL Database Concepts Question:
Download Questions PDF

Tell me what is difference between clustered and non clustered index?

Answer:

A table can have only one Clustered Index at a time which is generally created on primary key and can have more than one non clustered indexes (maximum up to 999)
The leaf level of clustered index is actual data pages of the table. Whereas in case of non-clustered index the leaf level is a pointer to the data.
Non-clustered index is faster than clustered index because when we use DML statement on clustered index, performance issues may occurred since it has to update the index every time a DML statement is executed.
Syntax of creative clustered / non clustered index is as follow
CREATE [CLUSTERED | NON CLUSTERED] INDEX index_name
ON <object> (column [ASC | DESC] [,…n])

Download Basic SQL Server Interview Questions And Answers PDF

Previous QuestionNext Question
Do you know what is blocking?Tell me what is use of EXCEPT clause? How it differs from NOT IN clause?