I leverage Kartik's notification widgets.
As for complexity SQL query we have two solutions as below, I will discuss #2 in this article.