Limited-Time Offer: Enjoy 50% Savings! Coupon code: 50OFF Use it at checkout
Skip to content

Free Microsoft Developing AI-Enabled Database Solutions DP-800 Exam Questions

Last updated: · 14 practice questions with answers and explanations

Page: 1 / 10 Total 97 questions

Want more questions? Get Premium Access.

Question 1

New Single answer

Topic: Design and develop database solutions

Skill tested: Designs partitioned tables and indexes around retention and query predicates.

A logistics company stores several billion shipment events in Azure SQL Database. Most operational queries filter by a shipment date range, and the compliance team requires efficient removal of data older than seven years. New events arrive continuously, and the company wants to avoid large delete operations that generate substantial transaction log activity. Which design best meets these requirements?

Correct Answer: A. Partition the table by shipment date using a range scheme, and align appropriate indexes with the partitioning strategy.
Explanation:

Date-based partitioning supports partition elimination when queries constrain the partitioning column and lets administrators remove a whole expired partition through partition switching or partition management rather than deleting every row. Aligned indexes make partition-level operations more manageable. A date index alone does not avoid the logging and workload of deleting billions of rows. Separate databases increase operational and query complexity, while a year-only uniqueness constraint would incorrectly restrict rows and does not provide partition-based retention.

Question 2

New Multiple answers

Topic: Design and develop database solutions

Skill tested: Uses JSON functions to validate and query semi-structured data in T-SQL.

A product catalog stores supplier-specific attributes in an `nvarchar(max)` column named `Attributes`. Rows must contain valid JSON, and an API report must return the scalar `color` value for each product while excluding products where that property is absent. The schema of other supplier attributes varies, so the team does not want to normalize every possible property into separate columns. Which two actions meet the requirements? Select two.

Correct Answer: A. Add a CHECK constraint that requires `ISJSON(Attributes) = 1`.; C. Use `JSON_VALUE(Attributes, '$.color')` to extract the scalar color value in the report.
Explanation:

`ISJSON` can enforce that values satisfy JSON syntax, and `JSON_VALUE` extracts a scalar such as a string-valued `color`. The report can filter out null results when the property is missing. `JSON_QUERY` is intended for objects or arrays rather than scalar values. `OPENJSON` can be useful for tabularizing JSON, but a fixed schema that rejects other properties conflicts with the variable supplier attributes. `hierarchyid` represents hierarchical data and is not a JSON storage or extraction type.

Question 3

New Single answer

Topic: Design and develop database solutions

Skill tested: Applies window functions to rank and select rows within grouped data.

A finance team maintains daily account balances and needs a report containing the latest recorded balance for every account. Several records can share the same date because corrections are stored separately; each record has a unique `BalanceId` that increases as corrections are entered. The report must return exactly one row per account, choosing the most recently entered record when dates tie. Which query pattern is most appropriate?

Correct Answer: B. Use `ROW_NUMBER()` partitioned by account and ordered by `BalanceDate DESC, BalanceId DESC`, then filter to row number 1.
Explanation:

`ROW_NUMBER()` assigns one ordered position per account. Sorting first by the latest date and then by the increasing unique identifier resolves date ties deterministically, so filtering to row number 1 returns exactly one applicable row per account. Independent `MAX` expressions can combine values from different records. `RANK` on date alone can return multiple rows for tied dates, and a single table-wide maximum identifier does not identify each account's latest record.

Question 4

New Single answer

Topic: Design and develop database solutions

Skill tested: Writes graph `MATCH` patterns to traverse relationships in SQL Server graph tables.

A fraud analytics team represents people as node rows and transfers as edge rows in a SQL Server graph database. Investigators need to find every transfer edge from a person named Ada to a person named Ben, returning the edge's amount. The node and edge tables use the graph columns created by SQL Server. Which query approach correctly expresses the relationship traversal?

Correct Answer: A. Use `MATCH (a-(t)->b)` with `WHERE a.Name = 'Ada' AND b.Name = 'Ben'`, selecting `t.Amount`.
Explanation:

In SQL Server graph queries, `MATCH` expresses node and edge patterns; the pattern `(a-(t)->b)` identifies an edge `t` directed from node `a` to node `b`. Filtering the node properties by name and selecting the edge property returns the requested transfer. A plain business-key join does not express the graph edge traversal. Reversing the pattern changes its direction, and edge properties belong to the edge table rather than the source node.

Question 5

New Multiple answers

Topic: Design and develop database solutions

Skill tested: Selects constraints and sequences for reliable key generation and data integrity.

An order-processing system imports orders from several independent services. Each service must obtain new order identifiers without relying on an identity value generated by a prior insert, and the database must reject duplicate external order references. Gaps in order identifiers are acceptable, but identifiers must be generated by SQL Server. Which two design choices satisfy the requirements? Select two.

Correct Answer: C. Create a SQL Server sequence and request values with `NEXT VALUE FOR` when a service needs an identifier.; D. Create a UNIQUE constraint on the external order reference column.
Explanation:

A sequence generates values independently of inserting a particular row, which suits multiple services that need identifiers in advance; gaps are possible and acceptable under the stated requirement. A UNIQUE constraint enforces external-reference uniqueness under concurrent inserts. `MAX + 1` is race-prone, and an identity value is normally generated as part of inserting a row rather than requested independently. A CHECK constraint cannot safely enforce uniqueness across other rows; use a unique key or constraint.

Question 6

New Single answer

Topic: Design and develop database solutions

Skill tested: Chooses indexes based on query predicates, coverage, and write workload.

An application retrieves recent invoices using `WHERE CustomerId = @id AND InvoiceDate >= @cutoff`, returning `InvoiceId`, `InvoiceDate`, and `Total`. The invoice table is large, and inserts are frequent. Execution plans show repeated key lookups from an existing nonclustered index on `CustomerId`. The application does not sort by another column, and the team wants to reduce lookups without adding a separate index. Which change is most appropriate?

Correct Answer: A. Create a nonclustered index on `(CustomerId, InvoiceDate)` and include `InvoiceId` and `Total`.
Explanation:

The composite index begins with the equality predicate and then the date range predicate, allowing an efficient seek over the relevant customer and dates. Including the returned columns can cover the query and eliminate key lookups without making those columns part of the index key. Clustering on an amount unrelated to the predicate is unlikely to help. Separate indexes do not provide the same efficient combined access path, and uniqueness on customer and date is an unsupported business rule that may reject valid invoices.

Question 7

New Single answer

Topic: Design and develop database solutions

Skill tested: Uses CTEs to express recursive traversal of hierarchical relational data.

A manufacturer stores an employee hierarchy in a table with `EmployeeId` and nullable `ManagerId`. A reporting procedure must return a selected manager and all descendants at any depth, with each row showing its depth from the selected manager. The hierarchy can change frequently, so the procedure must query the relational table directly rather than maintain a separate closure table. Which T-SQL approach is best?

Correct Answer: A. Use a recursive common table expression with an anchor row for the selected manager and a recursive member joining employees to the prior level.
Explanation:

A recursive CTE models an anchor set and repeatedly joins each discovered employee to employees whose `ManagerId` references that employee. A depth expression can increment on each recursive step, producing descendants at arbitrary hierarchy levels. A single self-join only reaches one level. `ROW_NUMBER` does not establish hierarchy traversal, and a scalar manager identifier is relational data rather than a JSON document. In production, cycle prevention and a suitable recursion limit may also be appropriate safeguards.

Question 8

New Multiple answers

Topic: Secure, optimize, and deploy database solutions

Skill tested: Distinguishes Always Encrypted client-side protection from database-side encryption.

A healthcare application stores patient identifiers in Azure SQL Database. A requirement states that database administrators must not be able to read these values, while the application must compare identifiers for equality. The application team can deploy a driver that supports Always Encrypted, and key material can be managed outside the database. Which two statements correctly guide the design? Select two.

Correct Answer: C. Use Always Encrypted so encryption and decryption occur in a client driver with access to the required keys.; D. Use deterministic encryption for the identifier column when equality comparisons are required, while accounting for its leakage of equality patterns.
Explanation:

Always Encrypted keeps plaintext processing on the client and key material outside the database, addressing the requirement that database administrators cannot read the protected values. Deterministic encryption supports equality comparisons, but reveals when encrypted values are equal and therefore has a security tradeoff. Dynamic Data Masking is presentation-oriented and does not prevent privileged access to underlying data. Server-side decryption makes plaintext available within the database engine, while randomized encryption does not support ordinary equality matching on the encrypted value.

Question 9

New Single answer

Topic: Secure, optimize, and deploy database solutions

Skill tested: Applies Row-Level Security predicates to isolate tenant data.

A multi-tenant service shares one SQL table among customers. Each connection sets the current tenant identifier in session context, and users must see only rows belonging to that tenant. The application role is not trusted to remember a tenant filter in every query. The database must enforce the restriction for both reads and writes. Which design is most appropriate?

Correct Answer: C. Create a security policy with a filter predicate and a block predicate based on the tenant identifier in session context.
Explanation:

Row-Level Security centralizes row access rules in the database. A filter predicate limits rows visible to queries, while a block predicate can reject writes that would create or change rows outside the permitted tenant context. A view is bypassable if the role also has base-table access. Dynamic Data Masking obscures values rather than restricting rows, and a CHECK constraint based on a display name neither implements the stated session-context model nor reliably handles tenant access control.

Question 10

New Single answer

Topic: Secure, optimize, and deploy database solutions

Skill tested: Diagnoses regressions using Query Store runtime history and plan comparison.

After a database deployment, an API endpoint's latency increased sharply. The query text appears unchanged, and the team suspects that SQL Server selected a different execution plan after statistics and data distributions changed. The database has Query Store enabled and retains runtime statistics. The team wants to confirm whether a plan regression occurred before changing indexes or query text. What should the DBA do first?

Correct Answer: A. Use Query Store to compare the query's plans and runtime statistics before and after the deployment.
Explanation:

Query Store retains query, plan, and runtime-statistics history, allowing the DBA to compare behavior across the deployment and determine whether a plan change correlates with the regression. This evidence-based step helps distinguish a plan regression from other causes before changing the schema. Clearing the cache or forcing recompilation can destroy useful diagnostic context and does not identify the cause. Adding indexes without evidence can increase write overhead and may not address the problem.

Question 11

New Multiple answers

Topic: Secure, optimize, and deploy database solutions

Skill tested: Interprets execution-plan warnings and uses DMVs to investigate query performance.

A reporting query has become slower as a table grows. Its actual execution plan shows an implicit conversion on a filtered column and a large number of rows flowing through a scan, while the application reports occasional high CPU. The database team wants a focused diagnosis before changing the schema. Which two actions are most appropriate? Select two.

Correct Answer: B. Use relevant DMVs, such as query-statistics and index-usage DMVs, to corroborate resource use and access patterns.; C. Compare the data types of the predicate parameter and column, then correct the mismatch that causes the implicit conversion.
Explanation:

An implicit conversion on a predicate column can prevent an efficient seek or otherwise degrade cardinality and execution behavior, so aligning parameter and column types is a targeted first investigation. DMVs provide supporting evidence about query resource consumption and index activity; they complement rather than replace execution-plan analysis. Disabling indexes can worsen access and maintenance behavior, and increasing memory without evidence does not address a conversion or predicate issue. A scan is not automatically wrong, particularly for broad result sets, but the conversion warning merits investigation.

Question 12

New Single answer

Topic: Secure, optimize, and deploy database solutions

Skill tested: Selects Dynamic Data Masking while recognizing its limits as an access control.

A customer-support application allows agents to query a customer table, but agents should see only the final four characters of phone numbers in normal query results. A separate, tightly controlled support role must retrieve full numbers when resolving an escalated case. The organization already enforces table permissions and does not require encryption from database administrators. Which approach best meets the presentation requirement?

Correct Answer: A. Apply Dynamic Data Masking to the phone column and grant unmasking capability only to the controlled support role.
Explanation:

Dynamic Data Masking can alter how a column is presented to users who lack the required unmask permission, while authorized support personnel can receive the unmasked value. It matches the stated display-oriented goal, with the existing permissions remaining important because masking is not a substitute for access control. Always Encrypted is a different cryptographic protection model and does not simply expose plaintext to ordinary agents. Row-Level Security filters rows, not portions of a column, and a CHECK constraint cannot implement conditional result masking.

Question 13

New Multiple answers

Topic: Implement AI capabilities in database solutions

Skill tested: Chooses vector and hybrid search methods for semantic and exact-match retrieval.

A support knowledge base contains article text, embeddings, and structured fields such as product code and publication status. Users may search with natural-language descriptions, but some searches include an exact product code that must not be missed. Results must exclude unpublished articles. The team wants semantic relevance without sacrificing exact identifier matching. Which two approaches best fit? Select two.

Correct Answer: A. Apply the publication-status filter so unpublished articles are excluded from the candidate results.; E. Use vector similarity search for semantic retrieval and combine it with lexical or exact-match retrieval for product codes.
Explanation:

Vector search is useful for semantic similarity, while exact identifiers are better handled through lexical or equality matching; combining the approaches provides both kinds of relevance. The publication-status predicate enforces the business constraint and should be applied to retrieval candidates or results as supported by the implementation. Embeddings do not guarantee exact code matching. Body-only full-text search can miss a code stored separately, and vectorizing a status value is not a replacement for a deterministic filter.

Question 14

New Single answer

Topic: Implement AI capabilities in database solutions

Skill tested: Designs embedding generation and storage with consistent model and vector dimensions.

A document-search service generates an embedding for each knowledge-base chunk and stores vectors in a SQL database. The current embedding model returns vectors of a fixed dimension, and similarity queries will compare stored vectors with query vectors produced by the same model. The team is planning a model upgrade, but must continue serving existing indexed content during migration. Which design is the safest?

Correct Answer: B. Store model identity and vector dimension with each embedding set, and keep incompatible model versions in separate compatible retrieval paths during migration.
Explanation:

Similarity comparisons require compatible vector dimensions and meaningful embedding spaces; model changes can alter both. Recording model identity and dimension makes compatibility explicit, while separate retrieval paths allow the existing corpus to remain usable until re-embedding and validation are complete. Arbitrary dimensions cannot be safely compared as if interchangeable. Text equality is not a semantic distance measure, and replacing stored vectors before aligning query generation risks invalid or ineffective retrieval.