pgAdmin Query Tool

### pgAdmin Query Builder

The Query Builder allows you to build SELECT queries graphically. Queries can then be executed, or EXPLAINed using the same threaded query engine as the Query Tool

To build a query, first press the Add Table/View button on the toolbar. Select one or more tables or views, and click the OK button to add tem to the workspace.

To add joins between relations, using your mouse simply drag and drop a column from the parent relation on the appropriate column in the child relation. In the resulting dialogue box, confirm the options and make any required changes, then click the Add button to add the join.

To add columns to output or restrict the query, simply double-click them. Any selection criteria can be added as required in the column grid.

Once the query is built, click the Execute button to run it, or the Explain button to view the query plan. You may view the output, SQL, messages and session history on the appropriate tab.