A data type is an attribute that defines the types of data an object has. The data type can be defined during a table creation time.
Apache Derby provides different categories of data types that are mentioned below.
1. Numeric Data Types
Numeric data types include the following types, which provide storage of varying sizes.
1.1 Integer Numeric Data Types
Below is the list of integer numeric data types.
DataType | Size | From | To | SMALLINT | 2 bytes | -32768 | 32767 | INTEGER | 4 bytes | -2,14,74,83,648 | 2,14,74,83,647 | BIGINT | 8 bytes | -9.22337E+18 | 9.22337E+18 |
---|
1.2 Approximate Numeric Data Types
Below is the list of approximate numeric data types.
DataType | Size | From | To | REAL | 4 bytes | -3.40E + 38 | 3.40E + 38 | DOUBLE PRECISION | 8 bytes | -1.79E + 308 | 1.79E + 308 |
---|
1.3 Exact Numeric Data Types
Below is the list of exact numeric data types.
DataType | From | To | DECIMAL | 1E+38 | 10^38 -1 | NUMERIC | 1E+38 | 10^38 -1 |
---|
2. CHAR Data Type
CHAR is used to provide fixed-length storage of strings.
DataType | From | To | CHAR | 1 | 254 |
---|
3. BIGINT Data Type
BIGINT is used to provide 8 bytes of storage for integer values.
DataType | Size | From | To | BIGINT | 8 Bytes | -9.22337E+18 | 9.22337E+18 |
---|
4. DATE Data Type
The DATE data type is used to provide storage of a year-month-day in the range supported by java.sql.Date.
5. VARCHAR Data Type
The VARCHAR is used to provide the variable length of storage of strings.
6. INTEGER Data Type
The INTEGER data type is used to provide 4 bytes of storage for integer values.
DataType | From | To | INTEGER | -2147483648 | 2147483647 |
---|