0% found this document useful (0 votes)
26 views5 pages

Session 1

The document discusses different types of operators and datatypes in PL/SQL including arithmetic, relational, logical, special operators and set operators. It also covers various datatype categories like character, number, date/timestamp, raw/long raw and LOB datatypes.

Uploaded by

Ali Haider
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views5 pages

Session 1

The document discusses different types of operators and datatypes in PL/SQL including arithmetic, relational, logical, special operators and set operators. It also covers various datatype categories like character, number, date/timestamp, raw/long raw and LOB datatypes.

Uploaded by

Ali Haider
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

PL- Sql operators:

-------------------
Arithmetical operators:
-------------------------
+ addition
- subtract
* Multiplication
/ division (quotient)

Mathematical function
Mod(10,3) => 1

10+3=>13
10-3=7
10*3 =30
10/3 => 3.3333
MOD(10,3) =>1

Relational operators or Comparision operators:


---------------------------------------------
>
<
<=
>=
=
!= or <>

a>b

Logical operators:
------------------
and
or
not

and
a b c=a*b
0 0 0
0 1 0
1 0 0
1 1 1

Note : if all input values are true then output is true else false.

or
a b c=a+b
0 0 0
0 1 1
1 0 1
1 1 1

Note : if any one input values are true then output is true else false.

Not
a c
0 1
1 0
Special operators:
-------------------
in
not in
between
not between
like
not like
is null
is not null

Set operators:
--------------
union
union all
intersect
except /Minus

Assignment operators:
--------------------
:=
a:=100;
b:=200
c:=a+b;
d:='14-06-19'
e:='Ravi'

Concatenation operators(||)
--------------------------
'Sql'||'School' => SqlSchool

100 + 200 => 300

PLsql datatype or Column types or Fieldtypes:


--------------------------------------------
Character datatypes( a to z and 0 to 9)
-----------------------------------------
char(2000) - Fixed length char - Ascii - 1 byte - Static memory allocation - ANSI
syntax

varchar(2000) - Variant length char - Ascii - 1 byte - dynamic memory allocation -


ANSI syntax

varchar2(4000) - Variant length char - Ascii - 1 byte - Dynamic memory allocation -


Oracle syntax

Nchar(40) - Fixed length char - Unicode - 2 bytes - Static memory allocation

Nvarchar (40) - Variant length char - Unicode - 2 bytes - Dynamic memory


allocation.

Number datatypes:
----------------
number(10) -> 10digits

number(10,2) -> 9999999.99


int - 4 bytes -> 32 bits
or
INTEGER - 4 bytes -> 32 bits

Decimal point datatypes:


-----------------------
float - 4 bytes (Approx. 7 decimal digits)

Date and timestamp datatypes:


-----------------------------
date - 8 bytes -> by default date format -> 'dd-mm-yy'

timestamp - 14 bytes -> 'dd-mm-yy hh:mi:ss AM/PM'

Raw and Long Raw datatypes: (GUID,ROWID)


---------------------------------------
Raw - 4 bytes

long raw - 8 bytes

Large objects (LOB)


-------------------
Bfile - binary file - External
BLob - Binary large objects - Internal - image,mp3,videos
CLob - Character large object - Internal - text,document,data...

You might also like