alert sqlite logic and alertupdate