query validations