Teradata Data Types

Each column in a table is associated with a data type. Data types specify what kind of values will be stored in the column. Every data value belongs to an SQL data type.

Teradata Database supports the following categories of data types. For a complete list of supported data types and detailed information about each data type, see the below table, such as:

Data TypeDescriptionData Type Examples
ArrayAn Array data type is used to store and access the multidimensional data. It can store many values of the same specific data type in a sequential or matrix-like format.
  1. One-dimensional (1-D) Array
  2. Multidimensional (n-D) Array
ByteByte data types store raw data as logical bitstreams. These data types are stored in the client system format.

Teradata Database does not translate these data types. The data is transmitted directly from the memory of the client system.

  1. BYTE
  2. VARBYTE
  3. BLOB (Binary Large Object)
CharacterCharacter data types represent characters that belong to a given character set.
  1. CHAR
  2. VARCHAR
  3. CLOB (Character Large Object)
DatasetA complex data type that represents self-describing data stored in a format conforming to some schema.AVRO
DateTimeDateTime data types represent a date, time, and timestamp values.
  1. DATE
  2. TIME
  3. TIMESTAMP
  4. TIME WITH TIME ZONE
  5. TIMESTAMP WITH TIME ZONE
GeospatialGeospatial data types represent geographic information and provide a way for applications that manage, analyze, and display geographic information to interface with Teradata Database.
  1. ST_Geometry
  2. MBR
IntervalInterval data types represent a period. For example, an Interval value can represent a period that includes several years, months, days, hours, minutes, or seconds.
  1. Interval Year
  2. Interval Year to Month
  3. Interval Month
  4. Interval Day
  5. Interval Day to Hour
  6. Interval Day to Minute
  7. Interval Day to Second
  8. Interval Hour
  9. Interval Hour to Minute
  10. Interval Hour to second
  11. Interval Minute
  12. Interval Minute to second
  13. Interval Second
JSONThe JSON data type represents that data which are in JavaScript Object Notation format.JSON
NumericNumeric data types represent a numeric value that is an exact numeric number such as integer or decimal or an approximate numeric number such as floating-point.
  1. BYTEINT
  2. SMALLINT
  3. INTEGER
  4. BIGINT
  5. DECIMAL/NUMERIC
  6. FLOAT/REAL/DOUBLE PRECISION
  7. NUMBER
ParameterParameter data types are used only with input or result parameters in a function, method, stored procedure, or external stored procedure.
  1. TD_ANYTYPE
  2. VARIANT_TYPE
PeriodA Period data type represents a time period, where a period is a set of contiguous time granules that extends from a beginning bound up to but not including an ending bound.
  • PERIOD(DATE)
  • PERIOD(TIME)
  • PERIOD(TIME WITH TIME ZONE)
  • PERIOD(TIMESTAMP)
  • PERIOD(TIMESTAMP WITH TIME ZONE)
UDTUDT (User-Defined Type) data types are custom data types that are defined to model the structure and behavior of the data used by the applications.
  1. Distinct
  2. Structured
XMLThe XML data type represents XML content. The data is stored in a compact binary form that preserves the XML document's information set, including the hierarchy information and type information derived from XML validation.XML

Data Type Attributes

The Teradata Database supports the following core data type attribute, such as:

Data Type AttributeDescription
Not NullIt means the fields of a column must contain a value; they cannot be null.
UppercaseIt specifies the character data for a column is stored as uppercase.
[NOT] Case-SpecificIt specifies the case for character data comparisons and collations.
FormatIt controls the display of expressions, column data, and conversions between data types.
TitleIt defines a heading to display or print the different results from the column name, which is used by default.
AsIt assigns a temporary name to an expression.
NamedNamed is a Teradata extension to the ANSI standard. For ANSI compliance, use AS instead of Named.
DefaultIt is a user-defined default value that inserts in the field when a value is not specified for a column in an INSERT statement.
With DefaultIt is a system-defined default value that inserts in the field when a value is not specified for a column in an INSERT statement.
With Time ZoneIt is used with the TIME or TIMESTAMP data type to specify a TIME or TIMESTAMP value with displacement from UTC as defined for the system.
Character SetIt specifies the server character set for a character column.

Next TopicTeradata Tables




Latest Courses