On the upper right, change the engine. My solution here worked for MySQL.
SELECT
MAX(IF(occupation = 'Doctor', name, NULL)) AS Doctor,
MAX(IF(occupation = 'Professor', name, NULL)) AS Professor,
MAX(IF(occupation = 'Singer', name, NULL)) AS Singer,
MAX(IF(occupation = 'Actor', name, NULL)) AS Actor
FROM (
SELECT
name, occupation,
ROW_NUMBER() OVER (PARTITION BY occupation ORDER BY name) AS rn
FROM occupations
) AS t
GROUP BY rn
ORDER BY rn;