A clustered index is a type of index that physically reorders the data in a table when the index is created. This means that when a clustered index is created, the data in the table is physically sorted in the order of the clustered index key. A non-clustered index does not physically reorder the data in a table when the index is created. Instead, a non-clustered index creates a separate structure that contains the index key and a pointer to the data in the table.
For example, if we have a table called ‘Employees’ with the columns ‘EmployeeID’, ‘FirstName’, and ‘LastName’, we could create a clustered index on the ‘EmployeeID’ column. This would cause the table to be physically sorted by the ‘EmployeeID’ column. We could also create a non-clustered index on the ‘LastName’ column. This would create a separate structure that contains the ‘LastName’ column and a pointer to the data in the table. The data in the table would not be physically sorted by the ‘LastName’ column.