Data Types | SQL Fundamentals | Teradata Vantage - 17.10 - Data Types - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Fundamentals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1141-171K
Language
English (United States)

Every data value belongs to an SQL data type. For example, when you define a column in a CREATE TABLE statement, you must specify the data type of the column. The database supports the following categories of data types.

Data Type Category Description Data Type Examples
ARRAY/VARRAY An ARRAY data type is used for storing and accessing multidimensional data. The ARRAY data type can store many values of the same specific data type in a sequential or matrix-like format.
  • One-dimensional (1-D) ARRAY
  • Multidimensional (n-D) ARRAY
Byte Byte data types store raw data as logical bit streams. These data types are stored in the client system format and are not translated by the database. The data is transmitted directly from the memory of the client system.
  • BYTE
  • VARBYTE
  • BLOB (Binary Large Object)
Character Character data types represent characters that belong to a given character set. These data types represent character data.
  • CHAR
  • VARCHAR
  • CLOB (Character Large Object)
DateTime DateTime data types represent date, time, and timestamp values.
  • DATE
  • TIME
  • TIMESTAMP
  • TIME WITH TIME ZONE
  • TIMESTAMP WITH TIME ZONE
Geospatial Geospatial data types represent geographic information and provides a way for applications that manage, analyze, and display geographic information to interface with the database.
  • ST_Geometry
  • MBR
Interval Interval data types represent a span of time. For example, an interval value can represent a time span that includes a number of years, months, days, hours, minutes, or seconds.
  • INTERVAL YEAR
  • INTERVAL YEAR TO MONTH
  • INTERVAL MONTH
  • INTERVAL DAY
  • INTERVAL DAY TO HOUR
  • INTERVAL DAY TO MINUTE
  • INTERVAL DAY TO SECOND
  • INTERVAL HOUR
  • INTERVAL HOUR TO MINUTE
  • INTERVAL HOUR TO SECOND
  • INTERVAL MINUTE
  • INTERVAL MINUTE TO SECOND
  • INTERVAL SECOND
JSON The JSON data type represents data that is in JSON (JavaScript Object Notation) format. JSON
Numeric Numeric data types represent a numeric value that is an exact numeric number (integer or decimal) or an approximate numeric number (floating point).
  • BYTEINT
  • SMALLINT
  • INTEGER
  • BIGINT
  • DECIMAL/NUMERIC
  • FLOAT/REAL/DOUBLE PRECISION
  • NUMBER
Parameter Parameter data types are data types that can be used only with input or result parameters in a function, method, stored procedure, or external stored procedure.
  • TD_ANYTYPE
  • VARIANT_TYPE
Period A 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)
UDT UDT (User-Defined Type) data types are custom data types that you define to model the structure and behavior of the data used by your applications.
  • Distinct
  • Structured
XML The XML data type represents XML content. The data is stored in a compact binary form that preserves the information set of the XML document, including the hierarchy information and type information derived from XML validation. XML

Related Information

For detailed information on data types and the related functions, procedures, methods, and operators that operate on these types, see the following documents:
  • Teradata Vantage™ - Data Types and Literals, B035-1143.
  • Teradata Vantage™ - Geospatial Data Types, B035-1181.
  • Teradata Vantage™ - JSON Data Type, B035-1150.
  • Teradata Vantage™ - XML Data Type, B035-1140.
  • Teradata Vantage™ - SQL Functions, Expressions, and Predicates, B035-1145.