awk -F"|" ' ##### Setting up the field seprator to pipe(|) as per your Input_file.
{ o[$2 FS $3]=1; p[$2 FS $3 FS $1]=1; } ##### creating an array named o whose index is $2 and $3 whose value is 1 and an another array whose name is p with indexs $2, $3 and $1 and value is 1.
END { ##### END section starts here.
t="SCHEMA|TABLE|SELECT|INSERT|UPDATE|DELETE|REFERENCES" ##### mentioning a variable t whose value is "SCHEMA|TABLE|SELECT|INSERT|UPDATE|DELETE|REFERENCES"
print t; n=split(t, a, FS); ##### printing value of t and spliting the variable t into an array named a whose field seprator is pipe(|).
for (i in o) { ##### starting for loop for array named o.
l=""; ##### nullyfing variable l here.
for (j=3; j<=n; j++) l=l FS ((p[i FS a[j]]) ? "Yes" : "No"); ##### starting for loop from j's value 3 to till value of variable n, where n is the number of fields of variable named t. Now setting up value of l, value of array p is present for this then l's value should be yes or it should be no.
print i l; ##### printing the value of variable i and then variable l.
}
}
' Input_file ##### mentioning the Input_file name here.