Creating a Query in Query Builder

This topic explains how to create and edit an SQL query in Fusion for MySQL 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 sakila database and display all the films stored in the sakila database, that were released after 2004.

To create a query visually:

  1. Create a server connection.
  2. On the Fusion menu, select Database Explorer. To drag required columns to the Query Builder, select Send to on the required column shortcut menu, and then click Query Builder.

  3. Select the film_id and title check boxes in the film table, and the name check box in the category table.

Actually, our query is ready to be executed. However, we need to add a WHERE condition, to display the films that were released after 2004.

  1. Go to the Where tab to insert the condition. Click the green plus icon.

  2. Click enter value.

  3. Select release_year from the list.

  4. Click the equals sign and select greater than instead.

  5. Click enter a value and type 2004.

  6. 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.