Updated sql calls