Datatype Sub-Datatype Description Storage

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Datatype Sub-Datatype Description Storage

Character Used to store fixed length of string or 32767


Data Type CHAR value. bytes

This is same as CHAR, and both are


32767
used alternatively. CHAR is most
bytes
CHARACTER commonly used.

This is also similar to CHAR, where


strings are stored. This datatype will
define fixed length but the actual
length of the string will be the length
of the value i.e.; if VARCHAR2(10) is
defined on column NAME and if
NAME has one value 'James', then
the length of that column value is 5,
instead of 10. In the case of CHAR, it
will be always 10; the space after the
names will be filled with NULLS.

32767
VARCHAR2 Subtypes: Following bytes
sub type defines same length value.

Sub Data
Description
types

STRING
they are similar to
VARCHAR2, only the
name difference
VARCHAR2 VARCHAR

NCHAR Stores National Character data 32767


(Unicode) within the specified length. bytes

This is similar to VARCHAR2, but 32767


NVARCHAR2 used to store unicode values. bytes

This datatype is used for such data


like music, video, graphics etc where
conversion of datatype between 32767
different systems is not required. bytes
They are representing in bits and
RAW bytes.

Used to store variable length of


strings with backward compatibility.
We can store very large data in it.
But it is usually recommended to use
LOB when there is a need for LONG.
32760
Because LOB has less restriction on
bytes
storage and conversions, and have
more features added when there is a
new release. LONG columns are
preferred in SELCT or UPDATE
LONG statements than tables.

This is combination of LONG and 32760


LONG RAW
RAW datatypes. bytes

The ROWID data type represents


the actual storage address of a row.
And table index identities as a logical  
ROWID. This data type used to store
ROWID backward compatibility.

UROWID[(size)] The UROWID data type identifies as 4000


universal ROWID, same as ROWID
data type. Use UROWID data type
bytes
for developing newer applications.

Relational Model

Table : Table 1 Student, Table 2 Student_Course


Attributes: Column of Table
For Student Table 1 attributes are STUD_NO, STUD_NAME,
STUD_COUNTRY, STUD_PHONE, STUD_AGE
Primary Key : STUD_NO for table 1 (Student), COURSE_NO
NO for table 1 (Student_Course)
Foreign Key : STUD_NO for table 2 (Student_Course)

You might also like