sql to bulk update community stats