Added sql to write to leveldata and changed wave column to waveaccum
Setup sql to read from the levedata table