query to create pages