Could I have still came up with the correct answer if I deleted the yellow part? Is it even neccesary?
Assuming this is no homework:
I guess |X|
is natural join and #
denotes the primary key attributes.
The highlighted projection on S#
is not necessary with respect to
correctness of the query result (effectiveness).
However, it may increase efficiency: Project as early as possible to
remove duplicates before the join. This avoids the unnecessary effort
of first producing duplicate natjoined tuples which the projection on
sname
then has to remove.