This topic explains how to create and edit an SQL query in dbForge Fusion using the Query Builder features.
We are going to create a sample query using visual designer. Let’s repeat the sample we have created in the How To: Create and Edit a Query topic. We will use the HR database and display all the employees stored in the HR database, that are working in Shipping department with department ID number 50.
To create a query visually:
On the Fusion menu, click New Query. Alternatively, click Create New Query on the Devart-Main toolbar. Now, you can drag-and-drop tables from the Database Explorer to the editor. Holding CTRL, select the DEPARTMENTS and EMPLOYEES tables in the Database Explorer, and drag-and-drop them over to the visual editor.
Select the DEPARTMENT_ID and DEPARTMENT_NAME checkboxes in the DEPARTMENTS table, and the EMPLOYEE_ID, FIRST_NAME, and LAST_NAME checkboxes in the EMPLOYEES table.
Actually, our query is ready to be executed. However, we need to add a WHERE condition, to display all the employees working in the Shipping department.
Go to the Where tab to insert the condition. Click the green plus icon.
Click enter a value.
Select DEPARTMENT_ID from the list and then press ENTER.
Click enter a value, type 50, and then press ENTER.
Click Execute. The result set displays the information we have requested.
As you can see the results are the same we have in the Creating and Editing a Query topic.
Visual Query Builder is a powerful tool that allows you to build complex queries quickly and with no code typing.