Is the table containing STD_COURSE a master/reference/read-only table?
Ideally,
you should have the following tables, STUDENT_MASTER, COURSE_MASTER and STUDENT_COURSE_MAPPING.
STUDENT_MASTER = Student Details + Student ID
COURSE_MASTER = Course Details + Course ID
STUDENT_COURSE_MAPPING = Student ID + Course ID
Now, the STUDENT_COURSE_MAPPING table will contain Student ID, Course ID rows, for each student mapped to multiple courses.
Query this table to find the courses mapped and then in your front-end select/un-select the checkboxes appropriately.