This video by David Papkin Querying and Reporting Data with SCCM 2012 R2 . Microsoft System Center 2012 R2 Configuration Manager stores a large amount of data about the devices in your environment. You may not always want to perform all management tasks on all of the devices simultaneously. Therefore, to help you locate devices in your environment that meet specific criteria, you can create queries. You then can use these queries to create collections or to find clients and install the Configuration Manager client on them.
https://davidpapkin.net tech blog
https://davidpapkin.com azure blogs