there are two tables
table A
if user use this query \"insert into A values(abc,1,50);\"
then trigger should check student_nam
You can simply this by using On Duplicate Key Update . Add a unique key on student name / ID then use the following code in your trigger
begin
insert into summary_score (name,number,all_marks)
values(new.name,new.marks,new.score)
on duplicate key update all_marks=old.all_marks+new.student_marks
where B.Name=new.Name;
end $$