#Querying using QGIS
##Select by Expression
You can Select by Expression by opening the attribute of a desired layer and clicking on the 'Select by Expression' button.
You can then enter an expression. The example shown above queries all rows that have the string 'hospital' found in the 'other_tags' column.
##DB Manager
If you have your data in a database such as PostGIS or SpatiaLite, you can also go to your 'Database' in your top menu and open 'DB Manager'. Select your database then open the SQL Window to enter queries.
SELECT osm_id,name,other_tags FROM points WHERE (other_tags LIKE '%amenity%' AND other_tags LIKE '%hospital%')
For this SQL statement, only the osm_id,name, and other_tags columns will be displayed in the returned rows. It will select all rows from the points table that have both 'amenity' and 'hospital' in the other_tags column.
Check out this CartoDB tutorial to learn more about writing SQL.