Example: Using Indices - Advanced SQL Engine - Teradata Database

Data Dictionary

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
June 2020
Language
English (United States)
Last Update
2020-10-15
dita:mapPath
yoz1556235523563.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1092
lifecycle
previous
Product Category
Teradata Vantage™

The following SELECT statement displays index information for all the tables in the Personnel database:

SELECT TableName,ColumnName,ColumnPosition,IndexType,UniqueFlag FROM
    DBC.Indices
       WHERE DatabaseName = ’Personnel’
       ORDER BY TableName,ColumnPosition ;

The results of this query are as follows:

TableName   ColumnName   ColumnPosition   IndexType   UniqueFlag
----------  ----------   --------------   ---------   ----------
Charges     Proj_id               1             S       N
Charges     EmpNo                 1             P       N
Charges     Proj_id               2             P       N
Department  DeptNo                1             P       Y
Employee    EmpNo                 1             P       Y
Employee    Name                  1             S       N
Project     Proj_id               1             P       Y