Refact the base query to separate base_query.py
Adde update select test and fixed some error in update selet