.. _section-Setting Variables in a Query: Setting Variables in a Query ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Before executing a selected query, values may be supplied to variables to limit the scope of the query execution. For example, in the **Queries** window, click to highlight the query ’What are all the grandparent/grandson pairs?’. Click **Variables** to reveal the 2 variables in the query: **?Grandparent** and **?Grandson**. Click the **Value** field next to **?Grandparent** and type in **Dana**. .. figure:: ../../figs/Queries-set-grandparent.png :alt: Variable **?Grandparent** set to **Dana** for query ’What are all the grandparent/granson pairs?’ Variable **?Grandparent** set to **Dana** for query ’What are all the grandparent/granson pairs?’ Press **Execute**. The query will be executed with the variable **?Grandparent** set to **Dana**, and **Query Results** returned will show results for grandparent **Dana** only. .. figure:: ../../figs/Queries-results-for-grandparent-dana.png :alt: Query results for ’What are all the grandparent/granson pairs?’ with **?Grandparent** set to **Dana** Query results for ’What are all the grandparent/granson pairs?’ with **?Grandparent** set to **Dana**