1
00:00:00,180 --> 00:00:00,900
All right.

2
00:00:00,900 --> 00:00:06,360
We've learned a lot in this section between all the different operators, the different comparison operators,

3
00:00:06,360 --> 00:00:12,960
logical operators, like and and or not to mention things like case statements which are complicated

4
00:00:12,960 --> 00:00:13,960
but powerful.

5
00:00:13,980 --> 00:00:15,990
It's now your turn to get some practice.

6
00:00:15,990 --> 00:00:20,310
So as always, with these exercises, I'm going to show you the slides, different prompts, different

7
00:00:20,310 --> 00:00:20,880
challenges.

8
00:00:20,880 --> 00:00:23,430
And then in the next video, I'll have a solution.

9
00:00:23,430 --> 00:00:27,360
So this first piece is just to mentally evaluate the following.

10
00:00:27,360 --> 00:00:35,310
Don't actually type this out and run them three different lines that all involve comparisons and some

11
00:00:35,310 --> 00:00:38,970
of these operators like and in or that we've learned in between and all of that.

12
00:00:39,450 --> 00:00:48,240
Okay next up we're back with a books data set select all the books written before 1980 non inclusive

13
00:00:48,240 --> 00:00:52,500
meaning I don't want to include 1980 so up to 1980.

14
00:00:53,280 --> 00:01:00,270
Then write a query to select all the books written by with the last name of the author Eggers or Shaban.

15
00:01:00,270 --> 00:01:01,080
Shaban.

16
00:01:01,110 --> 00:01:08,940
Shaban Shaban Select all the books written by Lahiri that were also published after the year 2000.

17
00:01:09,480 --> 00:01:11,310
And again, I'm talking about last name.

18
00:01:12,130 --> 00:01:17,110
Then select all books that have a page count between 102 hundred.

19
00:01:18,680 --> 00:01:24,590
Select all books where the author's last name starts with a C or an S.

20
00:01:26,790 --> 00:01:28,440
This one's a little more complicated.

21
00:01:28,470 --> 00:01:30,210
So create this result.

22
00:01:30,210 --> 00:01:36,450
We have the title, we have the author's last name, and then we have this type column that says novel

23
00:01:36,450 --> 00:01:38,130
memoir or short stories.

24
00:01:38,400 --> 00:01:40,410
So you'll need to use case.

25
00:01:40,410 --> 00:01:46,320
If the title of the book contains the word stories, then the type should be short stories.

26
00:01:46,710 --> 00:01:53,490
Then if the title this one is kind of lame, I'm asking you to literally match the title of Just Kids.

27
00:01:53,490 --> 00:01:59,520
That's one of the books by Patti Smith and also a heartbreaking work of staggering genius.

28
00:01:59,640 --> 00:02:01,200
It's a long one to type out.

29
00:02:01,800 --> 00:02:04,130
It is not called a heartbreaking, heartbreaking work.

30
00:02:04,140 --> 00:02:07,050
It is a heartbreaking work of staggering genius.

31
00:02:07,050 --> 00:02:08,340
I just couldn't fit it in here.

32
00:02:08,520 --> 00:02:15,120
So it's kind of lame because I'm asking you to, like, literally match two titles and call them memoirs,

33
00:02:15,120 --> 00:02:16,230
which is fine.

34
00:02:16,470 --> 00:02:17,850
It's just an exercise.

35
00:02:17,850 --> 00:02:23,730
And then everything else that was not a memoir or a short story, just classify as novel.

36
00:02:24,180 --> 00:02:24,810
All right.

37
00:02:24,810 --> 00:02:30,480
And then we have this final bonus, which involves some other stuff we learned in previous sections

38
00:02:30,480 --> 00:02:32,810
that we haven't revisited in this section.

39
00:02:32,820 --> 00:02:37,140
I don't want to say too much, but I'd like you to generate this output where we have the author's first

40
00:02:37,140 --> 00:02:44,010
name and last name, and then for each grouping of first name and last name, I want to see how many

41
00:02:44,010 --> 00:02:45,650
books they wrote.

42
00:02:45,660 --> 00:02:51,530
So Jhumpa Lahiri We see two books, Neil Gaiman three books.

43
00:02:51,540 --> 00:02:56,280
But what's a little bit fancy here is we don't even just see the number, but we see the word books

44
00:02:56,280 --> 00:02:59,830
afterwards or the singular of book.

45
00:02:59,850 --> 00:03:01,980
Dan Harris has one book.

46
00:03:01,980 --> 00:03:08,940
George Saunders has one book in our dataset, so you'll need to make some sort of decision based off

47
00:03:08,940 --> 00:03:10,470
of how many books there are.

48
00:03:10,500 --> 00:03:17,670
Then generate this output that uses books or book depending on if we're working with a single book or

49
00:03:17,670 --> 00:03:18,270
multiple.

50
00:03:18,270 --> 00:03:19,410
So it's a bonus.

51
00:03:19,890 --> 00:03:24,260
Go ahead and try that if you'd like, and I'll be back in the next video with a solution.

52
00:03:24,270 --> 00:03:24,660
All right.

53
00:03:24,660 --> 00:03:25,170
See you then.

