Example: SHOW TABLE with REFERENCES Constraint - 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™

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 );