Mutating table error is occurred when a trigger tries to update a row that it is currently using. It is fixed by using views or temporary tables.