@@ -68,3 +68,42 @@ select * from employee order by salary desc limit 1;
68
68
69
69
# Write a query to find the employee who is getting minium salary?
70
70
select * from employee order by salary limit 1;
71
+
72
+ # Conditional Operators -> < , > , <= , >=
73
+ # Logical Operator -> AND, OR, NOT
74
+
75
+ select * from employee;
76
+
77
+ # list all employees who are getting salary more than 20000
78
+ select * from employee where salary>20000;
79
+
80
+ # list all employees who are getting salary more than or equal to 20000
81
+ select * from employee where salary>=20000;
82
+
83
+ # list all employees who are getting less than 20000
84
+ select * from employee where salary<20000;
85
+
86
+ # list all employees who are getting salary less than or equal to 20000
87
+ select * from employee where salary<=20000;
88
+
89
+
90
+ # filter the record where age of employees is equal to 20
91
+ select * from employee where age=20;
92
+
93
+ # filter the record where age of employees is not equal to 20
94
+ # we can use != or we can use <>
95
+ select * from employee where age != 20;
96
+ select * from employee where age <> 20;
97
+
98
+ # find those employees who joined the company on 2021-08-11 and their salary is less than 11500
99
+ select * from employee where hiring_date = '2021-08-11' and salary<11500;
100
+
101
+ # find those employees who joined the company after 2021-08-11 or their salary is less than 20000
102
+ select * from employee where hiring_date > '2021-08-11' or salary<20000;
103
+
104
+ # how to use Between operation in where clause
105
+ # get all employees data who joined the company between hiring_date 2021-08-05 to 2021-08-11
106
+ select * from employee where hiring_date between '2021-08-05' and '2021-08-11';
107
+
108
+ # get all employees data who are getting salary in the range of 10000 to 28000
109
+ select * from employee where salary between 10000 and 28000;
0 commit comments