Wednesday, January 18, 2017

Operators in Oracle DBMS

15. OPERATORS:

1. Arithmetic Operators:

   +   -   *   /

-> To perform Arithmetic operation on users data & on table data.
-> If the calculations is on users data, use dual table.

EX:1. select 100 + 200 - 1000*4 from dual; (it only show operation at once)

EX:2. select 0.25*75000 from dual;

EX:3. select (25*75000)/100 from dual;

# on table data:

EX:4. display emp name, sal, 20% of salary as bonus and also final salary.
-> select ename, sal "Actual",
   0.20*sal "Bonus",
   sal+(0.20*sal) "Final Sal"
   from emp;

EX:5. Display acc_no, balance, 12% as interest.
-> select actNo, act_bal "balance",
   0.12*act_bal "interest"
    from cuts_dtls;


2. Relative Operators:

   =   <   >   <=   >=

These operators used to compare values. we can specify conditions in the select query.

You may also like: -->  Commands in Oracle DBMS

No comments:

Post a Comment