6 - Filtering Data by using (where , and , or , ! , > , <)

 

ORIGINAL TABLE GENERATED


List from which we filter Data 


data from table where emp_id has value 2


select*from employees where emp_id=2;



data from table where value of salary is 900


select*from employees where salary=900;




data from table where first_name is Tom as well as salary is 900


select*from employees where first_name='Tom' and salary=900;




data from table where either the last_name is Khan or salary is 8000


select*from employees where last_name='Khan' or salary=8000;




data from table where either the last_name is Khan or salary is greater than 80000


select*from employees where last_name='Khan' or salary>80000;




data from table where the last_name is Khan as well as salary is greater than 80000


select*from employees where last_name='Khan' and salary>80000;




data from table where either last_name is Geller or salary is not equal to 50000


select*from employees where last_name='Geller' or salary!=50000;




data from table where value of salary is between 600 and 10000


select*from employees where salary between 600 and 10000;




data from table where value of salary is any of the values given 50000,8000,900


select*from employees where salary in (50000,8000,900);








Comments

Popular posts from this blog

5 - DML commands used in MySQL WorkBench

INDEX OF Zeek MySQL

4 - DDL commands used in MySQL Workbench