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).
- The
BOOL/BOOLEANkeyword is equivalent toTINYINT. - The
INTkeyword is equivalent toINTEGER.
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, andSERIAL. -
Fixed-point types:
DECIMALandNUMERIC. -
Floating-point types:
FLOATandDOUBLE. -
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 is123, it will be displayed as00123. -
DECIMAL(10, 5) ZEROFILL: When the data value is123.456, it will be displayed as00123.45600.