i want to create mysql trigger for followin table... How to do?
table_name : test_record


Field                  Type           Null     key
student_id,            int(11),       NO,      PRI 
test_number,           int(11),       NO,     PRI 
test_date,              varchar(30),  NO,     PRI 
test_subject,           varchar(45),  YES,  
test_max_mark,          int(11),      YES,  
test_mark_obtained,      int(11),     YES, 

table_name :test_result


Field                       Type           Null     key
id,                        int(11),         YES,  
student_id,                int(11),         NO,    PRI 
test_total_mark_math,        int(11),         YES 
test_total_mark_math_obt,    int(11),         YES 
test_total_mark_phy,         int(11),         YES 
test_total_mark_phy_obt,     int(11),         YES 
test_standard_deviation,       decimal(5,2),    YES 
test_percentage,           decimal(5,2),     YES 


Now here i want if any record is inserted in test_record then trigger will automatically update the test_result.

in test_record , suppose entries are
1   ,   1  , 11/09/2012 , maths , 60 , 40

then in test_result entries should be....

1 , 1 , 60 , 40 , 0 , 0 , 0 , 66.67

i want to create mysql trigger for followin table... How to do?
===

table_name : test_record


Field                  Type           Null     key
student_id,            int(11),       NO,      PRI 
test_number,           int(11),       NO,     PRI 
test_date,              varchar(30),  NO,     PRI 
test_subject,           varchar(45),  YES,  
test_max_mark,          int(11),      YES,  
test_mark_obtained,      int(11),     YES, 

table_name :test_result


Field                       Type           Null     key
id,                        int(11),         YES,  
student_id,                int(11),         NO,    PRI 
test_total_mark_math,        int(11),         YES 
test_total_mark_math_obt,    int(11),         YES 
test_total_mark_phy,         int(11),         YES 
test_total_mark_phy_obt,     int(11),         YES 
test_standard_deviation,       decimal(5,2),    YES 
test_percentage,           decimal(5,2),     YES 


Now here i want if any record is inserted in test_record then trigger will automatically update the test_result.

in test_record , suppose entries are
1   ,   1  , 11/09/2012 , maths , 60 , 40

then in test_result entries should be....

1 , 1 , 60 , 40 , 0 , 0 , 0 , 66.67
