Hello and welcome to this video and this video we are going to discuss about the logical operators,
which we have discussed in the previous video, Logical Operator End and or.
Also, we are going to practically prove the truth to both, which we have seen in the previous video.
I am going to use the same table which I have created previously, that they blamed employee stablemate
consist of three different records and three columns, employed employee name and employee department.
I'm going to go into the school tab wherein the automated generated query that they select are from
employees is already there.
So I am going to create some conditional statements.
I'm going to use employee name equals Herry.
To make this statement true, as I said previously, that logical operators are being used between two
different conditional statements.
So the first statement is that clause employee Namik will do very amusing and operator here and taking
another column that is employee department and writing it equal to EITE.
That means.
McQuary says that select all the records from the employee where employee Niemiec was an employee department
equals I.T..
So according to the employee stable statement, that is employee name equals 80 and statement B, that
is employee department equals I.T. Both these statements are true, according to the employee stable.
So I am getting the output of Harry as an output.
You can see down with your.
Now I go back to school or you can I get in line or regulate itself, so I am changing the department,
which, according to the employee, stable herie belongs to I.T. department, not H.R. departments.
So I am not getting any results, which simply means that statement is true.
But Statement B makes it false.
So the output of true and false becomes false, according to the true table discussed.
As you can see over here, if anyone of this statement is false, the output is always going to be false.
Now, I am going to change this again, go to Escuela.
Just to see how the tables looks like and what is the data inside it, so here you can see that Harry
belongs to I.T. department, NorTech, our department.
So that is why when I put department.
So when I put employee department equals I.T., I get the result, but when I put Heddy Department H.R.,
I am not getting any results.
So now I'm trying some other condition is employee ID equals to an employee names name equals.
Peter.
This statement is, again, false because employee I.D. three is better not to, so I am not going to
get any result over here.
So now let's make this statement true so that to verify that and operate over an operator will work
only if both the statements are true.
It is not going to work either.
One of the statement is false.
If both those statements are false, we are not going to get any results.
So this is all and operator behaves.
Let's test for our operator for the same conditions, employee ID equals to employee name equals Eddie.
We are getting exact same result.
That means if both the conditions are true, we are getting the output is true according to that table
over your if both the conditions are true, we are always going to get the result is true according
to the all table, which is exactly similar to end to table.
But where the difference is, so the difference is a real.
Let's dig an employee I.D., which not at all exist in the table that is employed equals for an employee
name equals 80 and let's see what the output is.
So, yes, we are getting dorper.
That means if anyone of the condition is true, we are getting the result.
This is how all should behave according to the truth table.
And it is behaving, as you can see in the practical overyear.
If I change this to end, I am not going to get any it is all because and says that I will not allow
if anyone of this statement is false, but says that I will allow if anyone of this statement is true,
this is where the difference is.
If both statements are true, then the output is true.
If anyone of this statement is true, then the output is true according to all.
So this is where the major difference is.
Let's change this to Oregon and see, yes, we are getting the results of one statement is true.
So let's try to make this again, both the statements through employee edition and name equals John.
So, yes, we are getting the result as expected.
So I hope you guys understood about the difference between and and or logical operators.
That's it for this video.
Thank you so much.