It ain't pretty!
To use the above solutions, you could do:
SELECT
Sno,
Name,
NULLIF(SUBSTRING_INDEX(SUBSTRING_INDEX(all_subjects, ',', 1), ',', -1), '') AS Sub1,
NULLIF(SUBSTRING_INDEX(SUBSTRING_INDEX(all_subjects, ',', 2), ',', -1), '') AS Sub2,
NULLIF(SUBSTRING_INDEX(SUBSTRING_INDEX(all_subjects, ',', 3), ',', -1), '') AS Sub3,
NULLIF(SUBSTRING_INDEX(SUBSTRING_INDEX(all_subjects, ',', 4), ',', -1), '') AS Sub4
FROM (
SELECT Sno, Name, CONCAT(GROUP_CONCAT(Subjects ORDER BY Sno),',,,') AS all_subjects FROM table GROUP BY name
) inner_sel
;
Your requests leads to the assumption there can be never more than 4 subjects. You also require NULLs where there is no mention of four subjects.
There kind of requests lead to a forced SQL code, one which is typically what SQL is intended for.
To explain the above: we use GROUP_CONCAT, then break it again to pieces. Since there could be fewer than 4 elements, we pad with commas (',,,'). We then break each piece according to its place within the concatenated string, and return with NULL if it's empty.
Can't say this is one of my better answers in terms of prettiness. I hope you find it useful.