The diagram pane, the top pane in the
Visual SQL Editor, displays the tables and joins in your query. Tables list their columns. Joins appear as lines between tables. Changes you make to your query in the diagram pane also appear in the SQL pane.
Some things you can do with tables:
View the tables, columns, and joins in your query.
Move the tables in the Visual SQL Editor by dragging them to a new position.
Add tables to the query by dragging them from the
or
by right-clicking in the Visual SQL Editor and choosing Add Table.
Remove a table from a query by selecting the table, right-clicking,
and choosing Remove From Query. You can also select a table and press the Delete
key or choose Edit > Delete from the main menu.
Set a table's alias by selecting the table and entering the new alias in the Properties window.
Some things you can do with joins:
Set join properties, such as whether it's an INNER join or an OUTER join, by selecting the join and changing the properties in the Properties window.
Create joins between tables. The Visual SQL Editor automatically creates joins between tables based on
foreign key metadata, but you can create additional joins by dragging a column from one table onto
a column in a second table. For example, if you drag TABLE1.COLUMN1 to TABLE 2.COLUMN4, the
IDE adds the following code to the WHERE clause:
WHERE TABLE1.COLUMN1 = TABLE 2.COLUMN4
Delete joins by selecting the
join line and pressing the Delete key.
Some things you can do with columns:
View the types of columns included in the query. A key icon indicates that the column is a
primary key; a primary key is a unique identifier for each value in a row, such as a Social
Security number. A key with an arrow indicates that the column is a foreign key; a foreign key
links an item in a row back to a primary key in another table.
Add or remove columns from the query. To add a column, make sure that its checkbox
is selected. To remove a column, clear the checkbox.
Add a Group By clause by right-clicking the pane and choosing Group By. Group By groups the
results by row.
If the SQL query contains code that is not supported by the diagram pane,
the diagram pane becomes blank, but you might still be able to execute the
query.