15.10 - Example: Creating a Table with a Derived Period Column - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1144-151K

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