Online Documentation for SQL Manager for PostgreSQL

Working with diagram area


The main working area of Design Query editor is the diagram area available within the Builder tab. Here you can create a query by placing the database tables and views onto the area, and edit it by selecting the required data fields and setting links between objects.

 

To add an object to the query, you can simply drag it from the DB Explorer tree to the diagram area.

 

To include a field in the query, check the corresponding box located to the left from the field name in the list, or just double-click it. To include all fields of the table/view, check the box located to the left of the table/view caption. If you do not check any fields, the SQL statement is generated as SELECT * FROM <table/view_name>, i.e. all the fields are included in the query.

 

To collapse/expand the list of table/view fields, click the minimize/maximize button at the object caption.

 

To exclude a field from the query, uncheck the respective box. In order to remove the entire table/view from the query, close it by clicking the corresponding cross-button at the object caption, or right-click the object and select Delete from the context menu. You can also select the object and press the Del key.

 

To edit the alias of a table/view, double-click the object caption and enter the new name, or right-click the object and select Rename from the context menu.

 

Query Builder - Working with diagram area

 

 

Design Query allows you to create complex queries consisting of two or more queries combined in one with the UNION operator, or add nested queries. The panel to the left of the diagram area displays the tree of subqueries.

To add a query, right-click within the tree of subqueries area and select Add union from the context menu. A tab for the new query will appear in the diagram area.

To remove a query from the tree, right-click the query and select Delete union from the context menu.

To add the UNION ALL operator to the query, right-click the newly added query and select the corresponding context menu item.

 

Visual Query Builder - Union

 

Note: Depending on which query type you need to execute, you can select one from the drop-down list above the tree of subqueries: Select, Insert, Update, or Delete.

 

Visual Query Builder - Selecting query type