1
00:00:02,300 --> 00:00:04,190
So, did you succeed?

2
00:00:04,190 --> 00:00:06,680
Let's now add it together and for this,

3
00:00:06,680 --> 00:00:11,680
I'll add a new value into my reviews table.

4
00:00:14,060 --> 00:00:17,410
And for the columns that I wanna set, I wanna set everything

5
00:00:17,410 --> 00:00:20,700
except for the unique ID and the date.

6
00:00:20,700 --> 00:00:23,590
Because the date will be populated automatically,

7
00:00:23,590 --> 00:00:24,753
if you recall that.

8
00:00:26,400 --> 00:00:27,620
So instead,

9
00:00:27,620 --> 00:00:31,120
now let's see which columns we do have to set here,

10
00:00:31,120 --> 00:00:34,633
and there would, for example, be the reviewer name.

11
00:00:35,480 --> 00:00:37,700
So we definitely wanna set that.

12
00:00:37,700 --> 00:00:39,083
We wanna set the rating.

13
00:00:40,040 --> 00:00:43,790
We don't have to set the text, that's also optional.

14
00:00:43,790 --> 00:00:46,520
I forgot to mention this, but that's also optional

15
00:00:46,520 --> 00:00:50,110
because we did not set, not null,

16
00:00:50,110 --> 00:00:52,500
as a setting for this column.

17
00:00:52,500 --> 00:00:56,293
So we don't have to set the text, but I will set one here.

18
00:00:57,570 --> 00:01:01,520
And then, for the restaurant ID, we also need a value,

19
00:01:01,520 --> 00:01:04,920
so that this rating is linked to some restaurant.

20
00:01:04,920 --> 00:01:08,653
Date and ID are omitted for the reasons mentioned.

21
00:01:09,900 --> 00:01:12,030
Now for the values.

22
00:01:12,030 --> 00:01:14,010
And I'll split this across multiple lines

23
00:01:14,010 --> 00:01:16,220
to make it a bit easier to read.

24
00:01:16,220 --> 00:01:18,903
The reviewer name here, let's say that's me,

25
00:01:20,370 --> 00:01:21,513
Schwarzmuller.

26
00:01:23,743 --> 00:01:27,330
And the contrite's review or the rating,

27
00:01:27,330 --> 00:01:30,380
which I wanna leave here, let's say is a four.

28
00:01:30,380 --> 00:01:34,320
And the text is, "This was awesome."

29
00:01:34,320 --> 00:01:35,650
So quite short text.

30
00:01:35,650 --> 00:01:38,000
We could enter a very long text here,

31
00:01:38,000 --> 00:01:40,830
but I don't wanna waste your time with me typing

32
00:01:40,830 --> 00:01:42,423
a super long essay here.

33
00:01:43,970 --> 00:01:46,590
And now for the restaurant ID,

34
00:01:46,590 --> 00:01:49,270
I do have various restaurants.

35
00:01:49,270 --> 00:01:54,270
Let's quickly select all the restaurants here, in a new tab.

36
00:01:54,510 --> 00:01:56,763
And let's say, I wanna rate the Burger House.

37
00:01:57,690 --> 00:01:59,670
So that would have an ID of two.

38
00:01:59,670 --> 00:02:01,410
That's the ID of that restaurant.

39
00:02:01,410 --> 00:02:04,760
So here, two, is the value which I specify

40
00:02:04,760 --> 00:02:06,093
for restaurant ID.

41
00:02:07,580 --> 00:02:09,370
And now we can execute this,

42
00:02:09,370 --> 00:02:10,970
and this should have been added.

43
00:02:11,890 --> 00:02:16,660
Now let's add another rating by Jules Barnes,

44
00:02:16,660 --> 00:02:17,810
some made up name here.

45
00:02:17,810 --> 00:02:19,153
Let's say it's a two.

46
00:02:20,060 --> 00:02:22,340
And I don't wanna have a text here.

47
00:02:22,340 --> 00:02:23,760
So I'll not set a text.

48
00:02:23,760 --> 00:02:26,033
I'll delete this column from the list here.

49
00:02:27,230 --> 00:02:30,240
And I wanna rate the Burger House as well.

50
00:02:30,240 --> 00:02:34,180
This should also work if I submit this, and it does.

51
00:02:35,610 --> 00:02:39,180
And now I'll re-add the text and leave another rating,

52
00:02:39,180 --> 00:02:41,710
also, let's say by Jules Barnes,

53
00:02:41,710 --> 00:02:44,590
but now I will rate a different restaurant.

54
00:02:44,590 --> 00:02:46,380
I'll rate LAMAMA.

55
00:02:46,380 --> 00:02:48,580
So that has the ID three.

56
00:02:48,580 --> 00:02:50,753
And let's say that is a four here.

57
00:02:51,940 --> 00:02:54,350
And of course I did re-add the text here.

58
00:02:54,350 --> 00:02:57,210
So I submitted this accidentally and it failed.

59
00:02:57,210 --> 00:03:01,483
I need to, of course, add a value for the text field.

60
00:03:03,057 --> 00:03:07,530
"This was delicious," could be the text.

61
00:03:07,530 --> 00:03:09,580
Now let's submit this, and now it worked.

62
00:03:10,640 --> 00:03:12,470
And now let's add one more rating.

63
00:03:12,470 --> 00:03:14,700
Let's say a five,

64
00:03:14,700 --> 00:03:15,703
by,

65
00:03:16,740 --> 00:03:19,033
Anna Schulz,

66
00:03:21,070 --> 00:03:24,400
where I also have a text of, "Amazing."

67
00:03:24,400 --> 00:03:27,410
So, very positive reviews here, as you can see.

68
00:03:27,410 --> 00:03:31,250
And let's say we are rating LAMAMA again.

69
00:03:31,250 --> 00:03:33,373
So we keep the restaurant ID set to three.

70
00:03:37,770 --> 00:03:40,000
So that all, all's have worked.

71
00:03:40,000 --> 00:03:44,890
Now here I'll select all entries from reviews.

72
00:03:44,890 --> 00:03:46,980
And I can see my reviews here.

73
00:03:46,980 --> 00:03:47,990
Now, what you can see,

74
00:03:47,990 --> 00:03:51,970
is that the date was set automatically as promised,

75
00:03:51,970 --> 00:03:53,700
that the ID was set automatically,

76
00:03:53,700 --> 00:03:56,500
and that the text is null for some values,

77
00:03:56,500 --> 00:03:58,320
for one value to be precise,

78
00:03:58,320 --> 00:04:02,363
because it was optional and wasn't enforced to be non null.

79
00:04:04,030 --> 00:04:06,513
So therefore, now we've got these four ratings.

80
00:04:07,510 --> 00:04:08,810
Now, of course, with that,

81
00:04:08,810 --> 00:04:11,210
we now did store a bunch of dummy data

82
00:04:11,210 --> 00:04:13,630
and we can not play around with them.

83
00:04:13,630 --> 00:04:17,079
We can, for example, query it as we learned it.

84
00:04:17,079 --> 00:04:19,720
For example, if I wanna fetch all the reviews

85
00:04:19,720 --> 00:04:22,230
that have a rating greater than three,

86
00:04:22,230 --> 00:04:24,510
we could add a where clause here,

87
00:04:24,510 --> 00:04:29,113
and search for reviews where rating is greater than three.

88
00:04:30,360 --> 00:04:32,510
And if I do that, I don't see all the ratings,

89
00:04:32,510 --> 00:04:36,453
but only those that do have a rating greater than three.

90
00:04:37,720 --> 00:04:39,840
And of course there are various ways

91
00:04:39,840 --> 00:04:41,790
of mixing and matching that,

92
00:04:41,790 --> 00:04:45,210
but we did learn how that works before already.

93
00:04:45,210 --> 00:04:47,970
Nonetheless, feel free to practice it again

94
00:04:47,970 --> 00:04:49,730
and play around with that.

95
00:04:49,730 --> 00:04:53,210
So definitely also do query all that data

96
00:04:53,210 --> 00:04:55,180
that we stored here to, again,

97
00:04:55,180 --> 00:04:57,540
practice working with the where clause

98
00:04:57,540 --> 00:05:00,440
and with the select statement in general.

99
00:05:00,440 --> 00:05:03,110
Maybe revisit the querying lectures

100
00:05:03,110 --> 00:05:05,033
from earlier in this section.

101
00:05:05,920 --> 00:05:08,610
When it comes to me, I wanna show you something new,

102
00:05:08,610 --> 00:05:10,320
and therefore in the next lecture,

103
00:05:10,320 --> 00:05:13,410
I will show you how we can now query data

104
00:05:13,410 --> 00:05:15,830
across multiple tables.

105
00:05:15,830 --> 00:05:18,540
Because that is the brand new feature here,

106
00:05:18,540 --> 00:05:22,703
that we have related data, stored in different tables.

