It is given that the value of sinisinr when light enters from medium P to medium Q is less than 1.Then
P is optically denser than Q
(sin isin r) < 1 => sin i < sin r
i.e., angle of incidence < angle of refraction. It means it bends away from the normal. When light enters from denser to rarer medium, light bends away from normal.
Hence, medium P is optically denser than Q.