Thank you so very much as using these codes in my query, i was able to get the required result.here is how i write my query
SELECT student_id,subject, total_marks,marks_obtained, (SELECT Count(*) FROM test_tab As Q WHERE Q.student_id = test_tab.student_id) AS Subj_Count, (SELECT Count(*) FROM...