Updated sql class structure, changed to a Switch for ca correct