Understanding the SQL query builder in QGIS
We have been building SQL queries in DB Manager thus far, but there is one more tool that is useful when writing SQL syntax in large datasets. In the SQL window (visible when you select the icon in the top-left menu), there is a SQL symbol located in the upper-left corner of the console. It opens with a vertical list of SQL prompts.
- Columns lists the actual columns in the database tables, which you can select using the dropdown on the far right in the Data section. Once you select a table, all of the columns in the dataset are displayed as follows:
Figure 8.1 – The SQL query builder inside the SQL window in QGI
- Where is populated when you select Columns’ values in the right-hand vertical section in Figure 8.2. The column value in the data column will populate and display the variables listed in the column of interest. In the example, values for landuse equal to residential will...