Setup sql to accumulate how many times a wave was reached