Now that you understand what indexes are, how they work, and the different types of indexes, it's time to start creating some indexes. The following sections will step you through creating both clustered and nonclustered indexes.
You will now create a clustered index in the most common way—by creating a primary key. In order to perform the steps in Exercise 10.1, you must first create a table in the Books database with the following code:
CREATE TABLE dbo.Customers ( CustomerID int NOT NULL, FirstName varchar(50), LastName varchar(50), eMail varchar(60), Phone int, City varchar(40), State char(2), ZipCode int );
You can enter and execute this code in a New Query window within SSMS. Ensure that ...