Examples - Teradata Vantage - Analytics Database

SQL Data Types and Literals

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-06
dita:mapPath
uds1628112204571.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
exs1472253032394
lifecycle
latest
Product Category
Teradata Vantage™

Example: Numeric

Suppose the DeptNo column is defined in table Departments as follows.

CREATE TABLE Departments
   (DeptName CHARACTER(36)
   ,DeptNo SMALLINT DEFAULT 100 FORMAT '999' BETWEEN 100 AND 900
   ,ManagerID INTEGER);

When the value for the DeptNo field is not provided in an INSERT statement, then the value 100 with type SMALLINT is inserted automatically.

Example: Date Literal

The following example shows a DATE column specified with a DEFAULT date literal:

F4 DATE DEFAULT DATE '2000-01-01'

Example: Current Time

The following example shows a TIME column specified with a DEFAULT of the current time:

Stage TIME(3) DEFAULT CURRENT_TIME(3)

Example: Interval

The following example shows an INTERVAL column specified with a DEFAULT interval:

Scale INTERVAL YEAR(2) DEFAULT INTERVAL -'10' YEAR