SQL schema v4

schema should be finalized and not changed anymore.