SQL - Is it possible to have a Trigger statement with a WHERE clause that is an equality measure I'm trying to add a counter to one of my tables. So far I have these tables

Heroes {hero_id, hero_name, villain_id, team_id}
Villains {villain_id, villain_name, team_id}
Teams {team_id, team_name, no_of_members}


I want to create a trigger that updates the member count whenever a person is added to a team. So far i have something like this but it keeps giving me Trigger compilation errors. I have seen other instances where people have used WHERE clauses in triggers but they arent similar to my problem. If anyone could tell me why this isnt compiling or what I'm doing wrong I'd be very grateful.

CREATE TRIGGER team_no_inc 
    BEFORE INSERT ON Heroes
    FOR EACH ROW
BEGIN
    UPDATE Teams SET no_of_members = no_of_members + 1 
    FROM Heroes, Teams WHERE Teams.team_id = Heroes.team_id;
END;
.
RUN;
In Oracle triggers, you can access the modified table using :NEW (for inserted and after an update data) and :OLD (for deleted and before the update). 

Also there is noUPDATE .. FROM syntax. Your trigger can be written:

CREATE TRIGGER team_no_inc 
    BEFORE INSERT ON Heroes
    FOR EACH ROW
BEGIN
    UPDATE Teams SET no_of_members = no_of_members + 1 
    WHERE Teams.team_id = :NEW.team_id;
END;


Tested at dbfiddle.uk.