McAfee-Secured Website

Exam Code: DP-800

Exam Name: Developing AI-Enabled Database Solutions

Certification Provider: Microsoft

Corresponding Certification: Microsoft Certified: SQL AI Developer Associate

100% Microsoft DP-800 Guaranteed Success With Testking Training Materials

Get Real DP-800 Exam Questions & Expert Verified Answers as Experienced on the Real Exam!

101 Questions & Answers with Testing Engine

"Developing AI-Enabled Database Solutions Exam", also known as DP-800 exam, is a Microsoft certification exam.

Pass your tests with the always up-to-date DP-800 Exam Engine. Your DP-800 training materials keep you at the head of the pack!

Satisfaction Guaranteed

Money Back Guarantee

Testking provides hassle-free money back guarantee with our products. That is because we have 100% trust in the abilities of our professional and experience product team, and our record is a proof of that.

99.6% PASS RATE
Was: $137.49
Now: $124.99

Microsoft DP-800 Practice Test 17

Question 160

A web service inserts a transaction and then performs a nontransactional SELECT MAX(Id) that sometimes returns another user's row. What should a technical reviewer verify before approving completion?

  1. A forced constraint error rolls back the unit of work and reaches the caller.
  2. Unit tests confirm one value per supported argument combination without hidden mutations.
  3. Equal scores share the same rank and the next rank reflects skipped positions.
  4. Concurrent calls each receive the identifier from their own insert.

Explanation

Correct Answer

D:

MAX(Id) is unsafe for concurrent identity retrieval; OUTPUT ties returned keys to the statement. The observation “Concurrent calls each receive the identifier from their own insert” directly confirms the chosen action worked for this situation: A web service inserts a transaction and then performs a nontransactional SELECT MAX(Id) that sometimes returns another user's row.

Incorrect Answers

A:

Suppressing SQL errors conceals failed transactions; THROW propagates a meaningful failure. This observation would not establish that the required result occurred for A web service inserts a transaction and then performs a nontransactional SELECT MAX(Id) that sometimes returns another user's row. The confirming test is: Concurrent calls each receive the identifier from their own insert.

B:

A scalar function encapsulates a single-result expression, not a full transaction workflow. This observation would not establish that the required result occurred for A web service inserts a transaction and then performs a nontransactional SELECT MAX(Id) that sometimes returns another user's row. The confirming test is: Concurrent calls each receive the identifier from their own insert.

C:

RANK leaves gaps after ties while DENSE_RANK does not. This observation would not establish that the required result occurred for A web service inserts a transaction and then performs a nontransactional SELECT MAX(Id) that sometimes returns another user's row. The confirming test is: Concurrent calls each receive the identifier from their own insert.

Question 161

A regulatory workflow needs a trigger to forbid updates to a signed contract after approval. What should the SQL developer implement after verifying the conditions?

  1. Implement narrow database-side enforcement with a constraint or trigger matched to the state-dependent rule.
  2. Use a scalar function when a single return value and performance constraints fit.
  3. Pass the intended identifiers in a table-valued parameter to a set-based procedure where supported.
  4. Use a system-versioned temporal table with its history table properly configured.

Explanation

Correct Answer

A:

State-dependent protections need carefully tested enforcement; triggers must handle statement sets and errors. For the described situation—A regulatory workflow needs a trigger to forbid updates to a signed contract after approval—the targeted fix is Implement narrow database-side enforcement with a constraint or trigger matched to the state-dependent rule. A successful test should show: An attempted update of approved records is rejected with a clear error while draft edits remain possible.

Incorrect Answers

B:

A scalar function encapsulates a single-result expression, not a full transaction workflow. But that technique does not solve the stated problem—A regulatory workflow needs a trigger to forbid updates to a signed contract after approval. The needed intervention is Implement narrow database-side enforcement with a constraint or trigger matched to the state-dependent rule.

C:

Table-valued parameters support multirow input to stored procedures without building unsafe dynamic SQL. But that technique does not solve the stated problem—A regulatory workflow needs a trigger to forbid updates to a signed contract after approval. The needed intervention is Implement narrow database-side enforcement with a constraint or trigger matched to the state-dependent rule.

D:

Temporal tables automatically retain historical row versions keyed by system time. But that technique does not solve the stated problem—A regulatory workflow needs a trigger to forbid updates to a signed contract after approval. The needed intervention is Implement narrow database-side enforcement with a constraint or trigger matched to the state-dependent rule.

Question 162

A regulatory workflow needs a trigger to forbid updates to a signed contract after approval. Which verification finding is most specific to this scenario?

  1. An insert against the view updates the expected base tables and rejects invalid mappings.
  2. The TVF joins efficiently to callers and returns correct results across parameter values.
  3. An attempted update of approved records is rejected with a clear error while draft edits remain possible.
  4. Concurrent requests receive nonduplicated sequence values without assuming gapless numbering.

Explanation

Correct Answer

C:

State-dependent protections need carefully tested enforcement; triggers must handle statement sets and errors. The observation “An attempted update of approved records is rejected with a clear error while draft edits remain possible” directly confirms the chosen action worked for this situation: A regulatory workflow needs a trigger to forbid updates to a signed contract after approval.

Incorrect Answers

A:

INSTEAD OF logic replaces the direct DML action; AFTER logic runs after a supported modification. This observation would not establish that the required result occurred for A regulatory workflow needs a trigger to forbid updates to a signed contract after approval. The confirming test is: An attempted update of approved records is rejected with a clear error while draft edits remain possible.

B:

Inline TVFs can be expanded into the caller's plan and avoid unnecessary procedural materialization. This observation would not establish that the required result occurred for A regulatory workflow needs a trigger to forbid updates to a signed contract after approval. The confirming test is: An attempted update of approved records is rejected with a clear error while draft edits remain possible.

D:

A sequence is an independent number generator and gaps are possible after rollbacks or caching. This observation would not establish that the required result occurred for A regulatory workflow needs a trigger to forbid updates to a signed contract after approval. The confirming test is: An attempted update of approved records is rejected with a clear error while draft edits remain possible.

Question 163

Two applications should get the same rejection when attempting to mutate a frozen signed document. Which approach achieves the intended result without bypassing the stated controls?

  1. Prefer set-based expressions or an appropriate inline TVF after measuring query plans.
  2. Create a least-privilege projection view and grant SELECT on only that interface.
  3. Use EDIT_DISTANCE on supported SQL platforms and evaluate the expected edit operations.
  4. Implement narrow database-side enforcement with a constraint or trigger matched to the state-dependent rule.

Explanation

Correct Answer

D:

State-dependent protections need carefully tested enforcement; triggers must handle statement sets and errors. For the described situation—Two applications should get the same rejection when attempting to mutate a frozen signed document—the targeted fix is Implement narrow database-side enforcement with a constraint or trigger matched to the state-dependent rule. A successful test should show: An attempted update of approved records is rejected with a clear error while draft edits remain possible.

Incorrect Answers

A:

Row-by-row function evaluation can inhibit query optimization; set-based evaluation often scales better. But that technique does not solve the stated problem—Two applications should get the same rejection when attempting to mutate a frozen signed document. The needed intervention is Implement narrow database-side enforcement with a constraint or trigger matched to the state-dependent rule.

B:

Views can provide a data-access interface when underlying object permissions are managed appropriately. But that technique does not solve the stated problem—Two applications should get the same rejection when attempting to mutate a frozen signed document. The needed intervention is Implement narrow database-side enforcement with a constraint or trigger matched to the state-dependent rule.

C:

Edit distance is a count-like difference measure, not a proof that two records are the same entity. But that technique does not solve the stated problem—Two applications should get the same rejection when attempting to mutate a frozen signed document. The needed intervention is Implement narrow database-side enforcement with a constraint or trigger matched to the state-dependent rule.

Question 164

Two applications should get the same rejection when attempting to mutate a frozen signed document. How should the team validate the selected design?

  1. Each request returns the intended page consistently and database/network load decreases.
  2. The batch returns the same totals with lower CPU time on representative volumes.
  3. An attempted update of approved records is rejected with a clear error while draft edits remain possible.
  4. Only relationships present in the graph edge table appear in query output.

Explanation

Correct Answer

C:

State-dependent protections need carefully tested enforcement; triggers must handle statement sets and errors. The observation “An attempted update of approved records is rejected with a clear error while draft edits remain possible” directly confirms the chosen action worked for this situation: Two applications should get the same rejection when attempting to mutate a frozen signed document.

Incorrect Answers

A:

Set-based filtering and stable paging reduce unnecessary data movement; paging without deterministic order can skip or repeat rows. This observation would not establish that the required result occurred for Two applications should get the same rejection when attempting to mutate a frozen signed document. The confirming test is: An attempted update of approved records is rejected with a clear error while draft edits remain possible.

B:

Row-by-row function evaluation can inhibit query optimization; set-based evaluation often scales better. This observation would not establish that the required result occurred for Two applications should get the same rejection when attempting to mutate a frozen signed document. The confirming test is: An attempted update of approved records is rejected with a clear error while draft edits remain possible.

D:

MATCH expresses graph patterns over node and edge relationships in SQL graph queries. This observation would not establish that the required result occurred for Two applications should get the same rejection when attempting to mutate a frozen signed document. The confirming test is: An attempted update of approved records is rejected with a clear error while draft edits remain possible.

Question 165

A procedure returns millions of rows to a client that only needs a paged subset. What intervention should the responsible engineer choose?

  1. Implement TRY...CATCH with rollback and THROW to surface the failure.
  2. Move supported filtering, ordering, and pagination into SQL with stable sort keys.
  3. Use an INSTEAD OF trigger where supported to implement the intended view-write translation.
  4. Select Unicode-compatible text types and length/collation appropriate to actual multilingual data.

Explanation

Correct Answer

B:

Set-based filtering and stable paging reduce unnecessary data movement; paging without deterministic order can skip or repeat rows. For the described situation—A procedure returns millions of rows to a client that only needs a paged subset—the targeted fix is Move supported filtering, ordering, and pagination into SQL with stable sort keys. A successful test should show: Each request returns the intended page consistently and database/network load decreases.

Incorrect Answers

A:

Suppressing SQL errors conceals failed transactions; THROW propagates a meaningful failure. But that technique does not solve the stated problem—A procedure returns millions of rows to a client that only needs a paged subset. The needed intervention is Move supported filtering, ordering, and pagination into SQL with stable sort keys.

C:

INSTEAD OF logic replaces the direct DML action; AFTER logic runs after a supported modification. But that technique does not solve the stated problem—A procedure returns millions of rows to a client that only needs a paged subset. The needed intervention is Move supported filtering, ordering, and pagination into SQL with stable sort keys.

D:

Data type and collation selection determine representability, comparisons, and index behavior. But that technique does not solve the stated problem—A procedure returns millions of rows to a client that only needs a paged subset. The needed intervention is Move supported filtering, ordering, and pagination into SQL with stable sort keys.

Question 166

A procedure returns millions of rows to a client that only needs a paged subset. What observable outcome proves the recommendation worked?

  1. Consumers query current source rows through the same named projection.
  2. Each request returns the intended page consistently and database/network load decreases.
  3. Calling the function in a relational query returns the expected multiple rows efficiently.
  4. Round-trip storage and equality tests preserve account identifiers without unintended padding or truncation.

Explanation

Correct Answer

B:

Set-based filtering and stable paging reduce unnecessary data movement; paging without deterministic order can skip or repeat rows. The observation “Each request returns the intended page consistently and database/network load decreases” directly confirms the chosen action worked for this situation: A procedure returns millions of rows to a client that only needs a paged subset.

Incorrect Answers

A:

A standard view stores query definition rather than a separately refreshed result set. This observation would not establish that the required result occurred for A procedure returns millions of rows to a client that only needs a paged subset. The confirming test is: Each request returns the intended page consistently and database/network load decreases.

C:

An inline TVF exposes a composable table expression whereas a scalar UDF returns one value. This observation would not establish that the required result occurred for A procedure returns millions of rows to a client that only needs a paged subset. The confirming test is: Each request returns the intended page consistently and database/network load decreases.

D:

CHAR uses fixed-width padding; variable-width text types better fit identifiers whose lengths differ. This observation would not establish that the required result occurred for A procedure returns millions of rows to a client that only needs a paged subset. The confirming test is: Each request returns the intended page consistently and database/network load decreases.

Question 167

A reporting endpoint is slow because a stored procedure applies pagination after loading all results into memory. Which design choice BEST addresses the root issue?

  1. Move supported filtering, ordering, and pagination into SQL with stable sort keys.
  2. Create a view with the required SELECT and grant access appropriately.
  3. Use sp_executesql with typed parameters and allowlist any necessary object identifiers.
  4. Use GROUP BY with HAVING on the aggregated measure.

Explanation

Correct Answer

A:

Set-based filtering and stable paging reduce unnecessary data movement; paging without deterministic order can skip or repeat rows. For the described situation—A reporting endpoint is slow because a stored procedure applies pagination after loading all results into memory—the targeted fix is Move supported filtering, ordering, and pagination into SQL with stable sort keys. A successful test should show: Each request returns the intended page consistently and database/network load decreases.

Incorrect Answers

B:

A standard view stores query definition rather than a separately refreshed result set. But that technique does not solve the stated problem—A reporting endpoint is slow because a stored procedure applies pagination after loading all results into memory. The needed intervention is Move supported filtering, ordering, and pagination into SQL with stable sort keys.

C:

Parameterized dynamic SQL separates values from executable statements and reduces injection risk. But that technique does not solve the stated problem—A reporting endpoint is slow because a stored procedure applies pagination after loading all results into memory. The needed intervention is Move supported filtering, ordering, and pagination into SQL with stable sort keys.

D:

HAVING filters groups after aggregation; WHERE filters source rows before aggregation. But that technique does not solve the stated problem—A reporting endpoint is slow because a stored procedure applies pagination after loading all results into memory. The needed intervention is Move supported filtering, ordering, and pagination into SQL with stable sort keys.

Question 168

A reporting endpoint is slow because a stored procedure applies pagination after loading all results into memory. Which result would provide the strongest acceptance evidence?

  1. Unit tests confirm one value per supported argument combination without hidden mutations.
  2. A hostile quote-containing test is treated as data and does not alter SQL structure.
  3. Measured joins avoid redundant lookups and fragmentation stays controlled during inserts.
  4. Each request returns the intended page consistently and database/network load decreases.

Explanation

Correct Answer

D:

Set-based filtering and stable paging reduce unnecessary data movement; paging without deterministic order can skip or repeat rows. The observation “Each request returns the intended page consistently and database/network load decreases” directly confirms the chosen action worked for this situation: A reporting endpoint is slow because a stored procedure applies pagination after loading all results into memory.

Incorrect Answers

A:

A scalar function encapsulates a single-result expression, not a full transaction workflow. This observation would not establish that the required result occurred for A reporting endpoint is slow because a stored procedure applies pagination after loading all results into memory. The confirming test is: Each request returns the intended page consistently and database/network load decreases.

B:

Parameterized dynamic SQL separates values from executable statements and reduces injection risk. This observation would not establish that the required result occurred for A reporting endpoint is slow because a stored procedure applies pagination after loading all results into memory. The confirming test is: Each request returns the intended page consistently and database/network load decreases.

C:

Clustered-key width and volatility affect nonclustered index storage and insert maintenance. This observation would not establish that the required result occurred for A reporting endpoint is slow because a stored procedure applies pagination after loading all results into memory. The confirming test is: Each request returns the intended page consistently and database/network load decreases.

Question 169

A quarterly sales report requires a temporary named query used just once in the statement. What should the database team change FIRST for this workload?

  1. Use NOT EXISTS with a proper correlated predicate to avoid NOT IN NULL three-valued pitfalls.
  2. Use REGEXP_REPLACE with a carefully tested replacement and pattern.
  3. Use a common table expression introduced by WITH for the statement-scoped result.
  4. Use a scalar function when a single return value and performance constraints fit.

Explanation

Correct Answer

C:

A CTE is a named subquery scoped to a single following DML statement, not an automatic materialized table. For the described situation—A quarterly sales report requires a temporary named query used just once in the statement—the targeted fix is Use a common table expression introduced by WITH for the statement-scoped result. A successful test should show: The following SELECT references the CTE and returns the same rows without persistent objects.

Incorrect Answers

A:

NOT IN with unknown NULL comparison can filter unexpectedly; NOT EXISTS tests matching row presence. But that technique does not solve the stated problem—A quarterly sales report requires a temporary named query used just once in the statement. The needed intervention is Use a common table expression introduced by WITH for the statement-scoped result.

B:

REGEXP_REPLACE substitutes pattern matches and requires explicit tests for greediness and escaping. But that technique does not solve the stated problem—A quarterly sales report requires a temporary named query used just once in the statement. The needed intervention is Use a common table expression introduced by WITH for the statement-scoped result.

D:

A scalar function encapsulates a single-result expression, not a full transaction workflow. But that technique does not solve the stated problem—A quarterly sales report requires a temporary named query used just once in the statement. The needed intervention is Use a common table expression introduced by WITH for the statement-scoped result.

Question 170

A quarterly sales report requires a temporary named query used just once in the statement. Which acceptance check should accompany the remediation?

  1. The endpoint returns valid JSON with escaped strings and expected property names.
  2. A test hierarchy returns each expected descendant and terminates on cyclic or deep inputs as designed.
  3. The following SELECT references the CTE and returns the same rows without persistent objects.
  4. Round-trip tests preserve accents and non-Latin symbols without truncation or replacement.

Explanation

Correct Answer

C:

A CTE is a named subquery scoped to a single following DML statement, not an automatic materialized table. The observation “The following SELECT references the CTE and returns the same rows without persistent objects” directly confirms the chosen action worked for this situation: A quarterly sales report requires a temporary named query used just once in the statement.

Incorrect Answers

A:

JSON construction functions handle quoting/escaping rather than brittle string assembly. This observation would not establish that the required result occurred for A quarterly sales report requires a temporary named query used just once in the statement. The confirming test is: The following SELECT references the CTE and returns the same rows without persistent objects.

B:

Recursive CTEs repeatedly apply the recursive member and require attention to cycles and MAXRECURSION. This observation would not establish that the required result occurred for A quarterly sales report requires a temporary named query used just once in the statement. The confirming test is: The following SELECT references the CTE and returns the same rows without persistent objects.

D:

Data type and collation selection determine representability, comparisons, and index behavior. This observation would not establish that the required result occurred for A quarterly sales report requires a temporary named query used just once in the statement. The confirming test is: The following SELECT references the CTE and returns the same rows without persistent objects.

Developing AI-Enabled Database Solutions (DP-800) Practice Tests