I got two tables Product(Productname VARCHAR(10), Rating REAL) and Review(RatingID INT, Productname VARCHAR(10), Rating INT).
The Rating of the product is the average of all Ratings given in reviews for that specifig product.
I'd like to have a trigger, that updates a product whenever a new review is inserted or update, but I just can't wrap my head around how to do it.
Is there some db2 equivalent to inserted() from SQL Server?
My apologies for the weak question.