Data Types In ORACLE SQL

By | July 3, 2015

Oracle Database provides following basic data types for attributes defined with CREATE TABLE clause of database.

Data Types Descriptions
Char (N) Fixed Length Character Data. Maximum size is 255 bytes.
Varchar (N) Variable Length Character Data. Maximum up to 2000 characters.
Varchar2 (N) Variable Length Character Data. Maximum up to 4000 characters.
Number (P,S) Numeric data type for integers and Real Numbers.

P = Overall number of Digits. Maximum values 38.

S = Number of digits to the right of the decimal point.

      (Maximum -84 to +127)

Date Date data type for storing date and time.

The default format for a date is: DD-MMM-YY.

LONG Variable Length Character Data (Up to 2GB)
CLOB Character Data (Up to 4GB)
RAW & LONG RAW RAW Binary Data
BLOB Binary Data (Up to 4GB)
BFILE Binary Data stored into external file (Up to 4GB)
ROWID base-64 number system representing the unique address of a raw in its table.
DATETIME Data Types
TIMESTAMP Date with Fractional Seconds
INTERVAL YEAR TO MONTH Stored as an interval of years and months.
INTERVAL DAY TO SECOND Stored as an interval of days, hours, minutes and seconds.

Note: In Oracle-SQL there is no data type Boolean. It can, however, be simulated by using either char(1) or number(1).

Leave a Reply

Your email address will not be published. Required fields are marked *