Create, edit, and run a query