- An index is created by
aaaaaaaaaaaa¯create index <index-name>
on r (<attribute-list>)
- The attribute list is the list of attributes in relation r
that form the search key for the index.
- To create an index on bname for the branch relation:
aaaaaaaaaaaa¯create index b-index
on branch (bname)
- If the search key is a candidate key, we add the word unique
to the definition:
aaaaaaaaaaaa¯create unique index b-index
on branch (bname)
- 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.