select * from employee
where salary >30000
select * from employee
where salary < 30000
select * from employee
where salary=40000
select * from employee
where salary >=35000
select * from employee
where age <= 25
select * from employee
where department != 'IT' ---or <>
** AND , OR**
select * from employee
where department='IT' and salary>30000
select * from employee
where department='IT' or department='Finance'
select * from employee
where city='Chennai' and salary>30000
select * from employee
where city!='Chennai'
select * from employee
where salary>30000 and age<30
select * from employee
where department='IT' or salary>45000
BETWEEN
select * from employee
where salary between 30000 and 40000
select * from employee
where age between 25 and 30
select * from employee
where salary not between 30000 and 40000
IN , NOT IN
select * from employee
where department in ('IT','HR','Finance')
select * from employee
where city in ('chennai','bangalore')
select * from employee
where department not in ('HR', 'Finance')
Like
remember :
- % → zero or more characters
- _ → exactly one character
select * from employee
where employee_name like 'v%'
select * from employee
where employee_name like '%a'
select * from employee
where employee_name like '_a%'
select * from employee
where employee_name like '_i%'
NUll
select * from employee
where city is Null
select * from employee
where city is not Null
select *
from employee
where city='Chennai;
and department in ('HR','IT')
select * from employee
where salary>30000 and department!='IT'
select * from employee
where city in ('Chennai','Bangalore') and salary>30000
select * from employee
where salary between 30000 and 50000
and department='IT'
select *
from employee
where department in ('IT','Finance') and
salary >40000
select * from employee
where salary>=30000 and age<30
and department in ('IT','HR')
and city!='mumbai'
Top comments (0)