Data types

The smallest unit of data that can be manipulated in SQL is called a value. Values are interpreted according to the data type of their source.

Sources include:
  • Constants
  • Columns
  • Functions
  • Expressions
  • Special registers
  • Variables (such as host variables, SQL variables, global variables, parameter markers, module variable, and parameters of routines)
  • Boolean values

All data types include the null value as a possible value. The null value is a special value that is distinct from all non-null values and thereby denotes the absence of a (non-null) value. Although all data types include the null value, a column defined as NOT NULL cannot contain null values.

A Unicode database also supports national character strings that are synonyms for graphic strings.

Built-in and user-defined data types

Data types that are pre-defined for use within the database management system are called built-in data types. Figure 1 shows the supported built-in data types.
Figure 1. Built-in Data Types
Built-in Data Types
Support for the following user-defined data types is also provided:
  • Array
  • Cursor
  • Distinct
  • Row
  • Structured