Hands-free Building of Queries with Query Builder
Contents
- Drawing simple, complex, and any queries you need
- Adjusting queries to your needs
- Making maximum use of query results
- Summary
Creating queries and managing query results have been greatly improved and visualized thanks to contemporary GUIs of many modern tools. However, it happens that one can be easily lost in the variety of windows and a great deal of options, striving to quickly do the task.
Let's review one of possible ways to avoid difficulties, while building queries, and gain your point, while managing received data. This article describes the features of Query Builder — a professional tool for visual and quick creating and managing queries. It is integrated into dbForge Studio for MySQL or supplied as part of dbForge Fusion for MySQL.
Drawing simple, complex, and any queries you need
Effortless creating of queries is usually reached by various means. The core principle is to use a diagram where tables, participating in the query, are presented as shapes. So you can visually join tables, select columns, and do other tasks.
Query Builder uses a well-thought diagram where you can drag-and-drop tables from Database Explorer, a special window, which allows you to see and manage database schemas. You can select multiple tables at once, pressing the Ctrl key. On the diagram a table turns into a shape, which accurately shows the list of table's columns. You will see which columns have foreign and primary keys, as they are marked with special "key" icons.
Joining tables becomes simple, because you can quickly find the required tables and columns to join and then drag-and-drop the column of one table to the corresponding column of the other table. Moreover, joins are automatically created, if tables with foreign keys and their referenced tables are moved to the diagram. To change the join type, choose the join and select the required type (Left Outer or Right Outer) from the right-click menu.
The table shapes are very convenient both to view and to manage. When your query includes many tables, you will appreciate the following options to get better view:
- Resizing shapes (you can either manually resize shapes to various directions, dragging the resize markers at the shape sides, or fit the same size for multiple shapes using menu options - Make Same Width or Make Same Height.)
- Aligning shapes either in a column or in a row
- Placing one shape over another (When some shapes overlap each other, you can use the Bring to Front option from the right-click menu to place one shape over another, or the Send to Back option to do the opposite action.)
- Controlling spaces between shapes (You can proportionally increase and decrease horizontal and vertical spacing between the shapes, making it equal or just remove.)
- Zooming in and out the diagram
- Customizing the diagram ( You can set the diagram size in pixels, change the background color, or disable the diagram completely.)