nerdexam
Microsoft

DP-300 · Question #236

Hotspot Question You have an Azure SQL database. You need to identify whether a delayed query execution is associated to a RESOURCE_SEMAPHORE wait. How should you complete the Transact-SQL…

The correct answer is SELECT: wait_type; FROM: sys.dm_exec_requests. To identify RESOURCE_SEMAPHORE waits, the query must select and group by 'wait_type' from 'sys.dm_exec_requests' to analyze active request wait statistics.

Submitted by yousef_jo· Mar 6, 2026Optimize query performance

Question

Hotspot Question You have an Azure SQL database. You need to identify whether a delayed query execution is associated to a RESOURCE_SEMAPHORE wait. How should you complete the Transact-SQL statement? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point. Answer:

Exhibit

DP-300 question #236 exhibit

Answer Area

  • SELECTwait_type
    wait_typecontext_infowait_resource
  • FROMsys.dm_exec_requests
    sys.dm_exec_requestssys.dm_exec_connectionssys.dm_db_partition_stats

Explanation

To identify RESOURCE_SEMAPHORE waits, the query must select and group by 'wait_type' from 'sys.dm_exec_requests' to analyze active request wait statistics.

Approach. The task is to complete a T-SQL statement to identify RESOURCE_SEMAPHORE waits associated with delayed query execution in an Azure SQL database.

  1. For the SELECT clause (first dropdown): The correct option is wait_type.

    • Reasoning: To identify a specific type of wait, such as RESOURCE_SEMAPHORE, you need to examine the wait_type column. This column categorizes the reason for a session or request waiting.
  2. For the FROM clause (second dropdown): The correct option is sys.dm_exec_requests.

    • Reasoning: sys.dm_exec_requests is a Dynamic Management View (DMV) that provides information about each request currently executing on SQL Server, including detailed wait statistics like wait_type, wait_time, and session_id. This is the appropriate source for active query execution wait information.
  3. For TARGET1 (GROUP BY clause): The correct selection, inferred from the SELECT clause, is wait_type.

    • Reasoning: When using an aggregate function like SUM(wait_time) in the SELECT clause, any non-aggregated columns also present in the SELECT list must be included in the GROUP BY clause. Since wait_type is selected to categorize the wait times, the results must be grouped by wait_type to correctly sum the wait times for each distinct wait type.

Common mistakes.

  • common_mistake. Selecting incorrect options in the dropdowns will lead to an invalid query or a query that does not address the problem statement.

  • Incorrect SELECT clause choices:

    • context_info: This column holds application-specific context information for a session; it is not used for identifying wait types.
    • wait_resource: While related to waits, wait_resource provides the specific resource being waited on (e.g., a memory grant ID, a lock ID, a page ID), not the broad type of wait (like RESOURCE_SEMAPHORE). The question explicitly asks to identify the RESOURCE_SEMAPHORE wait (the type of wait).
  • Incorrect FROM clause choices:

    • sys.dm_exec_connections: This DMV provides information about connections, but it lacks the detailed request-level wait statistics (wait_type, wait_time) needed to diagnose execution delays effectively.
    • sys.dm_db_partition_stats: This DMV provides statistics about database partitions (e.g., row counts, used space, I/O), which is completely unrelated to query execution waits and RESOURCE_SEMAPHORE waits.
  • Incorrect GROUP BY clause: If TARGET1 were anything other than wait_type (e.g., session_id), the query would either be invalid (if wait_type was selected but not grouped by) or would aggregate wait times in a way that doesn't answer the specific question of identifying wait types.

Concept tested. The primary concepts tested are SQL Server performance monitoring and troubleshooting using Dynamic Management Views (DMVs), specifically identifying and analyzing wait statistics (wait_type and wait_time) for query execution. It also tests fundamental T-SQL syntax knowledge, including SELECT, FROM, JOIN, WHERE, GROUP BY, and the use of aggregate functions.

Topics

#T-SQL#query performance#wait types#DMV

Community Discussion

No community discussion yet for this question.

Full DP-300 Practice