Flow Diagram With Sql Query