Skip to main content

Overview

seekdb supports all standard SQL numeric types, including exact numeric types (INTEGER, SMALLINT, DECIMAL, and NUMERIC), approximate numeric types (FLOAT and DOUBLE), the BIT data type for storing bit values, and extended types (TINYINT, MEDIUMINT, BIGINT, and SERIAL).

info
  • The BOOL/BOOLEAN keyword is equivalent to TINYINT.
  • The INT keyword is equivalent to INTEGER.

Numeric type categories

The numeric types supported in the current version of seekdb are categorized as follows:

  • Integer types: BOOL/BOOLEAN/TINYINT, SMALLINT, MEDIUMINT, INT/INTEGER, BIGINT, and SERIAL.

  • Fixed-point types: DECIMAL and NUMERIC.

  • Floating-point types: FLOAT and DOUBLE.

  • Bit-value type: BIT.

When defining numeric types, you can specify the precision (field length) and scale (number of decimal places). The meanings of precision and scale may vary among different numeric types. For details, see the descriptions of each type.

ZEROFILL attribute

The ZEROFILL attribute specifies the minimum display width for numeric types and implicitly defines the type as UNSIGNED. If the actual display width of the data is less than the minimum display width, leading zeros are added to both the integer and decimal parts to reach the minimum display width.

For example:

  • INT(5) ZEROFILL: When the data value is 123, it will be displayed as 00123.

  • DECIMAL(10, 5) ZEROFILL: When the data value is 123.456, it will be displayed as 00123.45600.