db scripts with timestamp query.