--Creating index while creating tablecreate table Table_Name (Column_Name datatype constraint Constraint_Name Primary Key)[OR]create table Table_Name (Column_Name datatype )--Creating Index on already existing tablecreate clustered index Index_Name on Table_Name(Column_Name)
;with cte as (select 1 Sno,10 Pointsunion allselect Sno+1 Sno, Points +10 Points from cte where Sno< 30000)select * into Index_Table from cte option (MAXRECURSION 30000)select Sno, Points from Index_Table
select points from Index_Table where Sno=9555
create clustered index Clx_Idx_SNo on Index_Table(Sno)select points from Index_Table where Sno=9555
drop index Index_Table.Clx_Idx_SNo
create Nonclustered index NClx_Idx_SNo on Index_Table(Sno)