All three table contains 'semester' and 'department' column
SELECT DISTINCT
test_name,
fname,
lname,
rno
FROM exam_attempted_list
INNER JOIN stud_test ON
exam_attempted_list.student_id = stud_test.student_id
INNER JOIN stud_reg ON
exam_attempted_list.student_id = stud_reg.student_id WHERE semester='2nd' AND department='cse'