08. Oracle Database -Data Types
08. Oracle Database -Data Types
Contents
1) Numeric Data Types ............................................................................................................................ 1
i. NUMBER ............................................................................................................................................. 1
ii. FLOAT................................................................................................................................................... 1
iii. INTEGER .............................................................................................................................................. 2
2) Character Data Types .......................................................................................................................... 2
i. CHAR .................................................................................................................................................... 2
ii. VARCHAR2 ......................................................................................................................................... 3
3) Date/Time Data Types ........................................................................................................................ 4
i. DATE ..................................................................................................................................................... 4
ii. TIMESTAMP ....................................................................................................................................... 4
• Length: Up to 38 digits.
• Examples:
I. NUMBER – Basic number with maximum precision.
II. NUMBER(10) – Number with 10 digits of precision.
III. NUMBER(10, 2) – Number with 10 digits total, 2 after the decimal.
IV. NUMBER(5, 0) – Number with 3 digits and no decimals.
ii. FLOAT
• Explanation: Stores numeric data with floating-point precision.
• Length: Up to 38 digits.
• Examples:
iii. INTEGER
• Explanation: A whole number with no fractional or decimal part, INTEGER is a
subtype of NUMBER with precision 0 (no decimals).
• Length: Up to 38 digits.
• Examples:
o If the input is shorter than the specified length, it pads the remaining
space with blanks (spaces).
• Examples:
ii. VARCHAR2
• Explanation:
• Examples:
• Examples:
o 2024-12-25 10:00:00.
ii. TIMESTAMP
• Explanation: Date and time with fractional seconds.