Numeric Type
Int Type
The INT
data type represents whole numbers without decimal points. It is a 32-bit signed integer with a range from -2147483648 to 2147483647.
Format
Example
The following is an example of how to create a column using an INT
type.
Now, run the following query to display the table.
It will result in a table show below.
Bigint Type
The BIGINT
data type stores large whole numbers that exceed the INT
range. It is a 64-bit signed integer with a range from -9223372036854775808 to 9223372036854775807.
Format
Example
The following is an example of how to create a column using the BIGINT
type:
Now, run the following query to display the table:
You will get the following output:
Real Type
The REAL
data type is a 32-bit floating-point number compliant with the IEEE 754 binary32 format.
Format
Example
1. Create a Table
Here, we are creating a table with a REAL
column type.
Display the table with the following query.
The stored value is shown below.
2. Rounding
Rounding might happen if the precision of an input number is too high.
Display the table with the following query.
The table below shows the value after rounding.
3. Create a Table With Numbers Exceeding the Range
The REAL
type only stores 32-bit floating-point numbers. In this example, we input the numbers that exceed the range.
Display the table with the following query.
The final output will only return numbers that match the range.
Double Precision Type
The DOUBLE PRECISION
data type is a 64-bit floating-point number compliant with the IEEE 754 binary64 format.
Format
Example
1. Create a Table
Here, we are creating a table with a DOUBLE PRECISION
type column.
Display the table with the following query.
The output is shown below.
2. Rounding
Rounding might happen if the precision of an input number is too high.
Display the table with the following query.
The table below shows the value after rounding.
Scientific Notation Support
Oxla now supports scientific notation for floating-point types. This feature allows you to use expressions like 1.1e+3, 1e-20, 1.1e02 and similar in your queries.
Example
Output