0:02 [Music] 0:06 thank you 0:09 [Music] 0:12 Hello friends welcome back to our 0:14 channel so in the previous sessions we 0:16 have discussed about the functional 0:17 dependencies and the types of functional 0:19 dependencies and the properties of 0:21 functional dependencies so in this 0:24 session we'll go with the One More 0:25 Concept in dbms that is how to find the 0:28 closure 0:30 of an attribute 0:41 yeah 0:43 so our table will be having a number of 0:47 attributes and will be we have discussed 0:50 about the functional dependencies and 0:52 with the help of those things 0:54 how to find the closure right so because 0:57 this closure is used to identify the 1:01 super keys and the candidate keys right 1:03 so the closure 1:05 of an attribute 1:11 is a set of 1:13 attributes 1:16 set of attributes 1:19 that are 1:23 functionally determined 1:39 where the attribute set 1:42 right so it is a set of attributes so we 1:47 can apply this closure on a single 1:50 attribute 1:53 or 1:55 attribute set 1:57 attribute set that means multiple 2:01 attributes and 2:03 this one disclosure 2:05 is represented 2:09 represented as 2:11 plus the symbol 2:13 as 2:19 C 2:21 if if we want to find X 2:24 the closure of x 2:27 so closure 2:29 X then it is represented as X 2:33 plus X Plus is equal to so set of 2:37 attributes 2:39 the attribute set right so this is the 2:43 closure so which are functionally 2:45 determined by the attribute set 2:48 functionally determined by the 2:50 attribution so we'll see one example so 2:52 that it will be understood 2:54 very clearly 2:56 right so let's have an example 2:59 so let us take this example so let's 3:02 have a relation with the following 3:04 attributes a b c d e and the functional 3:07 dependencies are a tends to b b tends to 3:09 C C tends to D and D tends to a so we 3:12 have discussed about this functional 3:13 dependency concept how it is represented 3:15 and everything so I'll post the link in 3:17 the description section so just go 3:19 through about that so here a tends to b 3:21 means B is a functionally dependent on a 3:24 so by knowing a l we can get the details 3:27 of B 3:28 okay 3:29 so if you want to so from this one we 3:33 can find out the closures different 3:34 closures right so it can be a single 3:37 attribute or a multiple attributes so 3:40 for example if you want to find a plus 3:43 the closure of a plus 3:45 the closure of a plus so 3:49 that means see for every attribute 3:52 for every attribute closure the same 3:55 thing will be determined okay so that 3:58 means C 4:00 if you know a we can get the attribute a 4:05 right so 4:08 for every attribute say 4:10 for which we are finding the closure the 4:13 same attributes will be available in the 4:15 resultant set 4:17 okay same attributes can be included in 4:20 the resultant set so this is the 4:22 resultant set okay so here we are not we 4:24 are supposed to find the closure of EA 4:27 plus so the first one will be the a okay 4:32 by knowing a we can get the details of a 4:35 so for example if if a table consists of 4:39 some employee ID 4:42 and employee number 4:44 or employee name 4:47 employee name so with the help of 4:50 employee ID 4:52 so definitely we can get the details of 4:54 employee ID 4:56 and employee name 4:59 employee ID and employment so similarly 5:02 if you know this one so the self 5:05 attribute can be added into the 5:08 resultant set so 5:10 a plus the first one will be the 5:13 attributes for which we are finding the 5:16 closure right so a and now in the 5:19 resultant set so this is the resultant 5:21 set 5:23 foreign 5:32 what are the other attributes we can 5:34 determine from the functional dependency 5:35 so we are having a so we can move B we 5:39 can get the details of B right so B can 5:42 be determined if you are having a now 5:45 the resultant set is having a and b so 5:48 we are having the details of attributes 5:50 A and B so what are other attributes we 5:53 can get so if you are having attribute B 5:57 we can also get C 5:59 right so the meaning of this functional 6:01 dependency means if you know this 6:03 attribute we can determine this 6:05 attribute 6:07 okay so C is functionally dependent on B 6:10 so we have we know B so obviously we can 6:14 get a c so we can get C now the 6:16 resultant set is having three attributes 6:19 a b c so by knowing A or B or C or a 6:23 combination of a b or V AC or BCE so we 6:26 can get more number of attributes what 6:28 are the other attributes so if you know 6:30 C we can also get a d 6:32 yes 6:34 and 6:36 now the resultant site is having a four 6:38 attributes so again we have to check 6:40 what are the other attributes we can 6:41 determine with the help of all those 6:43 four attributes so we are having D we 6:45 can get a so a is already there so this 6:49 is the closure of a attribute a so for 6:53 example if you want to get the closure 6:55 of B 6:58 d 6:59 so the first one is 7:02 whatever the attributes for which we are 7:04 finding the closure that should be added 7:06 in the resultant set so D will be the 7:08 first one 7:10 okay so if you are having the value of D 7:13 we can get the value of B itself so that 7:15 will be the self okay self instruction 7:19 now in our resultant set we are having 7:21 the value of D from the functional 7:23 dependencies by having the 7:26 what are the other attributes we can get 7:28 so if you know D we can get the 7:31 attributes a we can get the a so a now 7:36 our resultant set is having both d and a 7:38 so 7:40 if you are having a we can get a B 7:44 we can determine the value of B and see 7:47 now the resultant set we are having the 7:49 three d a b so we are having a we can 7:52 get a B so already there we have we are 7:54 having B so we can get the C value 7:58 C 7:59 now the resultant set we are having a 8:01 four attributes a d a b and c so d 8:07 we can get a so already there 8:10 next a we can get a B already there b we 8:13 can get a c already there see we can get 8:15 a d already there so this is a closure 8:18 of t plus 8:20 D Plus and here you can see e now let us 8:25 find the closure of e plus 8:28 e plus 8:29 so the first first 8:32 attribute we can get in the results and 8:35 the resultant set is the self attribute 8:37 so e now the resultant set we are having 8:40 e so from the functional dependencies if 8:44 you know the value of V what are the 8:45 other attributes we can get so there is 8:48 no functional dependency with attribute 8:51 e 8:52 right so you need to find here so there 8:54 is no attribute e so that will be the 8:57 single 8:58 attribute in the resultant set that's a 9:01 single attribute in the resultant set 9:03 and also you can get the details of B 9:05 and C 9:09 so we can get a B and C the closure of 9:12 BC okay BC 9:15 so the first attributes are the self 9:18 attribute so we can get a values of B 9:20 comma C now the resultant sector we are 9:23 having B and C if you know B we can get 9:25 a c already there if you are knowing C 9:28 we can get a d so D and now our 9:32 resultant set we are having a b c d b c 9:35 and d three attributes if you know D U 9:37 we can get a from the functional 9:38 dependencies so EA so this is the 9:41 closure of b c plus 9:44 right so hope you understood so this the 9:47 meaning of this functional dependency 9:49 means if you know the value of a we can 9:51 determine the value of B so that's why 9:54 we call B is a functionally dependent on 9:56 a so here this closure is a set of 10:00 attributes that are functionally 10:01 determined by the attribute set so 10:04 what are the attributes we can determine 10:06 by using this particular attributes is 10:09 the resultant set 10:11 right so hope you understood this one 10:14 this is one example let us move on with 10:15 the second example 10:18 so let us take the second example so 10:20 these are the attributes of a given 10:22 relation r 10:23 and the functional dependencies are this 10:25 one a tends to BC BC tends to d e d 10:29 tends to f and c f comes to G so this 10:33 implies 10:34 if you know a we can get the values of B 10:37 and C so simply you can write it a if 10:40 you know a we can determine B if you 10:43 know a we can determine C 10:46 so we can divide this one and coming to 10:49 this one 10:51 so if you know both the values of B and 10:55 C then only you can determine d e so we 10:57 should not divide the left hand side 11:00 portion that means a determinant 11:02 okay we should not divide the 11:04 determinant so determinant means only 11:06 with the combination of B and C we can 11:08 determine d e 11:09 so this can be decomposed as 11:12 BC 11:14 if you know B and C values we can get a 11:16 d value or if you know B and C values we 11:19 can get a e value 11:21 so you should not divide the 11:22 determinants right so d e can be 11:25 determined only with the help of 11:27 combination of B and C 11:29 okay if you are having only P we can't 11:31 determine D if you are having only C we 11:34 can't determine d 11:35 and similarity DF and this is also same 11:37 CF so with the combination of C and F we 11:40 can determine G so we should not divide 11:42 this one so just remember this one right 11:44 now we find the closures and let us find 11:48 the closure of a plus 11:51 let us find the closure of a plus the 11:53 first one will be yourself 11:55 a so this will be the resultant set 12:01 a resultant set so a now the resultant 12:04 set we are having a so with the help of 12:06 a we are having a so what are the other 12:09 attributes we can determine with the 12:10 help of a from the functional dependency 12:12 so if you are having a we can determine 12:15 either B or C so we can determine either 12:18 b or c 12:20 any other yes right now the resultant 12:23 set we are having a b and c 12:26 in the resultant State we are having a b 12:28 and c now see second functional 12:32 dependency if you are having B and C we 12:34 can determine d e 12:36 so we are having BC okay we have we are 12:38 having B and C so we can determine D or 12:42 e 12:44 so now we are having the results at five 12:46 attributes a b c d e now from this third 12:49 one if you know D we can determine F yes 12:54 yes 12:56 and next one if you know C and F we can 12:59 determine G so in the resultant State we 13:01 are having C and F so we can determine G 13:04 so 13:07 this will be the 13:09 closure of a the closure of a 13:14 and see the next one let us take 13:21 closure of B 13:24 closer of D so here you can observe 13:27 the first one will be the self that is a 13:30 d and now the resultant set we are 13:32 having the value of D so with the help 13:34 of T we can determine the value of e f 13:37 so D comma 13:39 yeah okay D comma yeah now in the 13:43 resultant set we are having D and F both 13:45 the D and F so you can observe here we 13:49 can determine G only with the 13:51 combination of C and F so but in the 13:52 result ends that we are having only F 13:54 there is no C so we can't determine G 13:56 value 13:57 okay so any other attributes which can 14:01 determine with the help of D or F no so 14:04 this will be the 14:06 closure of B plus because here we can 14:08 observe with that with the help of D we 14:10 can determine F and with the help of C 14:12 and F we can determine G 14:14 so only the two things and you can also 14:18 take the 14:20 multiple attributes closure 14:26 see BCD Plus 14:28 that means the closure of b c and d 14:31 the closure of b c and 14:34 so the self that means the First 14:35 characters 14:36 are the B C and D now in our closure in 14:41 our resultant set we are having a b c 14:44 and d so if you know B what are the 14:47 other attributes so from the second 14:49 functional dependency if you know B and 14:51 C we can get a d and e so we are having 14:54 B and C in the resultant cell so we can 14:57 get a d and e already D is available 14:58 here so include e include e now when the 15:02 resultant set we are having b c d e now 15:05 so we if you from the third functional 15:07 dependency if you know D we can get a f 15:10 so we can also get F here and coming to 15:13 the last one so if you know C and F we 15:16 can determine G so here we are having C 15:18 and F we can determine G we can 15:22 determine G so 15:25 any other attributes we can determine so 15:29 we see we can get a d e D we can get F 15:32 see if we can get a g 15:35 right so this is the closure of 15:38 b c d Plus 15:41 right so hope you understood this one 15:46 right so this is the closure this is a 15:50 closure 15:51 we can find from the given functional 15:54 dependency 15:56 right and what is the purpose of finding 15:59 this closure so finding this closure 16:01 will can determine the number of Super 16:04 keys in the number of candidate Keys 16:07 available in the given relation 16:09 right so we can find out what are the 16:11 supercation what are the candidate Keys 16:13 available in the given relation with the 16:15 help of disclosures 16:17 right so uh hope you understood this 16:20 closure let's stop here in the next 16:22 session we'll see more details about the 16:25 closure so what is the purpose that 16:26 means finding the super keys and the 16:28 candid keys from the closures by using 16:31 these closures 16:32 right so let's stop here hope you 16:35 understood this one and if you are 16:36 having any doubts regarding the 16:37 calculation of disclosure so feel free 16:39 to post your thoughts in the comment 16:40 section definitely I will try to clarify 16:42 all your thoughts if you really enjoyed 16:43 my session like my session share my 16:45 session with your friends and don't 16:47 forget to subscribe to our Channel 16:48 thanks for watching thank you very much