Data issue

This changes the SQL layout to support (pre)processed data without raw/preprocessed data.
It fixes any relevant code involved on thath
done