0.0.13:waterfall sql logic