Home > DeveloperSection > Forums > How to do database column indexing?
Ailsa Singh
Ailsa Singh

Total Post:10

Points:70
Posted on    April-08-2016 8:39 AM

 Database Database  SQL Server  Index 
Ratings:


 2 Reply(s)
 576  View(s)
Rate this:
Can any one tell me how can I index columns, when our data-Set increases in size.
Because whenever I click on different links I didn't get the correct pages.

So, please tell me how column indexing works at a database agnostic level.


Tarun Kumar

Total Post:213

Points:1635
Posted on    April-11-2016 2:22 AM

To create Indexing we need a table - so we assume that you already created a table. After that create an Index on the table that don't allowed duplicate values the table you already have.
Here we will create two indexs first will allow duplicate values and the second one will not allow duplicate values, like this:

This Index allowd duplicate values, use like this:
CREATE INDEX indexName1 ON tableName(columnName)
This Index don't allow duplicate values, use like this:
CREATE UNIQUE INDEX indexName2 ON tableName (columnName)
After that create a Clustered Index, like this:
CREATE CLUSTERED INDEX clusterIndexName on SALES(ID);
and at last to create Non-clustered index, use like this:
CREATE NONCLUSTERED INDEX nonClusterIndexName ON SALES(ProductCode);
I hope the above solution will be helpful for you.

Revathi Parvathi
Revathi Parvathi

Total Post:1

Points:7
Posted on    September-26-2016 9:00 AM

Good.

Don't want to miss updates? Please click the below button!

Follow MindStick