Friday, August 5, 2016

SQL AND & OR operators



The SQL AND & OR operators used to filter the record that is based on one or more condition.
The AND operator used to show the record if both first and second condition are true.
The OR operator used to show the record if either the first condition OR second condition is true.
Example – Firstly we create the table “emp

 
AND operator Example –

select * from emp where id='1' AND name='sachin'

Output – 

OR operator Example –

select * from emp where id='1' OR name='pramod'

Output – 
                                                               Author - Sachin Pathak


No comments:

Post a Comment