SQL data queries using the graphical query builder
The query builder is SQL-like in its language syntax, and it is worth an introduction as part of an independent workflow. For example, simply because I code in Python or write SQL queries doesn’t mean I avoid a good shortcut here and there. Let’s take a look at the query builder and then explore how to integrate SQL syntax into our filters and code expressions.
First, we will access the query builder. Follow these steps:
- Select Layer from the menu in QGIS, scroll down to Layer Properties, and activate it by clicking on it, as shown in Figure 6.1:
Figure 6.1 – Layer properties in QGIS
- When you click on the Layer Properties option, the window opens, as shown in Figure 6.2. Select Source and the page will display the following options:
- Settings: Displays the layer name and data source encoding. The default is
UTF-8
. - Assigned Coordinate Reference System (CRS): This operates...
- Settings: Displays the layer name and data source encoding. The default is