1
00:00:00,860 --> 00:00:01,550
Welcome back.

2
00:00:01,940 --> 00:00:05,900
Now we need to do is that we need to get a movie by ID from the database.

3
00:00:06,440 --> 00:00:14,960
And the good news is that now the IDs are going to be are not going to be we aren't going to rely on

4
00:00:14,960 --> 00:00:20,120
the IDs of the array because now in the database, the situation is different.

5
00:00:20,810 --> 00:00:28,190
The in the database, each single movie will have an ID that is given by the database automatically.

6
00:00:28,460 --> 00:00:35,420
So it doesn't matter where that that element or that movie exists in the array that will be returned.

7
00:00:35,480 --> 00:00:41,270
It doesn't matter because each movie will have a unique I.D., whether that be one hundred one thousand

8
00:00:41,630 --> 00:00:42,290
ninety nine.

9
00:00:42,290 --> 00:00:50,330
It doesn't matter because by using that I.D., we can get that specific movie rather than using a random

10
00:00:50,330 --> 00:00:53,390
ID and using it because we are.

11
00:00:53,390 --> 00:01:02,890
If if we are relying on the array or list index, we would have to just pass a random I.D. to get around

12
00:01:02,900 --> 00:01:04,160
a movie, and we don't want that.

13
00:01:04,400 --> 00:01:10,610
Instead, by using the database, we will be able to get a movie, a certain movie by using its I.D.

14
00:01:11,090 --> 00:01:15,890
because as you can see, if we retain all of the movies, each single movie will have a unique I.D..

15
00:01:16,640 --> 00:01:18,110
For example, Joker has one.

16
00:01:18,680 --> 00:01:21,270
Batman has two ICE agents three.

17
00:01:21,290 --> 00:01:25,850
It doesn't matter that ID, but we if we use that ID, we can get that movie.

18
00:01:26,810 --> 00:01:33,020
So now let's use this endpoint that we already have to get that specific movie.

19
00:01:34,130 --> 00:01:41,900
So now what we need to do is that we need to follow the same procedure or process steps that we already

20
00:01:42,860 --> 00:01:46,220
have followed in the first endpoint.

21
00:01:47,390 --> 00:01:48,410
Here we need to you.

22
00:01:48,510 --> 00:01:50,520
We need to create an obscure IL Command.

23
00:01:50,540 --> 00:01:59,150
We need to say scale is equal to and then we need to say, select select.

24
00:02:00,890 --> 00:02:10,850
Select now, instead of saying select, instead of saying select all we need to say, select all, but

25
00:02:10,850 --> 00:02:12,500
we need to specify the movie ID.

26
00:02:12,590 --> 00:02:15,320
So when you say select all from.

27
00:02:16,320 --> 00:02:22,980
From movies, however, now to other condition and the condition is going to be the the movie.

28
00:02:23,280 --> 00:02:28,020
So we need to say select all four movies where we're.

29
00:02:29,260 --> 00:02:32,890
It is equal to and then.

30
00:02:34,150 --> 00:02:41,680
And then percentage, yes, and that's it now this percentage is represents a blank, and we need to

31
00:02:41,680 --> 00:02:43,850
fill this blank with the movie.

32
00:02:44,500 --> 00:02:49,120
So in a new line, what I'm going to do in a new line is that I'm going to give a variable.

33
00:02:49,130 --> 00:03:00,180
I'm going to say I'm going to create a variable called Val, which is going to be equal to a a couple.

34
00:03:00,220 --> 00:03:06,760
It's also called if you pull in a bygone and then I'm going to pass the movie, I'm going to say movie,

35
00:03:07,450 --> 00:03:10,090
movie, ID and then comma.

36
00:03:10,540 --> 00:03:11,710
So this is the syntax.

37
00:03:11,710 --> 00:03:15,370
This is the correct syntax, and this is going to be.

38
00:03:15,400 --> 00:03:19,780
Now we can use this to fill this blank, which is the movie ID.

39
00:03:19,900 --> 00:03:25,120
So in a new line, we need to say my cursor, my cursor and then execute.

40
00:03:25,690 --> 00:03:29,060
And then what we want to execute is that we want to execute the Skywhale command.

41
00:03:29,080 --> 00:03:32,770
However, we need to fill the blank to fill the blank.

42
00:03:32,770 --> 00:03:34,030
We need to pass the ballot.

43
00:03:35,020 --> 00:03:37,930
So this execute function takes two parameters.

44
00:03:38,230 --> 00:03:44,320
The first parameter is the serial, and the second parameter is the piece of data that we want to fill

45
00:03:45,160 --> 00:03:45,890
the command with.

46
00:03:45,910 --> 00:03:52,870
So the command has only one blank, which is the this is percentages, and we knew we need to fill it

47
00:03:52,870 --> 00:03:55,270
with the movie ID, which is the value.

48
00:03:56,020 --> 00:03:57,010
And that's it now.

49
00:03:57,430 --> 00:03:59,370
After this, we need to execute this.

50
00:03:59,410 --> 00:04:00,210
We need to.

51
00:04:00,670 --> 00:04:03,310
After we excuse this, we need to get the result.

52
00:04:03,580 --> 00:04:14,590
To get the result, we need to say Mike or Sagot fetch all and we need to store this in a variable called.

53
00:04:17,060 --> 00:04:20,350
Moving to a movie is going to be equal to microservice.

54
00:04:21,470 --> 00:04:26,900
And finally, we return that movie we their movie.

55
00:04:27,140 --> 00:04:32,810
However, the movie which all returns this, which all returns an array of arrays.

56
00:04:33,290 --> 00:04:39,680
So we need to get only the the the the only element and the only element has an index of zero.

57
00:04:39,680 --> 00:04:46,070
So we can't we can't say return movie of zero, which is going to return the only element of this array.

58
00:04:46,160 --> 00:04:47,930
Now let me save on this.

59
00:04:48,020 --> 00:04:51,440
I'm going to click on table leaning here, then over to the browser to this.

60
00:04:52,920 --> 00:04:54,660
In the browser now, let me refresh.

61
00:04:56,580 --> 00:05:00,300
Let me click on it and click on movie will be it.

62
00:05:00,990 --> 00:05:06,530
And now let me click on to try it out and let's use a movie idea.

63
00:05:06,540 --> 00:05:07,290
Let's pass a movie.

64
00:05:07,300 --> 00:05:11,860
I'd say, for example, if we want to get Ice Age, we would have to pass through.

65
00:05:12,300 --> 00:05:15,760
Let me say here three if you click on excuse.

66
00:05:16,260 --> 00:05:23,250
As you can see, what I'm going to get is that I'm going to get Ice Age, Ice Age 2014, Ice Age animals

67
00:05:23,250 --> 00:05:26,040
seeking new adventures, so it's working perfectly.
