For D1:
(P,Q,S,T) {}
(P,T,X) { P--> X} pk = {PT}
(Q,Y) { Q--> Y } PK = {Q}
(Y,Z,W) { Y --> ZW} PK = {Y}
The Relations and their corresponding FD's
Let's Join (P,Q,S,T) & (P,T,X) common attribute = P
P is a Super key(Primary key is a minimal Super key) we can join and it will a lossless join
(P,Q,S,T,X) becomes the new Table
Now Join (P,Q,S,T,X) & (Q,Y) ,here Q is the common and it is the Pkey of (Q,Y)
Lossless Join and becomes (P,Q,S,T,Y,X)
Finally Join (P,Q,S,T,Y,X) & (Y,Z,W)
Similarly joined as YZ is a Skey
so , Lossless.
But For D2:
(P,Q,S),(Q,Y),(Y,Z,W) These three can be joined but the resultant can;t be joined with this (T,X)
as there will no common attribute.