WEBVTT

00:03.660 --> 00:08.180
So in this section we're going to focus on what are called logical operators.

00:08.250 --> 00:13.530
Actually we're focusing on operators in general and most of the ones we're going to work with are logical

00:13.530 --> 00:15.660
operators that distinction doesn't really matter though.

00:15.780 --> 00:22.770
I'm just going to call them all logical operators and they allow us to add logic into our sequence statements.

00:22.770 --> 00:26.760
So up until this point we've seen things like well like what.

00:26.910 --> 00:33.810
Which allows us to select things based off of you know text looking or containing certain strings matching

00:33.810 --> 00:34.890
patterns.

00:34.890 --> 00:40.590
We've seen how to do things where we can check you know select all books where the title is exact the

00:41.250 --> 00:45.750
Lincoln and the Bardo or where a released year is exactly 2013.

00:45.750 --> 00:50.940
But there's a whole slew of other things that we'd like to be able to select based off of.

00:51.210 --> 00:53.330
And that's what we're going to focus on in this section.

00:53.550 --> 00:59.050
So we're going to see how to do things like select all books not published in 2017.

00:59.370 --> 01:01.150
Right now we don't have a way of doing that.

01:02.460 --> 01:06.880
Or what about select all birthdays between two different dates.

01:06.960 --> 01:14.510
So not just all birthdays that are exactly you know April 22nd 1990 or 1992 or whatever it is.

01:14.610 --> 01:24.370
But between those two dates or select all items so this is some table I made up called items all items

01:24.370 --> 01:28.310
that are in stock and price below 1999.

01:28.330 --> 01:29.800
So that's two different things.

01:29.830 --> 01:32.090
We know how to select all items that are in stock.

01:32.290 --> 01:37.360
But there's a second component which is not only the need to be in stock but they need to be priced

01:37.360 --> 01:38.910
below 1999.

01:39.130 --> 01:41.720
And right now we don't know how to do that either.

01:41.830 --> 01:46.730
With that lengthy introduction out of the way let's take a look at some of our first ones.

01:46.810 --> 01:50.850
So the actual first one we're going to look at is called not equal.

01:50.850 --> 01:55.080
And it looks like this exclamation point and an equal sign.

01:55.510 --> 01:58.170
So we've seen hundreds of things using equal sign.

01:58.180 --> 01:58.480
Right.

01:58.480 --> 02:09.220
We've done you know select let's do title released here from books where Let's do release year so we're

02:09.260 --> 02:12.890
released here is exactly 2017.

02:13.840 --> 02:16.710
So we've seen how to do this you know with equal sign.

02:16.960 --> 02:18.250
We've been doing it all the time.

02:18.410 --> 02:21.610
However what if I want to do the opposite.

02:21.610 --> 02:26.340
I want all books that were released in any year excluding 2017.

02:26.680 --> 02:32.470
So what we want to do is basically replace that equal sign with a not equals.

02:32.650 --> 02:33.820
So we could do that.

02:34.040 --> 02:40.720
So like title from books where a year is not equal to 2017 if you're familiar with any programming languages

02:41.020 --> 02:43.630
you've probably come across this not equals.

02:43.720 --> 02:46.920
It's a pretty universal way of writing not equals.

02:47.020 --> 02:49.690
So let's give it a shot.

02:49.720 --> 02:54.500
Recall this and just replace it with not equals.

02:54.620 --> 03:01.610
And now you can hopefully see that we get everything back except for Lincoln and the bardo.

03:01.880 --> 03:07.430
And of course if there is more than one book released in 2017 then we would get any book back or all

03:07.430 --> 03:13.970
books back except that those books from 2017 so we can see that it's gone.

03:14.090 --> 03:21.080
We could do the same thing but instead of working with this year what if we do it with author.

03:21.170 --> 03:24.030
So let me just start over here.

03:24.050 --> 03:32.310
Let's select the title and author last name from books and we'll start just with all of them.

03:34.340 --> 03:41.560
And then let's select where author last name is exactly equal to Harris.

03:41.770 --> 03:54.010
So we have two Harris's where author name equals Harris just like that and we get those too.

03:54.500 --> 03:57.170
And by just flipping the switch here.

03:57.500 --> 04:02.870
That exclamation point we now get everything except those two.

04:03.280 --> 04:03.590
OK.

04:03.620 --> 04:05.140
So hopefully you get the point by now.

04:05.300 --> 04:11.440
Not equals works like you would expect if you're not familiar with the exclamation point.

04:11.450 --> 04:16.340
It might take a little bit of getting used to but otherwise it's pretty straightforward.

04:16.340 --> 04:18.890
It's the opposite of equals awesome.

04:18.920 --> 04:22.050
So that's the first one that we're taking a look at but we have quite a few more.

04:22.070 --> 04:26.090
Next up we're going to talk about something very similar which is not like.
