Implemented sql vistor functionality for shot visit