Fixed sql errors in the reader and writer

Missed s in "select"
Forgot to update table wavedata to wave_data