So in this section we're going to focus on what are called logical operators.
Actually we're focusing on operators in general and most of the ones we're going to work with are logical
operators that distinction doesn't really matter though.
I'm just going to call them all logical operators and they allow us to add logic into our sequence statements.
So up until this point we've seen things like well like what.
Which allows us to select things based off of you know text looking or containing certain strings matching
patterns.
We've seen how to do things where we can check you know select all books where the title is exact the
Lincoln and the Bardo or where a released year is exactly 2013.
But there's a whole slew of other things that we'd like to be able to select based off of.
And that's what we're going to focus on in this section.
So we're going to see how to do things like select all books not published in 2017.
Right now we don't have a way of doing that.
Or what about select all birthdays between two different dates.
So not just all birthdays that are exactly you know April 22nd 1990 or 1992 or whatever it is.
But between those two dates or select all items so this is some table I made up called items all items
that are in stock and price below 1999.
So that's two different things.
We know how to select all items that are in stock.
But there's a second component which is not only the need to be in stock but they need to be priced
below 1999.
And right now we don't know how to do that either.
With that lengthy introduction out of the way let's take a look at some of our first ones.
So the actual first one we're going to look at is called not equal.
And it looks like this exclamation point and an equal sign.
So we've seen hundreds of things using equal sign.
Right.
We've done you know select let's do title released here from books where Let's do release year so we're
released here is exactly 2017.
So we've seen how to do this you know with equal sign.
We've been doing it all the time.
However what if I want to do the opposite.
I want all books that were released in any year excluding 2017.
So what we want to do is basically replace that equal sign with a not equals.
So we could do that.
So like title from books where a year is not equal to 2017 if you're familiar with any programming languages
you've probably come across this not equals.
It's a pretty universal way of writing not equals.
So let's give it a shot.
Recall this and just replace it with not equals.
And now you can hopefully see that we get everything back except for Lincoln and the bardo.
And of course if there is more than one book released in 2017 then we would get any book back or all
books back except that those books from 2017 so we can see that it's gone.
We could do the same thing but instead of working with this year what if we do it with author.
So let me just start over here.
Let's select the title and author last name from books and we'll start just with all of them.
And then let's select where author last name is exactly equal to Harris.
So we have two Harris's where author name equals Harris just like that and we get those too.
And by just flipping the switch here.
That exclamation point we now get everything except those two.
OK.
So hopefully you get the point by now.
Not equals works like you would expect if you're not familiar with the exclamation point.
It might take a little bit of getting used to but otherwise it's pretty straightforward.
It's the opposite of equals awesome.
So that's the first one that we're taking a look at but we have quite a few more.
Next up we're going to talk about something very similar which is not like.