Example: SHOW TABLE with REFERENCES Constraint - Analytics Database - Teradata Vantage

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-10-04
dita:mapPath
jco1628111346878.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
mdr1472255012272
lifecycle
latest
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 );