16.20 - Example: SHOW TABLE with REFERENCES Constraint - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Data Definition Language Syntax and Examples

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Content Type
Programming Reference
Publication ID
B035-1144-162K
Language
English (United States)
Last Update
2019-05-24

Table t1 is created with a referential constraint which specifies that FOREIGN KEY columns (f1 ) reference the unique primary index columns in table good_1.

     CREATE TABLE t1 (
       f1 INTEGER NOT NULL
       f2 INTEGER)
     PRIMARY INDEX (f1)
     FOREIGN KEY (f1) REFERENCES good_1;

SHOW TABLE on t1 returns the following CREATE TABLE SQL text.

     SHOW TABLE t1;
     CREATE SET TABLE t1, NO FALLBACK,
        NO BEFORE JOURNAL, NO AFTER JOURNAL (
     f1 INTEGER NOT NULL,
     f2 INTEGER)
     PRIMARY INDEX ( f1 )
     FOREIGN KEY ( f1 ) REFERENCES personnel.good_1( column_1 );