script for query.