16.20 - Example: Creating a Table with a Derived Period Column - 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
Language
English (United States)
Last Update
2019-05-24
dita:mapPath
wkf1512081455740.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval

This example creates a table, employee , with a derived period column, jobduration , where jobstart is the period begin column name and jobend is the period end column name.

CREATE TABLE employee (
eid INTEGER NOT NULL,      
name VARCHAR(100) NOT NULL,
deptno INTEGER NOT NULL,
jobstart DATE NOT NULL,
jobend DATE NOT NULL,
PERIOD FOR jobduration(jobstart, jobend) 
) PRIMARY INDEX(eid);