1
00:00:00,150 --> 00:00:06,930
Next up, we have the not like operator, which hopefully is somewhat self-explanatory, if you remember

2
00:00:06,930 --> 00:00:10,110
what like does we now have not like.

3
00:00:10,380 --> 00:00:14,500
So this allows me to do things like select.

4
00:00:14,520 --> 00:00:19,260
Let's say I want to select all the books that have a space in their title.

5
00:00:19,410 --> 00:00:21,820
So I would do some sort of pattern matching, right?

6
00:00:21,840 --> 00:00:30,060
Select, let's just do title from books where and then title like.

7
00:00:30,150 --> 00:00:36,180
And then a string that has a percent sign space and a percent sign.

8
00:00:36,570 --> 00:00:38,220
Once again, remember what this means.

9
00:00:38,220 --> 00:00:42,450
Wild card characters, zero or more characters on either side of a space.

10
00:00:43,320 --> 00:00:48,690
And so now we get all of the books that do have a space in their name, and I think there's at least

11
00:00:48,690 --> 00:00:49,760
one that doesn't.

12
00:00:49,770 --> 00:00:53,740
I know Coraline doesn't, and I don't see Coraline here.

13
00:00:53,760 --> 00:00:57,300
So anyway, if I invert this by using not like.

14
00:00:58,760 --> 00:01:03,980
Not space like we see to books in my example or in my dataset.

15
00:01:03,980 --> 00:01:04,250
At least.

16
00:01:04,250 --> 00:01:08,330
I don't know if you have fake book or not, but at the very least you should have Coraline.

17
00:01:08,360 --> 00:01:15,110
We're now selecting all the books where there is no match to this pattern where they are not like or

18
00:01:15,110 --> 00:01:17,360
the title is not like this pattern.

19
00:01:17,840 --> 00:01:19,550
So we can try another example.

20
00:01:19,670 --> 00:01:20,900
We have a lot of authors.

21
00:01:20,900 --> 00:01:23,490
First names that start with d.A.

22
00:01:23,510 --> 00:01:26,630
Like dan, david, dave, daniel.

23
00:01:26,630 --> 00:01:27,230
Maybe.

24
00:01:27,290 --> 00:01:32,820
Let's try and select the books that start with those letters or the authors that start with day.

25
00:01:32,840 --> 00:01:33,830
So we'll do.

26
00:01:34,990 --> 00:01:43,340
How about title author, f name and author L name from books.

27
00:01:44,090 --> 00:01:47,360
And then I'll say where the author's first name.

28
00:01:48,500 --> 00:01:57,020
Like, we'll just start with, like, so where it does contain it Begin with D a and then anything after

29
00:01:57,020 --> 00:01:58,130
D is fine.

30
00:01:59,660 --> 00:02:05,930
And we see Dave, Dave, Dave, David, David, Dan Ock And then of course I can just invert that by

31
00:02:05,930 --> 00:02:07,010
saying just kidding.

32
00:02:07,010 --> 00:02:08,840
I want not like.

33
00:02:09,789 --> 00:02:15,880
And now we see all of the authors and their corresponding titles that do not start with their first

34
00:02:15,880 --> 00:02:17,500
name, does not start with day.

35
00:02:17,800 --> 00:02:18,880
So no days.

36
00:02:18,890 --> 00:02:21,670
We have a doe, but no days.

37
00:02:21,730 --> 00:02:23,110
Let's do one more example.

38
00:02:23,110 --> 00:02:28,030
Let's see if we can select any book titles that don't contain the letter E.

39
00:02:28,060 --> 00:02:38,620
So let's select title from books where and then the name or the title is not like this string, which

40
00:02:38,620 --> 00:02:44,950
will have percent sine e percent sine meaning somewhere in the string, beginning end or middle of the

41
00:02:44,950 --> 00:02:48,930
string is an E and there's only one match just kids.

42
00:02:49,000 --> 00:02:54,180
It's the only book title that does not have an E, How about does not have an A?

43
00:02:54,640 --> 00:03:00,310
All of these book titles do not have an A so hopefully that's clear how not like works.

44
00:03:00,790 --> 00:03:07,900
Just something I see some students get confused with is we use the bang exclamation points equal sign

45
00:03:07,900 --> 00:03:17,050
for not equal but we use the word not like to mean not like we don't do something like this, not like

46
00:03:17,050 --> 00:03:17,860
or anything like that.

47
00:03:17,860 --> 00:03:19,810
It is not like.

48
00:03:19,810 --> 00:03:21,550
And that's all there is to not like.

