Update SQL to use new Database Structure

Experimental, will break things