Courseiva

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

A company uses Azure SQL Database for an HR system. The Employees table has a clustered index on EmployeeID. Queries frequently filter on DepartmentID and LastName and also retrieve the Salary column. The table contains over a million rows. Which index strategy will most improve query performance for these filters?

⚠ Common exam trap

Candidates often think separate single-column indexes are sufficient for multi-column filters, but they overlook the need for a covering composite index to avoid expensive key lookups or index intersection operations.

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

A: Create a nonclustered index on (DepartmentID, LastName) INCLUDE (Salary)

It creates a covering nonclustered index on the filter columns (DepartmentID, LastName) and includes the Salary column as an included column. This allows the query to be fully satisfied by scanning only the nonclustered index pages, avoiding key lookups to the clustered index. The order of columns in the index key matches the query filter pattern, maximizing seek efficiency.

Answer analysis

Option-by-option breakdown

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

  • A: Create a nonclustered index on (DepartmentID, LastName) INCLUDE (Salary)

    Why this is correct

    A nonclustered index on (DepartmentID, LastName) INCLUDE (Salary) is a covering index specifically designed for this query: it contains every column needed in the WHERE, SELECT, and ORDER BY clauses within the index leaf level. Because the index is sorted by DepartmentID first and LastName second, the SQL Server query optimizer can perform an index seek for the specific department, then navigate to the exact last names, and retrieve Salary directly from the included column. This completely avoids the need for expensive key lookups into the clustered index, making it the most efficient access path for this workload.

  • B: Create a nonclustered index on LastName only

    Why it's wrong here

    An index on LastName alone would only help if the query filtered primarily by LastName without a leading DepartmentID predicate. With a filter on DepartmentID and LastName, the optimizer could still seek on LastName only after scanning or using a residual predicate for the department, or it might choose to scan the entire nonclustered index and then perform key lookups for each matching row to retrieve Salary. Because Salary is not included, every row that matches the nonclustered index condition would require a lookup into the clustered index, causing excessive I/O and defeating the purpose of the index.

  • C: Create a nonclustered index on DepartmentID and another nonclustered index on LastName

    Why it's wrong here

    Creating two separate nonclustered indexes—one on DepartmentID and one on LastName—does not give the same benefit as a single composite index. The optimizer might attempt an index intersection of both indexes to narrow the set of rows, but that process requires probing both indexes and then still needs to look up Salary from the clustered index for every surviving row. The overhead of index intersection plus key lookups is typically far higher than a single covering composite index, especially for a selective filter like a specific department and last name.

  • D: Change the clustered index to (DepartmentID, LastName)

    Why it's wrong here

    Changing the clustered index to (DepartmentID, LastName) would physically reorder the entire table by that key, which directly contradicts the existing clustered index that likely enforces the primary key on EmployeeID or similar. This would disrupt the ordering of the base table, breaking the performance of any query that relies on EmployeeID ordering or seeking by employee, and it can cause severe logical fragmentation and page splits during concurrent HR transactions. Moreover, even with a clustered key on DepartmentID, LastName, the Salary column is not part of the index key or included columns, so the query would still need to access the row's data page—no covering benefit—and the physical redesign is invasive and irreversible without significant downtime.

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.