how to get the marks in ‘Math’ of ‘English’ topper for each class in mysql for student result data
This question intrigued me - the requirement to have the mark for Mathematics for the class (regardless of role) which (who?) obtained the best mark in English.

I decided to go one better and obtain the results for all subjects for the best in class in English - fiddle available here. 

The SQL:

SELECT t1.class, t1.roll_number,
       t1.sci_mark,
       t1.comp_mark,
       t1.math_mark,
       t1.eng_mark
FROM 
(
  SELECT 
    class, 
    roll_number,
    SUM(CASE WHEN subjects = 'math'
      THEN marks ELSE 0 END) AS math_mark,
    SUM(CASE WHEN subjects = 'english'
      THEN marks ELSE 0 END) AS eng_mark,
    SUM(CASE WHEN subjects = 'science'
      THEN marks ELSE 0 END) AS sci_mark,
    SUM(CASE WHEN subjects = 'computer'
      THEN marks ELSE 0 END) AS comp_mark
  FROM resultdata
  GROUP BY class, roll_number
) AS t1
JOIN 
(
  SELECT class, MAX(marks) AS maxmark
  FROM resultdata
  WHERE subjects = 'english'
  GROUP BY class
) AS t2
ON 
  t1.class = t2.class AND 
  t1.eng_mark = t2.maxmark
ORDER BY class, eng_mark DESC;


Result:

class   roll_number sci_mark    comp_mark   math_mark   eng_mark
    8             2       87           99          78         89
    9             1       85           85          90         85
   10             2       65           85          50         95


A glance at the other solution here shows that it matches on the Mathematics score for the highest English mark. Inspection shows that it works for the two other subjects (Science and Computers) also. As pointed out here MySQL does not have a PIVOT function, but I got this technique from that site.