Example: Creating an Unnamed Nonunique Secondary Index - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
wgr1555383704548.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

The first example creates a nonunique secondary index on the dept_no column of the employee table:

     CREATE INDEX (dept_no) ON employee;

The UNIQUE option is not used in this request because multiple rows contain the same department number. The index should be useful, however, because department numbers are often used for conditional retrievals and for ordering employee listings.

The second example creates an unnamed nonunique secondary index on the column_1 column of a table named table_4.

     CREATE INDEX (column_1) ON table_4;