DP-900 Practice Question: Identify considerations for relational data on Azure
A company uses Azure SQL Database for an e-commerce system. The Orders table has millions of rows with a clustered index on OrderID (the primary key). Queries that filter on OrderDate and CustomerID to find recent orders for a specific customer are very slow. Which indexing strategy will most improve the performance of these queries?
⚠ Common exam trap
Many exam-takers think separate indexes on each filter column are sufficient, not realizing that a composite index is far more efficient for queries that filter on multiple columns together, because it avoids the need for index intersection or multiple 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 composite index on (OrderDate, CustomerID)
The query filters on both OrderDate and CustomerID, so a composite nonclustered index on (OrderDate, CustomerID) allows SQL Server to perform a single index seek to locate the matching rows without touching the clustered index until the final key lookup. This dramatically reduces I/O compared to scanning the entire clustered index or using multiple separate indexes.
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 OrderID only
Why it's wrong here
A nonclustered index on OrderID duplicates the existing clustered index key, since OrderID is already the clustered index for the table. The query filters on OrderDate and CustomerID, so an index keyed only on OrderID cannot be used to seek rows based on those predicates. In fact, the optimizer would ignore the redundant index or use it only for lookups, adding overhead without improving query performance. Therefore, it's a poor choice for this workload.
- ✗
Create separate nonclustered indexes on OrderDate and CustomerID
Why it's wrong here
Separate indexes allow the database to use either one, but not both simultaneously in an efficient way. The optimizer may use one index and then perform lookups, which is less efficient than a composite index that covers both columns.
- ✓
Create a nonclustered composite index on (OrderDate, CustomerID)
Why this is correct
A composite index on both columns allows the database to find rows matching both filter conditions in a single index seek. This is the most efficient strategy for queries that filter on multiple columns together.
- ✗
Create a clustered index on CustomerID instead of OrderID
Why it's wrong here
Changing the clustered index would reorganize the entire table and might improve some queries, but OrderID is likely used for joins and lookups. Moreover, a clustered index on CustomerID would not directly benefit the filter on OrderDate. A nonclustered composite index is less disruptive and more targeted.
Go deeper
Related to this question
Learn chapter
Azure SQL Services
Key term
Table
A table is a structured collection of data organized into rows and columns, used in databases and spreadsheets to store and manage information efficiently.
Key term
Azure SQL Database
Azure SQL Database is a fully managed relational database-as-a-service (DBaaS) in Microsoft Azure, based on the SQL Server engine, that handles scaling, backups, patching, and high availability automatically.
About these practice questions
This DP-900 question is part of Courseiva's 820-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
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.