Courseiva

DP-900 Practice Question: Identify considerations for relational data on Azure

A company uses Azure SQL Database for an employee management system. The Employees table has 10 million rows and a clustered index on EmployeeID (the primary key). Queries that filter employees by Department and then sort by HireDate are very slow. Which indexing strategy will most improve performance for these queries?

⚠ Common exam trap

It's easy for candidates to choose Option B because they think any index on both columns will help, but they overlook that the key column order must match the WHERE clause filter first to enable an efficient seek, not just the sort order.

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

Create a nonclustered index on (Department, HireDate) and include the other needed columns as included columns.

A nonclustered index on (Department, HireDate) with included columns is optimal because it supports both the WHERE clause filter on Department and the ORDER BY on HireDate as a covering index. The index key order matches the query's filter and sort requirements, allowing SQL Server to perform a single index seek and avoid key lookups by including all needed columns. This eliminates the need to scan the clustered index or sort rows after filtering.

Answer analysis

Option-by-option breakdown

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

  • Create a nonclustered index on (Department, HireDate) and include the other needed columns as included columns.

    Why this is correct

    This index creates a composite key with Department as the leading column, allowing precise seeks for the equality filter, while HireDate as the second key column ensures rows are read in the exact sort order required by ORDER BY, eliminating a separate sort operator. By adding all other columns referenced in the query (such as employee details and salary) as included columns, the index becomes a covering index; the storage engine can return every required column directly from the index pages without performing expensive key lookups to the clustered index, drastically reducing I/O and providing optimal performance for this selective, sorted retrieval pattern.

  • Create a nonclustered index on (HireDate, Department) with no included columns.

    Why it's wrong here

    This index would help with sorting by HireDate, but the leading key is HireDate, not Department. To filter by Department efficiently, Department should be the leading key. Also, without included columns, key lookups may still be needed.

  • Create a clustered index on Department.

    Why it's wrong here

    Changing the clustered index to Department would reorder the entire table physically by Department. While this might speed up departmental queries, it would hurt other queries that rely on the primary key (EmployeeID). A clustered index should generally remain on the primary key for uniqueness and range scans.

  • Drop the existing clustered index and recreate a clustered columnstore index.

    Why it's wrong here

    Dropping the clustered B-tree index for a columnstore index would remove the primary key’s clustered index, breaking row-based point lookups by EmployeeID and increasing write overhead, while columnstore indexes are optimised for analytic aggregation scans, not the row-based filter-and-sort pattern on Department and HireDate. This option tempts because columnstore excels at compressing large tables for reporting queries that aggregate many rows, making it correct for data-warehouse workloads rather than transactional employee lookups.

About these practice questions

One of 820 original DP-900 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-900 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-900 exam.