Datatypes are the structural or the physical attributes of a
table. I would say that the kind of table you create is determine by the data
you are bringing into the table.
Datatypes helps determine the kind of data entered into a table. For
example Column for phone numbers will not have the same kind of dataype with
column for names.
Types of Datatypes
In oracle database, there a lot of datatypes used but I am
going to filter it to the most commonly used in your day to day tasks as an
administrator in creating your schema objects.
Here they are
1. Varchar2
:- This allows the use of variables, character and numbers in a particular
field/column.
Variables
such as *, @, #, _, -, >, %, ^, /, etc
Characters
such as alphabet A - Z
Numbers
such as 0 – 9
Examples of fields where you can use varchar2 are columns
containing email address (chukwurahisaac@gmail.com),
twitter handle @omegazee21. Etc
2. Char:-
This allows only the use of characters in a particular column.
Character
A –Z.
You can
use it in columns where you want only characters such as ‘names’ countries etc
3. Date:-
This is a datatype on its own. It stores point in time data values (data and
time) in a table.
Oracle
can store dates in the Julian era from JAN 1, 4712BCE through Dec 31 4712CE/AD.
*Note The default
date format in oracle database is DD-MM-YYYY.
4. Timestamp:- This stores date and
time info with fractional precision for seconds. The only difference from date
datatype is the ability to store time up to a precision of 9 digits.
5. Number:- This type allows only
numbers in the column used.
6. Clob:- CLOB is one of the Large Object datatypes
provided to store variable-length character data. The maximum amount of data
you can store in a CLOB column is based on the block size of the database. CLOB
can store up to (4GB–1)*
0 comments:
Post a Comment