add table query database and finished the basic function of last week(2014.1028 to 10.31)