Fixed get core SQL builder
Implemented getting Cores from DB