Drupal provides a variety of options for users to interact with the CMS, one way is displaying queries for views. You can enable query in the view page by the following steps
- Goto "Admin > Structure > views"
- Click on the "Settings" tab (admin/structure/views/settings)
- Check the option for "Show the SQL query"
- Click on Save configuration
Drupal 8 also provides additional feature for viewing "performance statistics", "other queries run during render". You can enable the options as per your requirement and view the data in preview window