SELECT P1.name, P2.name
FROM PUPILS P1, PUPILS P2
WHERE P1.gender='МАЛЬЧИК'
AND P2.gender!='МАЛЬЧИК'
AND P1.height>P2.height
SELECT b.name AS boy_name, g.name AS girl_name
FROM Pupils b
JOIN Pupils g ON b.gender = 'М' AND g.gender = 'Ж' AND b.height > g.height