Numeric Type
Numeric Data Type - Aliases
We allow aliases that can be used interchangeably with the primary data types. However, while these aliases can be used, they will be mapped to their corresponding primary data types during data processing.
Here, we’ll discuss the numeric data type aliases:
INTEGER Alias
The INTEGER
alias is an alternative name for the INT
data type. For example, the following two queries are functionally the same:
CREATE TABLE ExampleTable (
id INTEGER,
);
-- Functionally the same as the previous table
CREATE TABLE AnotherTable (
id INT,
);
It’s important to note that even though
INTEGER
is used, the data is stored and treated as INT
.LONG Alias
The LONG
alias is often used to represent larger integer values. For example:
CREATE TABLE LargeValues (
value LONG,
);
-- Functionally the same as the previous table
CREATE TABLE LargeValuesEquivalent (
value BIGINT,
);
Any usage of
LONG
is stored and treated as BIGINT
.FLOAT Alias
The FLOAT
alias corresponds to the REAL
data type. For example:
CREATE TABLE FloatExample (
price FLOAT,
);
-- Functionally the same as the previous table
CREATE TABLE FloatEquivalent (
price REAL,
);
When you use
FLOAT
, it’s stored and treated as REAL
.DOUBLE Alias
The DOUBLE
alias is used to define DOUBLE PRECISION
floating-point numbers. For example:
CREATE TABLE DoubleExample (
measurement DOUBLE,
);
-- Functionally the same as the previous table
CREATE TABLE DoubleEquivalent (
measurement DOUBLE PRECISION,
);
When you use
DOUBLE
, it’s stored and treated as DOUBLE PRECISION
.