SQL Server Indexes
Posted on 2013-01-13
I am using visual studio queries to manage a SQL database.
If a table has the following fields:
1. SIID <-- Identity and Primary Field
Some inquiries will be grouped on StudentIDs and their grades, while others will be grouped on ClassIDs and the grades.
How should the non-clustered indexes be created?
Should I crate one index
or should I create separate indexes, ie
Index 1: a join used to get student Name
Index 2: a join used to get Class name AND student name
Index 3: a join used to get Student and Exam name
Basically, I guess what I am asking is: Should an index be created for each separate query? Will the SQL server know which index to use?