MYSQL, how to build this Trigger
Though this question is 2 years old, seems like it deserves an answer.

Make sure to look at 
MySQL documentation 21.3.1 Trigger Syntax and Examples 
in order to understand the importance and context of the delimiter statement.

Create trigger tbi_new_ranking before insert on rankings 
for each row

BEGIN
 DECLARE v_ranking INTEGER;
 DECLARE v_aggregate_ranking INTEGER;
 DECLARE v_object VARCHAR(&lt;how many characters&gt;);


 set v_object = NEW.object;
 /*
   Define the code you want to aggregate the ranking numbers.
   The inserting data is addressed by prefixing the triggering table's columns with
   NEW. This can be a little confusing so it is wise to set up variables
   to represent the inserted data rather than mussing about with them directly
   E.G.
     SELECT count(*) INTO v_count from Rankings where Object = NEW.Object;
     SELECT sum(Ranking) INTO v_sum from Rankings where Object = NEW.Object;
     set v_aggregate_ranking = v_sum/v_count;
 */

 update objects set rank = v_aggregate_ranking where object = v_object;
END