Member-only story
20+ SQL Concepts with MS SQL Server Code
Revisit your SQL Basics
In this blog, we will explore some important SQL concepts along with SQL Server code examples for each. These concepts range from index types to common operations like creating and altering tables, writing joins, using ranking functions, and working with views and triggers.
Embark on a journey of continuous learning and exploration with DotNet-FullStack-Dev. Uncover more by visiting our https://dotnet-fullstack-dev.blogspot.com reach out for further information.
Clustered Index
A clustered index sorts and stores the data rows in the table based on the key values. Each table can have only one clustered index.
-- Create a clustered index on the 'Id' column of the 'Employee' table
CREATE CLUSTERED INDEX IX_Employee_Id
ON Employee(Id);Non-Clustered Index
A non-clustered index stores the index structure separately from the actual table data, creating pointers to the rows.
-- Create a non-clustered index on the 'Name' column of the 'Employee' table
CREATE NONCLUSTERED INDEX IX_Employee_Name
ON Employee(Name);






