Professional Documents
Culture Documents
Database Management System: Oracle 8.x
Database Management System: Oracle 8.x
Oracle 8.x
Data Types
Char( size) : max( 255 character)
:Padded with spaces
Varchar(size): max(2000 char)
:not padded
Number(p,s): p=38 digits
s=125 zeros
Date: DD-MON-YY
Long: variable length char string up to 2GB
(Substring cannot be applied)
RAW:picture or images upto 255 bytes
LONGRAW: 2GB
Creating a Table
Table created
Retrieving data from
table
(DML statements)
SQL> select *From < table Name>;
DEFAULT: Ascending
Continue ……..
Select < attribute list>
From <table name>
Where < condition> (optional)
Order By attribute_name;
Default in ascending order.
Select < attribute list>
From <table name>
Where < condition> (optional)
Order By attribute_name desc;
Example
SQL> select empno,ename
From emp
Where deptno=5
Order by empno;
Default Ascending
AND
OR
NOT
AND Operator
SQL> select <attribute list>
from <table name>
where condition1 and condition2;
Having ( condition)
Group By and Having
SQL> select aggregate_function( column name)
from <table name>
group by <column name>
having <condition>;
SQL> select sum(salary),deptno
from emp
group by deptno
having salary>1000;
Constraints
1. Column Level
( if apply on single column)
2. Table Level
( if apply on more than one column)
Table Level
2. UNIQUE
attribute value will be unique but at
least one time it will accept null
value.
NOT NULL
1. Equi-join