Creating a Stream Query from a Database