1
00:00:00,000 --> 00:00:01,000
Hello guys.

2
00:00:01,000 --> 00:00:06,000
So in this section of the video we are going to probably go ahead and create this nodes relationship

3
00:00:06,000 --> 00:00:08,000
properties labels.

4
00:00:08,000 --> 00:00:14,000
You know and we'll try to see that how this entire information is basically created with the help of

5
00:00:14,000 --> 00:00:16,000
Cypher Query language okay.

6
00:00:16,000 --> 00:00:21,000
Very important video altogether because this will actually help you to understand how to write a specific

7
00:00:21,000 --> 00:00:22,000
query.

8
00:00:22,000 --> 00:00:28,000
So here, uh, first of all, you as soon as you open your Neo4j's Auradb, once you go inside this

9
00:00:28,000 --> 00:00:32,000
particular instance, you'll be able to see this particular text box.

10
00:00:32,000 --> 00:00:38,000
And this is where you write your own query right now, let us go ahead and try some of the queries over

11
00:00:38,000 --> 00:00:42,000
here, and we'll see that how we can go ahead and create nodes, relationship property keys and many

12
00:00:42,000 --> 00:00:43,000
more things okay.

13
00:00:43,000 --> 00:00:44,000
So let's go ahead.

14
00:00:44,000 --> 00:00:48,000
So first of all what I'm actually going to do I'm going to go ahead and use this create keyword.

15
00:00:48,000 --> 00:00:51,000
And let's create our first node okay.

16
00:00:51,000 --> 00:00:54,000
So I will just go ahead and write node Node one okay.

17
00:00:54,000 --> 00:00:57,000
So once I create this create node one.

18
00:00:57,000 --> 00:00:59,000
So it is just going to create my first node.

19
00:00:59,000 --> 00:01:04,000
And once I execute this here you will be able to see that hey node one is basically created.

20
00:01:04,000 --> 00:01:04,000
Okay.

21
00:01:05,000 --> 00:01:08,000
But I'm not able to see this node one right.

22
00:01:08,000 --> 00:01:13,000
If I go ahead and click this it shows hey I've I've assigned some ID over here.

23
00:01:13,000 --> 00:01:15,000
This ID value is zero.

24
00:01:15,000 --> 00:01:16,000
Okay.

25
00:01:16,000 --> 00:01:20,000
So I told you that whenever we try to create nodes, nodes are nothing but entities.

26
00:01:20,000 --> 00:01:21,000
Name something like that.

27
00:01:21,000 --> 00:01:22,000
Right.

28
00:01:22,000 --> 00:01:28,000
And obviously over here I did not provide any kind of information over here when I probably created

29
00:01:28,000 --> 00:01:30,000
this particular node, because I need to provide some kind of labels.

30
00:01:30,000 --> 00:01:31,000
Right.

31
00:01:31,000 --> 00:01:36,000
If I say, hey, I'm going to create a node one, let's say node one is something over here.

32
00:01:36,000 --> 00:01:40,000
And if I give a name like Krishna, then this particular node name will be assigned to Krishna.

33
00:01:40,000 --> 00:01:41,000
Right.

34
00:01:41,000 --> 00:01:41,000
right?

35
00:01:41,000 --> 00:01:47,000
So let me just go ahead and uh, in order to return everything you can see match n that is nothing but

36
00:01:47,000 --> 00:01:49,000
nodes return n limit 25.

37
00:01:49,000 --> 00:01:50,000
Okay.

38
00:01:50,000 --> 00:01:53,000
So now let me just go ahead and create another node.

39
00:01:53,000 --> 00:01:55,000
So I will go ahead and write create node.

40
00:01:55,000 --> 00:01:57,000
And you can create multiple nodes also.

41
00:01:57,000 --> 00:02:03,000
But here what I'm actually going to do I will just go ahead and create one of the node.

42
00:02:03,000 --> 00:02:09,000
And along with that I will just go ahead and assign some kind of labels.

43
00:02:09,000 --> 00:02:09,000
Okay.

44
00:02:10,000 --> 00:02:14,000
Now when I say I'll be assigning some kind of labels, what does this basically mean?

45
00:02:15,000 --> 00:02:18,000
So let's say I will go ahead and write Ellen okay Elon Musk okay.

46
00:02:19,000 --> 00:02:21,000
And this is my node that I'm actually creating.

47
00:02:21,000 --> 00:02:22,000
And let's say I'll go ahead and write.

48
00:02:22,000 --> 00:02:24,000
He's the CEO right.

49
00:02:24,000 --> 00:02:31,000
So once I execute this you'll be able to see now I'm able to see one of the node which is called as

50
00:02:31,000 --> 00:02:32,000
CEO.

51
00:02:32,000 --> 00:02:32,000
Okay.

52
00:02:33,000 --> 00:02:35,000
My my node is Ellen.

53
00:02:35,000 --> 00:02:40,000
But over here I have tried to assign some kind of label value which is called as CEO.

54
00:02:40,000 --> 00:02:41,000
Okay.

55
00:02:41,000 --> 00:02:47,000
Otherwise I could have created another node like famous personality and I could assign one of the label

56
00:02:47,000 --> 00:02:47,000
like Ellen.

57
00:02:47,000 --> 00:02:48,000
Right.

58
00:02:48,000 --> 00:02:51,000
So this way I can now see my nodes over here.

59
00:02:51,000 --> 00:02:56,000
Okay, so if I really want to go ahead and see, like who is the CEO?

60
00:02:56,000 --> 00:02:59,000
So if I just go ahead and create over here, here you'll be able to see this particular information.

61
00:02:59,000 --> 00:03:00,000
Right.

62
00:03:00,000 --> 00:03:04,000
And uh, once I go ahead and click this okay.

63
00:03:04,000 --> 00:03:06,000
This shows the node details.

64
00:03:06,000 --> 00:03:06,000
This is my CEO.

65
00:03:06,000 --> 00:03:09,000
The key ID value is one okay.

66
00:03:09,000 --> 00:03:13,000
So till here I hope you got an idea of how to properly create a node.

67
00:03:13,000 --> 00:03:14,000
Right.

68
00:03:14,000 --> 00:03:22,000
And here you can see as soon as I clicked on CEO it gave me a result where match n colon Co return n

69
00:03:22,000 --> 00:03:25,000
limit 2525 basically means 25 results is allowed to retrieve.

70
00:03:25,000 --> 00:03:27,000
And here I can probably see one of them.

71
00:03:27,000 --> 00:03:28,000
Okay.

72
00:03:28,000 --> 00:03:35,000
So I hope you got an idea with respect to creating a simple way of this kind of nodes.

73
00:03:35,000 --> 00:03:37,000
Okay, now let me do one thing.

74
00:03:37,000 --> 00:03:39,000
Let me just go ahead and create one more type here.

75
00:03:39,000 --> 00:03:41,000
I will go ahead and write Ellen okay Okay.

76
00:03:42,000 --> 00:03:44,000
Ellen I will create this particular node here.

77
00:03:44,000 --> 00:03:49,000
I will go ahead and say he is also a CEO right of Tesla.

78
00:03:50,000 --> 00:03:52,000
Along with that he is also an employee.

79
00:03:53,000 --> 00:03:59,000
So I'm going to create this now see here what exactly the CEO and employee will basically do.

80
00:03:59,000 --> 00:04:02,000
CEO one is the label over here okay.

81
00:04:02,000 --> 00:04:07,000
And uh here I'm trying to add some more labels.

82
00:04:07,000 --> 00:04:07,000
Right.

83
00:04:07,000 --> 00:04:10,000
Like employees also one more label that I really want to create.

84
00:04:10,000 --> 00:04:15,000
So if I go ahead and execute this here, you can see that now it has got executed and my one more node

85
00:04:15,000 --> 00:04:16,000
has actually got created.

86
00:04:16,000 --> 00:04:17,000
It is nothing but employee.

87
00:04:18,000 --> 00:04:18,000
Right.

88
00:04:18,000 --> 00:04:20,000
And if I go ahead and click on employee.

89
00:04:20,000 --> 00:04:22,000
So this is my second node right.

90
00:04:22,000 --> 00:04:24,000
Still CEO and employee.

91
00:04:24,000 --> 00:04:25,000
There is no relationship.

92
00:04:25,000 --> 00:04:29,000
So we are not able to probably see the entire relationship of this specific node.

93
00:04:29,000 --> 00:04:30,000
Okay.

94
00:04:30,000 --> 00:04:35,000
But here, if I write this query match n colon employees return n limit 25.

95
00:04:35,000 --> 00:04:36,000
Okay.

96
00:04:36,000 --> 00:04:39,000
So this is one of the query with respect to neo4j's.

97
00:04:39,000 --> 00:04:41,000
So this all things we have actually tried okay.

98
00:04:41,000 --> 00:04:47,000
And this is amazing because now we have also understood that fine we can create multiple labels okay.

99
00:04:47,000 --> 00:04:49,000
Just with respect to one node.

100
00:04:50,000 --> 00:04:55,000
So I hope you have very much clear with this basic things Right.

101
00:04:55,000 --> 00:05:03,000
Now similarly, I can create different different nodes with lot of different information.

102
00:05:03,000 --> 00:05:03,000
Okay.

103
00:05:03,000 --> 00:05:07,000
Let's say I go ahead and write create Ellen okay.

104
00:05:08,000 --> 00:05:11,000
And inside this I go ahead and write okay fine.

105
00:05:11,000 --> 00:05:15,000
He is the CEO okay.

106
00:05:15,000 --> 00:05:18,000
Now with respect to the CEO, I can go ahead and write some more information.

107
00:05:18,000 --> 00:05:21,000
Now I know that this is my label, okay.

108
00:05:21,000 --> 00:05:25,000
But being a CEO, this person has some kind of name.

109
00:05:25,000 --> 00:05:26,000
Elon has name.

110
00:05:26,000 --> 00:05:26,000
Right.

111
00:05:26,000 --> 00:05:30,000
So I will go ahead and write my name called as Elon Musk.

112
00:05:30,000 --> 00:05:34,000
So this is nothing but this is called as properties okay.

113
00:05:34,000 --> 00:05:38,000
So here I'm trying to create a node with this label name and this property.

114
00:05:38,000 --> 00:05:40,000
So I'll say hey Elon Musk over here.

115
00:05:40,000 --> 00:05:45,000
I'll say okay let's go ahead and write this year of birth, let's say I will go ahead and write in 1979.

116
00:05:45,000 --> 00:05:47,000
Okay, I hope so.

117
00:05:47,000 --> 00:05:51,000
Uh, he was born in 1979 or some other date, but you can go ahead and validate it.

118
00:05:51,000 --> 00:05:51,000
Okay.

119
00:05:51,000 --> 00:05:57,000
And then let's say the place of birth I have heard is from South Africa.

120
00:05:57,000 --> 00:05:57,000
Okay.

121
00:05:57,000 --> 00:05:59,000
So I'll just go ahead and write SC okay.

122
00:06:00,000 --> 00:06:01,000
Okay.

123
00:06:01,000 --> 00:06:02,000
Perfect.

124
00:06:02,000 --> 00:06:05,000
So here you can see that I have mentioned all this information.

125
00:06:05,000 --> 00:06:08,000
And this is my property keys key value pairs.

126
00:06:08,000 --> 00:06:10,000
These are my properties for this particular label okay.

127
00:06:11,000 --> 00:06:14,000
Or I can also go ahead and probably inverse this entire information.

128
00:06:14,000 --> 00:06:18,000
But right now we are able to to share or store this particular name and all.

129
00:06:18,000 --> 00:06:20,000
So now let's go ahead and execute this.

130
00:06:20,000 --> 00:06:23,000
Once I executed this you will be able to see.

131
00:06:23,000 --> 00:06:26,000
Now I have this property keys name okay.

132
00:06:26,000 --> 00:06:34,000
Name node is nothing but Elon Musk POB over here you can see node is South Africa and yob is nothing

133
00:06:34,000 --> 00:06:36,000
but the node information is 1979.

134
00:06:36,000 --> 00:06:38,000
So this information you are able to see that.

135
00:06:38,000 --> 00:06:39,000
Yeah.

136
00:06:39,000 --> 00:06:42,000
Now we have also created some kind of property keys.

137
00:06:42,000 --> 00:06:43,000
Right.

138
00:06:43,000 --> 00:06:46,000
And this is how the query is just there.

139
00:06:46,000 --> 00:06:50,000
See if I really want to understand what is the value for this name.

140
00:06:50,000 --> 00:06:56,000
So it is automatically creating this particular query match n where n dot name is not null Return distinct.

141
00:06:57,000 --> 00:07:06,000
Return distinct node as entity and dot name as limit 25 Union all match this particular uh parameters

142
00:07:06,000 --> 00:07:13,000
right R dot name is not null return distinct relationship as entity R dot name as name limit 25.

143
00:07:13,000 --> 00:07:17,000
You'll be seeing that this all kind of queries will try to generate it from Lang chain.

144
00:07:17,000 --> 00:07:23,000
So here the main idea is just to make you understand how quickly you can probably create your nodes,

145
00:07:23,000 --> 00:07:26,000
your relationships and property keys right now.

146
00:07:27,000 --> 00:07:31,000
I hope you are able to understand this now again, in order to get all the information out there, I

147
00:07:31,000 --> 00:07:36,000
will just go ahead and write match and okay, so let's go ahead and write match end.

148
00:07:36,000 --> 00:07:38,000
And here I'm just going to return end.

149
00:07:39,000 --> 00:07:42,000
Let me go ahead and write this match end.

150
00:07:42,000 --> 00:07:47,000
And here I'm just going to go ahead and return N okay.

151
00:07:47,000 --> 00:07:52,000
So if I go ahead and execute this I will be able to see okay fine.

152
00:07:52,000 --> 00:07:54,000
These are all my nodes that you can see over here.

153
00:07:54,000 --> 00:07:58,000
If I go ahead and click on Elon Musk now you can see right.

154
00:07:58,000 --> 00:08:01,000
So Elon Musk is one of the name over here.

155
00:08:01,000 --> 00:08:01,000
Right.

156
00:08:01,000 --> 00:08:03,000
And you are able to see all these values.

157
00:08:03,000 --> 00:08:06,000
And this node details is nothing but CEO right.

158
00:08:06,000 --> 00:08:08,000
So here you can see POB name Elon Musk.

159
00:08:08,000 --> 00:08:09,000
Year of birth.

160
00:08:09,000 --> 00:08:11,000
Every information is probably visible over here.

161
00:08:11,000 --> 00:08:12,000
Right.

162
00:08:12,000 --> 00:08:18,000
And this is amazing because here I made sure that I created my based on the name.

163
00:08:18,000 --> 00:08:20,000
You can see the node name is basically assigned.

164
00:08:20,000 --> 00:08:25,000
If you are not providing let's say if you have just provided label initially, the label will go away.

165
00:08:25,000 --> 00:08:30,000
But if you provided some property key value pairs where you have name information that it has replaced

166
00:08:30,000 --> 00:08:31,000
over here, right.

167
00:08:31,000 --> 00:08:34,000
If you see another node two is here, one is over here.

168
00:08:34,000 --> 00:08:35,000
This is my SEO details.

169
00:08:35,000 --> 00:08:37,000
And uh, the other nodes itself.

170
00:08:37,000 --> 00:08:37,000
Right.

171
00:08:37,000 --> 00:08:40,000
So blank by blank you will be able to see this.

172
00:08:40,000 --> 00:08:41,000
Yes I am able to see this.

173
00:08:41,000 --> 00:08:43,000
Circular nodes each and everywhere.

174
00:08:43,000 --> 00:08:43,000
Okay.

175
00:08:44,000 --> 00:08:44,000
Perfect.

176
00:08:44,000 --> 00:08:49,000
So I hope uh, you are able to understand this entire information.

177
00:08:49,000 --> 00:08:49,000
Right.

178
00:08:49,000 --> 00:08:54,000
And, uh, you are able to see that how we have easily created this entire nodes.

179
00:08:54,000 --> 00:08:54,000
Okay.

180
00:08:54,000 --> 00:08:59,000
Now let's go ahead and try to create relationships.

181
00:08:59,000 --> 00:09:00,000
Okay.

182
00:09:00,000 --> 00:09:04,000
Now you know that Elon Musk is the CEO of Tesla.

183
00:09:04,000 --> 00:09:04,000
Okay.

184
00:09:05,000 --> 00:09:09,000
Now if I really want to create first of all I need to create two entities.

185
00:09:09,000 --> 00:09:09,000
Okay.

186
00:09:09,000 --> 00:09:11,000
So let's go ahead and create this.

187
00:09:11,000 --> 00:09:15,000
So here I will write okay I have already created Elon Musk okay.

188
00:09:15,000 --> 00:09:19,000
Now let me just go ahead and write my uh, the Tesla company details.

189
00:09:19,000 --> 00:09:21,000
So here I will write re create.

190
00:09:22,000 --> 00:09:24,000
So I will just go ahead and write.

191
00:09:24,000 --> 00:09:25,000
Create.

192
00:09:27,000 --> 00:09:28,000
So this will be create.

193
00:09:28,000 --> 00:09:31,000
Now inside create I will go ahead and write okay.

194
00:09:31,000 --> 00:09:40,000
Let's say this is Tesla okay I will provide uh label over here called as company okay.

195
00:09:40,000 --> 00:09:45,000
And with respect to this particular company, let me just go ahead and give some information in the

196
00:09:45,000 --> 00:09:46,000
form of key value pairs.

197
00:09:46,000 --> 00:09:47,000
So I'll say name.

198
00:09:48,000 --> 00:09:51,000
Name is nothing but Tesla.

199
00:09:51,000 --> 00:09:51,000
Okay.

200
00:09:52,000 --> 00:09:55,000
So here you can see Tesla is the name of the company.

201
00:09:55,000 --> 00:09:56,000
And this is the label.

202
00:09:56,000 --> 00:10:00,000
So if I go ahead and execute it you'll be able to see I'm able to get the company.

203
00:10:00,000 --> 00:10:03,000
So if I go ahead and just click this I'm able to see Tesla.

204
00:10:03,000 --> 00:10:04,000
Okay.

205
00:10:04,000 --> 00:10:04,000
Perfect.

206
00:10:05,000 --> 00:10:13,000
Now I want to create a relationship between Elon Musk and obviously, uh, if I probably say Elon Musk

207
00:10:13,000 --> 00:10:19,000
with Tesla right now here, you will be able to see that if I click on name, right, Elon Musk is there

208
00:10:19,000 --> 00:10:21,000
and Tesla is there.

209
00:10:21,000 --> 00:10:21,000
Right.

210
00:10:21,000 --> 00:10:24,000
So, uh, how do I probably go ahead and do this?

211
00:10:24,000 --> 00:10:26,000
So if I go ahead and click on company.

212
00:10:26,000 --> 00:10:27,000
So this is company.

213
00:10:27,000 --> 00:10:28,000
This is CEO okay.

214
00:10:28,000 --> 00:10:31,000
And CEO these are my three information right.

215
00:10:31,000 --> 00:10:32,000
So Elon Musk.

216
00:10:32,000 --> 00:10:36,000
So let's let's see how we can probably join this okay.

217
00:10:36,000 --> 00:10:41,000
Or how we can go ahead and create this relationship already if you know in the downwards direction.

218
00:10:41,000 --> 00:10:47,000
If I go right here you will be able to see where I have actually used Elon.

219
00:10:47,000 --> 00:10:47,000
Right.

220
00:10:47,000 --> 00:10:49,000
So here I've created a node called as Elon.

221
00:10:49,000 --> 00:10:54,000
Right now what I will write since there is already a node with the name Elon.

222
00:10:54,000 --> 00:10:59,000
So if I go ahead and press this, I think uh, it was this one itself.

223
00:10:59,000 --> 00:10:59,000
Right.

224
00:10:59,000 --> 00:11:00,000
So let's see this.

225
00:11:00,000 --> 00:11:01,000
The node is there.

226
00:11:01,000 --> 00:11:07,000
So here what I will say I will create create Ellen okay.

227
00:11:07,000 --> 00:11:10,000
And then I will put a relationship.

228
00:11:10,000 --> 00:11:15,000
In order to put a relationship I have to use Dash I will use a are parameter.

229
00:11:16,000 --> 00:11:20,000
And here I will say c e o c e o.

230
00:11:21,000 --> 00:11:28,000
And here I'm just going to give this arrow direction and let me go ahead and write my another node.

231
00:11:28,000 --> 00:11:34,000
Another node will be what my another node will be specifically for this particular company.

232
00:11:34,000 --> 00:11:34,000
Right.

233
00:11:34,000 --> 00:11:39,000
And the company name that I have actually created, a company node that I've actually created is what

234
00:11:39,000 --> 00:11:40,000
Tesla.

235
00:11:40,000 --> 00:11:41,000
Right.

236
00:11:41,000 --> 00:11:47,000
So here what I'm actually going to write quickly, I will say hey go ahead and create this relationship

237
00:11:47,000 --> 00:11:48,000
with Tesla.

238
00:11:48,000 --> 00:11:54,000
Now once I execute this you'll be able to see created two nodes, created one relationship.

239
00:11:54,000 --> 00:11:57,000
Now CEO is one of the relationship.

240
00:11:57,000 --> 00:11:59,000
Now if I go ahead and click this see the magic okay.

241
00:12:00,000 --> 00:12:03,000
So here you can see five is basically getting created.

242
00:12:03,000 --> 00:12:04,000
Six is basically created.

243
00:12:04,000 --> 00:12:10,000
Now what I have actually done is that I used this particular node Elon with Tesla.

244
00:12:10,000 --> 00:12:18,000
And I don't know why Elon uh, when I see down okay, I had actually created this entire thing.

245
00:12:18,000 --> 00:12:19,000
So spelling is wrong or correct.

246
00:12:19,000 --> 00:12:22,000
Let's see Elon with CEO right.

247
00:12:22,000 --> 00:12:25,000
So here 00000.

248
00:12:25,000 --> 00:12:34,000
So if I go ahead and say Elon with CEO of Tesla it created two nodes.

249
00:12:34,000 --> 00:12:37,000
but it is giving me this particular node name, right.

250
00:12:37,000 --> 00:12:42,000
The reason is very simple, because this fifth and sixth is actually creating as a new node.

251
00:12:42,000 --> 00:12:42,000
Okay.

252
00:12:42,000 --> 00:12:45,000
It did not use the older nodes itself.

253
00:12:45,000 --> 00:12:46,000
Okay.

254
00:12:46,000 --> 00:12:50,000
So in order to do this let let's take one more very good example.

255
00:12:50,000 --> 00:12:50,000
Okay.

256
00:12:50,000 --> 00:12:55,000
I will just create it from scratch and then we'll get to know why that node name did not come okay.

257
00:12:55,000 --> 00:12:59,000
So I'll say hey go ahead and create and let me go ahead and write my name.

258
00:12:59,000 --> 00:13:05,000
Okay Chris, I will say, hey, I am a entrepreneur, okay?

259
00:13:05,000 --> 00:13:06,000
I'm an entrepreneur.

260
00:13:06,000 --> 00:13:08,000
This will be basically be my label.

261
00:13:08,000 --> 00:13:10,000
And let me just go ahead and write name.

262
00:13:11,000 --> 00:13:14,000
Oops name.

263
00:13:14,000 --> 00:13:16,000
So here I will just go ahead and create my name.

264
00:13:16,000 --> 00:13:19,000
And let's go ahead and write my name as Chris.

265
00:13:19,000 --> 00:13:22,000
Okay Chris.

266
00:13:22,000 --> 00:13:22,000
Krish.

267
00:13:22,000 --> 00:13:25,000
After creating Krish, I will go and write my iob.

268
00:13:26,000 --> 00:13:29,000
This will be nothing but 1989.

269
00:13:29,000 --> 00:13:29,000
Okay.

270
00:13:29,000 --> 00:13:32,000
Along with this, let me write place of birth.

271
00:13:32,000 --> 00:13:35,000
And here I'm just going to write India.

272
00:13:36,000 --> 00:13:36,000
Okay.

273
00:13:36,000 --> 00:13:38,000
So all this information is there.

274
00:13:38,000 --> 00:13:39,000
Okay.

275
00:13:39,000 --> 00:13:40,000
Place of birth, India.

276
00:13:40,000 --> 00:13:42,000
All these information with respect to this.

277
00:13:42,000 --> 00:13:44,000
Everything is available over here.

278
00:13:44,000 --> 00:13:44,000
Right.

279
00:13:44,000 --> 00:13:47,000
And let me just go ahead and use this should be string.

280
00:13:49,000 --> 00:13:50,000
Okay.

281
00:13:50,000 --> 00:13:56,000
Now, uh, let's say that I'm going to go ahead and probably press enter.

282
00:13:57,000 --> 00:14:00,000
Let's go ahead and create my another node okay.

283
00:14:00,000 --> 00:14:02,000
So here I'm just going to write create okay.

284
00:14:03,000 --> 00:14:06,000
And I will write I and India which is my country.

285
00:14:06,000 --> 00:14:14,000
So here I'm going to write my country label and let's say here I use something called as label.

286
00:14:14,000 --> 00:14:18,000
And here label will be name is equal to India okay.

287
00:14:18,000 --> 00:14:22,000
I just want to specify that I live in India okay.

288
00:14:22,000 --> 00:14:25,000
So that kind of relationship that I really want to put over here.

289
00:14:25,000 --> 00:14:28,000
So Krish is a node name, my node.

290
00:14:28,000 --> 00:14:34,000
Uh my node uh basically and this is given with a label called as entrepreneur name is Krish will be

291
00:14:34,000 --> 00:14:36,000
b 1989 place of birth is India.

292
00:14:36,000 --> 00:14:41,000
I created another node with country as my label and name is equal to India.

293
00:14:41,000 --> 00:14:43,000
So once I execute this you'll be able to see.

294
00:14:43,000 --> 00:14:49,000
Now I am having this entrepreneur okay Krish and country with India.

295
00:14:49,000 --> 00:14:52,000
Okay so guys now once I have created this entrepreneur.

296
00:14:52,000 --> 00:14:53,000
So let's double click this.

297
00:14:53,000 --> 00:14:55,000
So here you'll be able to see that okay.

298
00:14:55,000 --> 00:14:59,000
This is my node obviously with the label name entrepreneur.

299
00:14:59,000 --> 00:15:01,000
And here I have crush right.

300
00:15:01,000 --> 00:15:04,000
And if I just click over here you'll be able to see all this information.

301
00:15:04,000 --> 00:15:11,000
But if I double click on this you can see that it shows the relationship that it is using lives in with

302
00:15:11,000 --> 00:15:13,000
uh, the country India.

303
00:15:13,000 --> 00:15:13,000
Right.

304
00:15:13,000 --> 00:15:18,000
And if I just double click on this India here, you'll be able to see that all the values with respect

305
00:15:18,000 --> 00:15:19,000
to India is also given.

306
00:15:20,000 --> 00:15:23,000
This is one way of creating the relationship.

307
00:15:23,000 --> 00:15:23,000
Okay.

308
00:15:23,000 --> 00:15:25,000
but understand one thing guys.

309
00:15:25,000 --> 00:15:31,000
Whenever we are working with huge databases, right when we have a huge amount of database, right?

310
00:15:31,000 --> 00:15:35,000
With respect to tables, also we have different different information.

311
00:15:36,000 --> 00:15:42,000
Let's say if I want to specify person name, I should definitely have a similar kind of labels used

312
00:15:42,000 --> 00:15:44,000
everywhere, right.

313
00:15:44,000 --> 00:15:47,000
So in order to just show you uh, let me do one more example.

314
00:15:47,000 --> 00:15:48,000
Okay?

315
00:15:48,000 --> 00:15:51,000
Let's say I'm going to create a node.

316
00:15:51,000 --> 00:15:52,000
Okay.

317
00:15:52,000 --> 00:15:54,000
So let's say this will be my node P.

318
00:15:54,000 --> 00:15:57,000
And here I'm going to just use my person name okay.

319
00:15:57,000 --> 00:15:59,000
So this will be my person okay.

320
00:15:59,000 --> 00:16:00,000
Which is my label name.

321
00:16:01,000 --> 00:16:04,000
And let's say here I'm going to specify as name.

322
00:16:04,000 --> 00:16:05,000
Name is nothing.

323
00:16:05,000 --> 00:16:11,000
But let's say one of the famous actor that is actually available is Tom Hanks.

324
00:16:11,000 --> 00:16:13,000
I hope you have seen this movie.

325
00:16:13,000 --> 00:16:16,000
You know, amazing movies that he probably creates.

326
00:16:16,000 --> 00:16:19,000
And let's say this person is born in 1956.

327
00:16:19,000 --> 00:16:21,000
So I will just go ahead and write 1956.

328
00:16:21,000 --> 00:16:29,000
So here what I have actually done is that I have actually created an person, uh, a peep, uh, like

329
00:16:29,000 --> 00:16:31,000
a node P with the name person.

330
00:16:31,000 --> 00:16:35,000
And the name information is Tom Hanks, and person is born in 1956.

331
00:16:35,000 --> 00:16:36,000
Okay.

332
00:16:36,000 --> 00:16:39,000
so let me just go ahead and create another node.

333
00:16:39,000 --> 00:16:42,000
So here I'm going to basically use another node which is called as movie.

334
00:16:42,000 --> 00:16:45,000
And here my node will specifically become M.

335
00:16:45,000 --> 00:16:50,000
I'm just mentioning M and we are going to make this node similar for every records that we enter.

336
00:16:50,000 --> 00:16:55,000
So here I'm going to write M colon movie okay.

337
00:16:55,000 --> 00:16:58,000
And here I'm going to use my title.

338
00:16:59,000 --> 00:17:05,000
Along with that I will go ahead and use my, let's say, the movie that the person may have acted is

339
00:17:05,000 --> 00:17:08,000
like Forrest Gump, okay, Forrest Gump.

340
00:17:08,000 --> 00:17:13,000
And it was basically released and it's an amazing movie.

341
00:17:13,000 --> 00:17:18,000
I think everybody should probably watch this movie because it is fun comedy.

342
00:17:18,000 --> 00:17:19,000
It is so many things in this.

343
00:17:19,000 --> 00:17:20,000
Right?

344
00:17:20,000 --> 00:17:24,000
So here I will go ahead and write released and let me just go ahead and write 1994.

345
00:17:24,000 --> 00:17:25,000
Okay.

346
00:17:25,000 --> 00:17:27,000
So let's execute this.

347
00:17:27,000 --> 00:17:29,000
So here you can be able to see that I've created two nodes.

348
00:17:29,000 --> 00:17:32,000
One is with respect to person.

349
00:17:32,000 --> 00:17:37,000
So Tom Hanks is over here with respect to movie Forrest Gump is over here.

350
00:17:37,000 --> 00:17:40,000
The reason we have just used P as our node.

351
00:17:40,000 --> 00:17:45,000
Because whenever we create a new person over there, again the properties will only change.

352
00:17:45,000 --> 00:17:46,000
The name will change.

353
00:17:46,000 --> 00:17:50,000
Similarly, whenever I add a movie right, the movie name will be changing.

354
00:17:50,000 --> 00:17:51,000
The title will be changing.

355
00:17:51,000 --> 00:17:52,000
Okay.

356
00:17:52,000 --> 00:17:58,000
Now let me just go ahead and create a relationship between this movie and person.

357
00:17:58,000 --> 00:18:02,000
The person has acted in the movie, so I'll just go ahead and create a relationship, okay.

358
00:18:02,000 --> 00:18:07,000
Now, in order to create a relationship, first of all, I will what I will do is that I will do some

359
00:18:07,000 --> 00:18:08,000
matching.

360
00:18:08,000 --> 00:18:08,000
Okay?

361
00:18:08,000 --> 00:18:10,000
So I will go ahead and write match.

362
00:18:10,000 --> 00:18:15,000
And inside this match I will say, hey, let's go ahead and take p colon person.

363
00:18:15,000 --> 00:18:18,000
So here I will just go ahead and take this person.

364
00:18:18,000 --> 00:18:23,000
Um, and obviously I have to match with the exact name of the actor.

365
00:18:23,000 --> 00:18:26,000
So here I will go ahead and write Tom Hanks.

366
00:18:26,000 --> 00:18:29,000
So this is I hope this is the name of the actor.

367
00:18:29,000 --> 00:18:31,000
Let's see, Tom Hanks okay.

368
00:18:32,000 --> 00:18:37,000
Now once I do this, uh, then I will also do another match over here.

369
00:18:37,000 --> 00:18:40,000
Okay, so this is with respect to the person name that I'm actually doing.

370
00:18:40,000 --> 00:18:42,000
Let's do another match.

371
00:18:42,000 --> 00:18:46,000
Uh, here I'm going to probably take m dot movie.

372
00:18:47,000 --> 00:18:47,000
Right.

373
00:18:47,000 --> 00:18:52,000
So if I go ahead and write this let me see whether the brackets are closed properly or not.

374
00:18:52,000 --> 00:18:54,000
Yeah this looks good okay.

375
00:18:54,000 --> 00:19:03,000
So I'll just go ahead and write m dot movie because movie is my, uh.

376
00:19:03,000 --> 00:19:03,000
Sorry.

377
00:19:03,000 --> 00:19:04,000
It should not be Dot.

378
00:19:04,000 --> 00:19:05,000
It should be colon.

379
00:19:05,000 --> 00:19:05,000
Okay.

380
00:19:05,000 --> 00:19:08,000
Movie is my node name over here.

381
00:19:08,000 --> 00:19:13,000
And again, I have to exactly use that particular title because I need to create a relationship.

382
00:19:13,000 --> 00:19:16,000
So let me just go ahead and write title colon.

383
00:19:16,000 --> 00:19:20,000
And let's see what is the movie name over here Forrest Gump okay.

384
00:19:21,000 --> 00:19:25,000
It should be double R, but I'm just writing it as single R Forrest Gump.

385
00:19:25,000 --> 00:19:31,000
Okay, so, uh, when I am probably executing this.

386
00:19:31,000 --> 00:19:31,000
Okay.

387
00:19:31,000 --> 00:19:34,000
So here, if I execute this, let's see what error I get.

388
00:19:34,000 --> 00:19:35,000
Okay.

389
00:19:35,000 --> 00:19:36,000
Will I get any error.

390
00:19:36,000 --> 00:19:39,000
So here you can see query cannot conclude with match.

391
00:19:39,000 --> 00:19:41,000
Must be a return clause.

392
00:19:41,000 --> 00:19:43,000
I have to also go ahead and write a return clause.

393
00:19:43,000 --> 00:19:46,000
So what I will do I will press press enter over here.

394
00:19:46,000 --> 00:19:51,000
After doing this match I'll say hey let's go ahead and create this relationship where I will take my

395
00:19:51,000 --> 00:19:52,000
P, which is my person.

396
00:19:52,000 --> 00:20:00,000
I will create a new relationship which is called as acted underscore in right.

397
00:20:00,000 --> 00:20:05,000
And with respect to this I will be creating a relationship with M.

398
00:20:05,000 --> 00:20:06,000
Okay.

399
00:20:06,000 --> 00:20:10,000
So this actually does a lot many things right.

400
00:20:10,000 --> 00:20:15,000
And here you'll be able to see this entire thing that I've actually created a relationship.

401
00:20:15,000 --> 00:20:16,000
Okay.

402
00:20:16,000 --> 00:20:18,000
So here, uh, let me do one thing.

403
00:20:18,000 --> 00:20:21,000
Let me, uh, let me remove this.

404
00:20:21,000 --> 00:20:21,000
Okay?

405
00:20:22,000 --> 00:20:23,000
Okay.

406
00:20:23,000 --> 00:20:23,000
Sorry.

407
00:20:23,000 --> 00:20:25,000
I think this got executed.

408
00:20:25,000 --> 00:20:28,000
So we are not able to update this, so I will just update over here.

409
00:20:28,000 --> 00:20:29,000
Okay.

410
00:20:29,000 --> 00:20:31,000
So this is the same thing that we have actually done.

411
00:20:31,000 --> 00:20:32,000
Okay.

412
00:20:32,000 --> 00:20:34,000
Now let's go ahead and execute this.

413
00:20:34,000 --> 00:20:36,000
Now here you can see no changes no record the query.

414
00:20:36,000 --> 00:20:40,000
Build a Cartesian product between disconnected patterns.

415
00:20:40,000 --> 00:20:43,000
Now what may be the problem okay I use double R over here.

416
00:20:43,000 --> 00:20:44,000
No worries.

417
00:20:44,000 --> 00:20:45,000
So let's go ahead and execute this.

418
00:20:45,000 --> 00:20:48,000
Now it shows created one relationship.

419
00:20:48,000 --> 00:20:52,000
This query builds a Cartesian product between the disconnected patterns.

420
00:20:52,000 --> 00:20:58,000
And let's see okay whether the relationship is created or not I clicked on acting in acted in.

421
00:20:58,000 --> 00:21:02,000
And here you can see Tom Hanks has acted in Forrest Gump's.

422
00:21:02,000 --> 00:21:02,000
Okay.

423
00:21:02,000 --> 00:21:09,000
The reason why we were able to get, uh, the previous warning over here, this one, it is because

424
00:21:09,000 --> 00:21:13,000
I'm just trying to insert any kind of data over here, and it is just trying to find out the relationship

425
00:21:13,000 --> 00:21:14,000
with respect to other labels also.

426
00:21:15,000 --> 00:21:19,000
But this is how very beautifully we have actually created a relationship.

427
00:21:19,000 --> 00:21:20,000
Right?

428
00:21:20,000 --> 00:21:21,000
Similarly over here.

429
00:21:21,000 --> 00:21:23,000
See we we did this libsyn and all.

430
00:21:23,000 --> 00:21:27,000
So here uh, Chris lives in this information is over here.

431
00:21:27,000 --> 00:21:29,000
9 to 10 over here.

432
00:21:29,000 --> 00:21:29,000
9 to 10.

433
00:21:29,000 --> 00:21:31,000
Because here we did not give any label name.

434
00:21:31,000 --> 00:21:32,000
Right.

435
00:21:32,000 --> 00:21:34,000
All this information we could see very much easily.

436
00:21:34,000 --> 00:21:39,000
Now similarly here in acted in we have actually created this specific relationship.

437
00:21:39,000 --> 00:21:44,000
So any number of relationship you can go ahead and probably get it.

438
00:21:44,000 --> 00:21:49,000
You know, now there may be scenario that where I want to probably retrieve nodes and relationship okay.

439
00:21:49,000 --> 00:21:57,000
So in order to do that, let's say if I go ahead and just execute this match P colon person name is

440
00:21:57,000 --> 00:21:58,000
equal to Tom Ham.

441
00:21:58,000 --> 00:21:58,000
So return P.

442
00:21:58,000 --> 00:22:01,000
So I should be able to get Tom Hanks right.

443
00:22:01,000 --> 00:22:08,000
Similarly if I want P with person and I'm using this colon actedin that basically means this is the

444
00:22:08,000 --> 00:22:10,000
relationship that we are looking for.

445
00:22:10,000 --> 00:22:12,000
And we are returning P and M.

446
00:22:12,000 --> 00:22:16,000
So here you'll be able to see that I will be able to get both the nodes, but I'm not able to see the

447
00:22:16,000 --> 00:22:18,000
relationship, the relationship.

448
00:22:18,000 --> 00:22:25,000
If I really want to get then this is the query match p acted in return p limit.

449
00:22:25,000 --> 00:22:28,000
Okay, now let's do one more thing okay?

450
00:22:29,000 --> 00:22:32,000
Let's create one more, uh person okay.

451
00:22:32,000 --> 00:22:37,000
And uh, then we will try to add some more information with respect to that particular person.

452
00:22:37,000 --> 00:22:37,000
Okay.

453
00:22:37,000 --> 00:22:46,000
So let's say over here I will say there is also one more actor which has uh, probably acted in forest

454
00:22:46,000 --> 00:22:46,000
Graham.

455
00:22:46,000 --> 00:22:46,000
Okay.

456
00:22:46,000 --> 00:22:49,000
And if you see there are a lot of actors over there.

457
00:22:49,000 --> 00:22:53,000
So here I'll just go ahead and copy this, okay.

458
00:22:53,000 --> 00:22:56,000
I will say, hey, movie title, this is there.

459
00:22:56,000 --> 00:23:01,000
So let's go ahead and okay this is for the relationship okay.

460
00:23:01,000 --> 00:23:01,000
Um.

461
00:23:01,000 --> 00:23:02,000
Mhm.

462
00:23:02,000 --> 00:23:02,000
Mhm.

463
00:23:03,000 --> 00:23:07,000
So let's see where the person we created this.

464
00:23:07,000 --> 00:23:07,000
Right.

465
00:23:07,000 --> 00:23:10,000
So here I'm going to create another person.

466
00:23:10,000 --> 00:23:13,000
And let's say this will be an another actor that we are going to use.

467
00:23:13,000 --> 00:23:14,000
Now see this.

468
00:23:14,000 --> 00:23:15,000
This will be amazing.

469
00:23:15,000 --> 00:23:20,000
I will say hey uh I know I have not acted it, but I'm just going to write.

470
00:23:20,000 --> 00:23:20,000
Okay?

471
00:23:20,000 --> 00:23:21,000
Crush.

472
00:23:21,000 --> 00:23:23,000
I'm born in 1989.

473
00:23:23,000 --> 00:23:28,000
I know, but I'm not acted over here, so I'll simply try to create a relationship.

474
00:23:28,000 --> 00:23:30,000
So this will be my another person.

475
00:23:30,000 --> 00:23:32,000
So here now if I go ahead and click on person.

476
00:23:32,000 --> 00:23:37,000
So here Tom Hanks you can see and Chris you can see right now the next thing will be that I will try

477
00:23:37,000 --> 00:23:42,000
to create a relationship between this movie that is Forrest Gump and Crush.

478
00:23:42,000 --> 00:23:43,000
Right.

479
00:23:43,000 --> 00:23:45,000
So I'm going to basically use this two information.

480
00:23:45,000 --> 00:23:49,000
So if I go back down right, I've created this entire node.

481
00:23:49,000 --> 00:23:54,000
Uh, so I'm also making sure that I'll create that relationship.

482
00:23:54,000 --> 00:23:56,000
So I'll say match this for scrum.

483
00:23:56,000 --> 00:23:56,000
Okay.

484
00:23:56,000 --> 00:23:57,000
This is fine.

485
00:23:57,000 --> 00:23:58,000
This is to get the query.

486
00:23:58,000 --> 00:23:59,000
Okay.

487
00:23:59,000 --> 00:24:03,000
And, uh, here how do I probably create the relationship here.

488
00:24:03,000 --> 00:24:04,000
You can see this okay.

489
00:24:05,000 --> 00:24:10,000
So let's copy this entire thing I will paste it over here okay.

490
00:24:10,000 --> 00:24:15,000
And here I'm going to write crush okay.

491
00:24:15,000 --> 00:24:20,000
Person name is nothing but crush movie title this so and so I have acted it.

492
00:24:20,000 --> 00:24:26,000
Okay, so once I execute this now if I go and now see acted in, you'll be able to see two people are

493
00:24:26,000 --> 00:24:27,000
acting over here.

494
00:24:27,000 --> 00:24:29,000
Crush acted in this.

495
00:24:29,000 --> 00:24:30,000
Tom Hanks acted in Forrest Gump.

496
00:24:31,000 --> 00:24:35,000
And this is how you can probably go ahead and build your queries, and you can keep on writing multiple

497
00:24:35,000 --> 00:24:37,000
things over here, okay.

498
00:24:37,000 --> 00:24:42,000
For retrieving anything as such, just write the match keyword and automatically you'll be able to retrieve

499
00:24:42,000 --> 00:24:43,000
all those information.

500
00:24:43,000 --> 00:24:51,000
Okay, let's say, um, I need to also update different nodes and relationship because see, in Tom

501
00:24:51,000 --> 00:24:53,000
Hanks, uh, the born in 1956.

502
00:24:53,000 --> 00:24:53,000
Okay.

503
00:24:53,000 --> 00:24:57,000
Let's say that okay, I have mistaken, I have to probably update it to 1957.

504
00:24:57,000 --> 00:24:59,000
So I will just go ahead and write match.

505
00:25:00,000 --> 00:25:03,000
And here I will write p colon person.

506
00:25:03,000 --> 00:25:03,000
Okay.

507
00:25:03,000 --> 00:25:03,000
okay.

508
00:25:03,000 --> 00:25:07,000
And here I'm going to write my name.

509
00:25:07,000 --> 00:25:08,000
Colon okay.

510
00:25:08,000 --> 00:25:09,000
Name colon.

511
00:25:09,000 --> 00:25:14,000
Let me just go ahead and write Tom Hanks okay.

512
00:25:14,000 --> 00:25:17,000
So okay.

513
00:25:17,000 --> 00:25:20,000
This time Tom Hanks okay.

514
00:25:20,000 --> 00:25:24,000
So we are matching with this specific person information.

515
00:25:24,000 --> 00:25:27,000
And then we are just going to write a set keyword.

516
00:25:27,000 --> 00:25:28,000
So set is also there.

517
00:25:28,000 --> 00:25:34,000
I'll just go ahead and write p dot bond is equal to 1957 okay.

518
00:25:34,000 --> 00:25:35,000
Perfect.

519
00:25:35,000 --> 00:25:37,000
And let's return this p.

520
00:25:38,000 --> 00:25:40,000
Then I should be able to get this particular information.

521
00:25:40,000 --> 00:25:44,000
So if I go ahead and click on Tom Hanks now you'll be able to see 1957.

522
00:25:44,000 --> 00:25:44,000
Right.

523
00:25:45,000 --> 00:25:53,000
So uh these were some of the queries again guys uh please write down the queries along with me for your

524
00:25:53,000 --> 00:25:54,000
understanding.

525
00:25:55,000 --> 00:25:59,000
Uh, it is, I don't know, like how we can probably download the script and all.

526
00:26:00,000 --> 00:26:06,000
Uh, but let's see, uh, whether we'll be able to know cypher snippets saved click in this.

527
00:26:06,000 --> 00:26:11,000
Uh, but according to this, I don't know whether we will be able to explore these queries or not,

528
00:26:11,000 --> 00:26:14,000
but please go ahead and execute it from your side.

529
00:26:14,000 --> 00:26:14,000
Okay.

530
00:26:14,000 --> 00:26:19,000
And, uh, if you are getting any kind of issues, just let me know with respect to that okay?

531
00:26:19,000 --> 00:26:26,000
But I hope you got an idea of creating a node of probably creating a relationship, of probably creating

532
00:26:26,000 --> 00:26:31,000
property keys, you know, and how you can basically work with different things, right?

533
00:26:31,000 --> 00:26:36,000
In the upcoming session, we will be discussing about more advanced queries as we go ahead.

534
00:26:36,000 --> 00:26:37,000
Right.

535
00:26:37,000 --> 00:26:39,000
So yes, this was it for my side.

536
00:26:39,000 --> 00:26:41,000
I will see you all in the next video.

537
00:26:41,000 --> 00:26:41,000
Thank you.

