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

  1. Goto "Admin > Structure > views"
  2. Click on the "Settings" tab (admin/structure/views/settings)
  3. Check the option for "Show the SQL query"
  4. 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

You can find more Drupal 8 details here