Relational operators, Logical Operators, Between operator, IN operator, Like operators

 

Relational or Comparison operators

Ø  <, >, =, <=, >= ,Not equal to (<>, !=, ^=)

     Select * from emp where deptno=10;

     Select * from emp where deptno<>10; this means not equal to 10.

     Select * from emp where sal>1500;

Logical operators

Ø  AND, OR, NOT

Ø  Select * from emp where job=’MANAGER’ AND deptno=10;

Ø  Select * from emp where job=’MANAGER’ OR deptno=10;

Ø  Select * from emp where NOT SAL=0;

Between …. And , Not Between ….. And

Ø  Select * from emp where sal between 0 and 1500;

Ø  Select * from emp where sal not between 0 and 1500;

IN , NOT IN

Ø  Select * from emp where job in('PRESIDENT','CLERK');

Ø  Select * from emp where job not in('PRESIDENT','CLERK');

Like, Not Like

Ø  ‘%’ represents any sequence of zero or more characters

Ø  ‘_’ represents single char only in that position

Ø  Select * from emp where ename like ‘M%’;

Ø  Select * from emp where ename not like ‘M%’;

Ø  Select * from emp where ename like ‘_A%’;

Ø  Select * from emp where ename not like ‘_A%’;


     Please watch and subscribe my Channel

     Kamal SQL CLASSES in Telugu

Comments

Popular posts from this blog

PLSQL CURSOR