select,where and orderBy function