Sunday, 9 October 2011

SQL Create- Index

nThe CREATE INDEX statement is used to create indexes in tables.
nIndexes allow the database application to find data fast; without reading the whole table.
nCreates an index on a table. Duplicate values are allowed
nCreates a unique index on a table. Duplicate values are not allowed
Syntax:
üCREATE INDEX index_name ON table_name (column_name)
üCREATE UNIQUE INDEX index_name ON table_name (column_name)
Query:
üCREATE INDEX EMPIndex ON EMPtbl1 (Location)
üCREATE UNIQUE INDEX EMPIndex ON EMPtbl1 (Location)
üALTER TABLE EMPtbl1 DROP INDEX EMPIndex

No comments:

Post a Comment