Updated on 2022-11-18 GMT+08:00

Integer

Table 1 Integer

Name

Description

Storage Space

Value Range

Literal

TINYINT

Tiny integer

8 bits

-128 to 127

TINYINT

SMALLINT

Small integer

16 bits

-32,768 to +32,767

SMALLINT

INTEGER

Integer

32 bits

-2,147,483,648 to +2,147,483,647

INT

BIGINT

Big integer

64 bits

-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807

BIGINT

Example:

--Create a table containing TINYINT data:
CREATE TABLE int_type_t1  (IT_COL1 TINYINT) ;    
--Insert data of the TINYINT type:
insert into int_type_t1  values (TINYINT'10');    
--View data:
SELECT * FROM int_type_t1;  
 it_col1    
---------   
 10  
(1 row)    
--Drop a table:
DROP TABLE int_type_t1;