Index Definition in SQL
Next: Multiple-Key Access
Up: Indexing & Hashing
Previous: Comparison of Indexing
-
Some SQL implementations includes data definition commands to create and drop
indices.
The IBM SAA-SQL commands are
- An index is created by

- The attribute list is the list of attributes in relation
that form the search key for the index.
- To create an index on bname for the branch relation:

- If the search key is a candidate key, we add the word unique
to the definition:

- If bname is not a candidate key, an error message will appear.
- If the index creation succeeds, any attempt to insert a tuple
violating this requirement will fail.
- The unique keyword is redundant if primary keys have been
defined with integrity constraints already.
-
To remove an index, the command is

Page created and maintained by Osmar R. Zaï ane
Last Update:
Wed Nov 15 11:12:38 PST 1995