Data Types of SQL
Data Types of SQL
FA17-BSE-103.
VARCHAR & VARCHAR2 The size restriction for this data This data type is used to store
type is 1-4000 bytes for table string but length of the string is
column size and 1-32767 bytes not fixed. It is always a good
for variables. practice to use VARCHAR2
instead of VARCHAR to avoid
behavioral changes.
NCHAR The size restriction for this data This data type is same as CHAR
type is 1-2000 bytes. data type but the character set
will of the national character set.
NVARCHAR2 The size restriction for this data This data type is same as
type is 1-2000 bytes. VARCHAR2 but the character
set will of the national character
set.
CLOB Maximum size for this data type CLOB data type stores the data
is 128 TB (terabyte). into the character set.
NCLOB Maximum size for this data type NCLOB stores the data into
is also 128 TB (terabyte). native character set.
LONG Maximum size for this data type Used to store large character set
is also 2 GB (gigabyte). data.
SMALLINT The size restriction for this data Same as INTEGER type except
type is 2 bytes. that it might hold a smaller range
of values
BIGINT The BIGINT data type provides 8 This data type is use
bytes of storage for integer when integer values might
values. exceed the range.
DECIMAL Maximum size is 10^38-1 and Used to store number that have
minimum size is -10 ^38+1. Hold fixed precision and scale.
5-17 bytes.
FLOAT FLOAT data can hold 8 bytes or Used to specify precision i-e
15 places after the decimal point. number of digits after the
decimal point.
TINYINT The TINYINT data type provides They are tiny in nature and used
1 byte of storage. to store integer values.
TIME Storage value of this data type The TIME data type
is 5 bytes. provides for storage of a
time-of-day value.
Displayed as 'YYYY-MM-
DD hh:mm:ss[.nnnnnnn]'
BFILE The size of BFILE is to a limited BFILE are the data types that
operating system, and they are stored the unstructured binary
read-only files and can't be format data outside the database
modified. as an operating-system file.
LONG RAW