Courseiva

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

A library management system uses Azure SQL Database. The Books table has 500,000 rows with columns: BookID (primary key, clustered), Title, Author, ISBN, PublishedYear, CopiesAvailable. Queries frequently filter by Author and then sort results by PublishedYear in descending order. The queries also return the Title and CopiesAvailable columns. Which indexing strategy will most improve query performance for these operations?

⚠ Common exam trap

Many exam-takers think any index on the filtered column (Author) is sufficient, overlooking the need to also cover the sort order and include all returned columns to avoid key lookups.

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 (Author, PublishedYear DESC) and include (Title, CopiesAvailable)

It creates a covering nonclustered index on (Author, PublishedYear DESC) that directly supports the filter (Author) and sort (PublishedYear DESC) operations. Including Title and CopiesAvailable as non-key columns makes the index covering, meaning all required columns are in the index leaf level, so SQL Server can satisfy the query entirely from the index without key lookups to the clustered index. This minimizes I/O and improves query performance.

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 (Author, PublishedYear DESC) and include (Title, CopiesAvailable)

    Why this is correct

    A composite nonclustered index with Author as the leading key column lets Azure SQL Database seek directly to the rows for the specified author. Adding PublishedYear DESC as the second key column means rows are already stored in the required sort order, eliminating a sort operator. Including Title and CopiesAvailable makes the index covering, so the query engine returns the result using only index pages, avoiding costly bookmark lookups into the clustered index. This design addresses the filter, ordering, and projection in one pass.

  • Create a nonclustered index on Author only

    Why it's wrong here

    An index on Author alone improves row location but does nothing to satisfy the ORDER BY PublishedYear DESC. After finding all matching rows, SQL Server must fetch the full rows from the base table and then sort them, which requires memory and can spill to tempdb if the result set is large. Because Title and CopiesAvailable are not included in the index, every hit also requires a bookmark lookup to the clustered index. The index is therefore only a partial solution and can still perform poorly for prolific authors.

  • Create a nonclustered index on PublishedYear DESC

    Why it's wrong here

    An index on PublishedYear DESC is aligned with the sort order but has the wrong leading key for the query's equality predicate on Author. With Author as the filter, this index cannot provide a seek; SQL Server would have to scan index entries across many years, checking the Author value on each row. This scan may actually be more expensive than the original clustered index scan because it covers only one column and then still needs lookups to retrieve Title and CopiesAvailable. Without Author as the leading key, the index is ineffective for this specific workload.

  • Keep only the existing clustered index on BookID

    Why it's wrong here

    Relying only on the clustered index on BookID means the database has no index with Author as a key column, so the query engine is forced to do a full scan of every row in the table to find matching books. As the library's books table grows, this scan reads far more pages than necessary and consumes more I/O, CPU, and DTU/DTU burst resources in Azure SQL Database. The clustered index is excellent for point lookups by BookID but irrelevant to an Author-based search. A full scan is the worst-case execution plan for this query pattern.

About these practice questions

Courseiva writes every DP-900 question from scratch — 820 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.