Create query validation