Вы находитесь на странице: 1из 15

DEPARTMENT OF TECHNICAL EDUCATION

ANDHRA PRADESH
Name : K.Chandra Sekhar
Designation : Associate Lecturer
Branch : DCCP
Institute : Central Institute of Commerce,Tarnaka,
Hyd.
Year/Semester : V Semester
Subject : Relational Database Management System
Subject Code : CCP-505
Topic : Know the components of SQL
Duration : 50 Minutes
Sub-Topic : Explain the data types in ORACLE
Teaching Aids : PPT,Animation, Photographs
CCP505.35TO36 1
OBJECTIVES
On Completion of this period, you would
be able to know :

 What is a Data Type

 Various Data Types in ORACLE

 Brief explanation about Different Data Types

CCP505.35TO36 2
Why data types?

 To store the data in table


 Require while creating table
 Specify a data type for individual columns

CCP505.35TO36 3
What are Data types
Data Types define the domain of values that each
column can contain or each argument can have.
CHAR
VARCHAR2
LONG
NUMBER
RAW
LONG RAW
DATE
CCP505.35TO36 4
CHAR
 This Data type is used to store the Fixed Length
Character data

 Default size is 1 byte

 Maximum size is 255 bytes

 CHAR (size);

CCP505.35TO36 5
VARCHAR 2
Data type is used to store the string type of
Character data having maximum length size
bytes

 Maximum size is 2000 bytes

 We must specify size for a VARCHAR2

 Varchar 2 (size)

CCP505.35TO36 6
LONG
This Data type is used to store the string type of
Character data having long length size

 Maximum size is 2 Gigabytes or 231-1

CCP505.35TO36 7
NUMBER
This Data type is used to store the Numeric type of

data having precision “p” and scales “s”

 The precision “p” indicates Integer part of Number

 The scale “s” indicates Decimal part of Number

NUMBER ( p,s )

CCP505.35TO36 8
RAW
This Data type is used to store the RAW binary
data of length size bytes

 Maximum size is 255 bytes

We must specify size for a RAW

RAW ( size )

CCP505.35TO36 9
LONG RAW
This Data type is used to store the RAW binary
data of long length size

 Maximum size is 2 Gigabytes

 LONG RAW

CCP505.35TO36 10
DATE
This Data type is used to store the “Date” type of

data

The valid Dates range from January1, 4712 BC to

December 31, 4712 AD.

DATE

CCP505.35TO36 11
Summary :

ORACLE supports CHAR, VARCHAR2, LONG,

NUMBER, RAW, LONG RAW, ROWID, DATE Data


Types
CHAR, VARCHAR2, LONG store the Character
type of Data
NUMBER, RAW, LONG RAW are useful to store
Numerical type of Data
DATE is to store Dates from the Range of 1 January
4712 BC to 31 December 4712 AD

CCP505.35TO36 12
Quiz :

Fill in the blanks


CHAR Data type can store Maximum size of___________
255 bytes
Integers and Decimals
NUMBER Data type stores _______________________

VARCHAR2 Data type can store Maximum size of


________________
2000 Bytes
 LONG Data type can store Maximum size of ________
2GB

CCP505.35TO36 13
Frequently asked question
1. Explain SQL data types

CCP505.35TO36 14
Assignment
1. Compare all the data types available in SQL

CCP505.35TO36 15

Вам также может понравиться