So in my database, I have two tables which have a many to one relationship. I am trying to update the 'parent' table by looking at all the rows on the 'child' table (sorry if I'm not using the correct terminology here) and applying different sets of rules to the data to determine the values to update with. But I want to do this efficiently (which is to say, quickly).So in my database, I have two tables which have