I have a set of locations such that there are partitioned into five clusters, I used the categorized property under styles to differentiate points belonging to different clusters using different colors but I want to run queries such that I can select and display the points on the map according to cluster numbers using the queries in qgis.
Two possibilities come to me:
Categorized styling. Once you have applied the categorized style to your layer, you should see the different categories into the TOC. Each category is fitted with a tick box that you can tick or untick to display / hide points belonging to each category.
Query via Select by expression. You can also select points via a query (via Field Calculator). These points will then be highlighted with the selection color specified for your QGIS instance. I don't know how to display and hide points at the same time via a query...