Courseiva

DP-300 Plan and implement data platform resources Practice Question

You are monitoring an Azure SQL Database and notice a pattern of high CPU usage during business hours. You need to identify the queries consuming the most CPU over the last 24 hours. Which dynamic management view should you query?

⚠ Common exam trap

Candidates often confuse sys.dm_exec_requests (current activity) with sys.dm_exec_query_stats (historical aggregated stats), leading them to choose Option A because they think 'requests' implies all recent queries, but it only shows currently running queries.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

sys.dm_exec_query_stats

sys.dm_exec_query_stats (Option C) is the correct DMV because it returns aggregate performance statistics for cached query plans, including total CPU time (total_worker_time), execution count, and last execution time. By querying this view and ordering by total_worker_time descending, you can identify the queries that have consumed the most CPU over the last 24 hours, directly addressing the pattern of high CPU usage during business hours.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    sys.dm_exec_requests

    Why it's wrong here

    sys.dm_exec_requests shows only currently executing requests, so queries that ran earlier in the 24-hour window and already completed are absent, leaving the historical CPU picture incomplete. It is tempting because it exposes live CPU usage per request, and would be correct for diagnosing what is running right now.

  • ✗

    sys.dm_exec_sessions

    Why it's wrong here

    sys.dm_exec_sessions reports session-level metadata such as login name, status and connection details, not per-query CPU consumption, so it cannot rank the top CPU-consuming statements. It is tempting because it lists active sessions, and it would be the right choice for auditing who is connected or finding idle sessions.

  • ✓

    sys.dm_exec_query_stats

    Why this is correct

    sys.dm_exec_query_stats aggregates cumulative CPU time per cached query plan, letting you rank statements by total worker time across the 24-hour window. Unlike sys.dm_exec_requests, which shows only currently executing queries, it retains historical totals, directly satisfying the requirement to identify the highest-CPU queries during business hours.

  • ✗

    sys.dm_os_performance_counters

    Why it's wrong here

    sys.dm_os_performance_counters returns server-wide counter values such as total CPU usage, not the text or identity of individual queries, so it cannot attribute CPU to specific statements. It is tempting for spotting overall CPU pressure trends, and would be correct when you need instance-level performance counters rather than query-level detail.

About these practice questions

One of 574 original DP-300 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DP-300 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DP-300 exam.