SQL schema v2

Cleared syntax errors.