Tag: DP-800 Practice Exam Questions

DP-800 Practice Exam #1 (30 questions)

This post/practice exam is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.


Question 1 (Single Answer)

You are designing a database for an online retail application. The Orders table will contain millions of records, and queries will frequently retrieve orders for a single customer ordered by purchase date.

Which index design provides the BEST performance?

A. Create a clustered index on OrderDate

B. Create a clustered index on OrderID and a nonclustered index on CustomerID

C. Create a clustered index on CustomerID, OrderDate

D. Create a nonclustered columnstore index on all columns

Answer: C

Explanation

Since most queries filter by CustomerID and sort by OrderDate, a clustered index on (CustomerID, OrderDate) physically organizes the data in the same order as the most common access pattern, minimizing page reads and sorting.

  • A does not optimize customer lookups.
  • B optimizes customer filtering but still requires additional sorting.
  • D is designed primarily for analytical workloads rather than OLTP.

Question 2 (Choose TWO)

Your organization wants to improve the security of an Azure SQL Database.

Which TWO features help protect sensitive information?

A. Dynamic Data Masking

B. SQL Server Agent

C. Row-Level Security

D. Query Store

E. Automatic Tuning

Choose TWO answers.

Answers:

✅ A

✅ C

Explanation

Dynamic Data Masking hides sensitive values from unauthorized users.

Row-Level Security restricts which rows users can access.

SQL Server Agent, Query Store, and Automatic Tuning are not security features.


Question 3 (Scenario)

A company is building a Retrieval-Augmented Generation (RAG) solution.

Customer manuals have already been converted into embeddings and stored in a vector index.

A user asks:

“How do I replace the printer toner?”

What should happen NEXT?

A. Generate new embeddings for every document.

B. Perform a vector similarity search using the user’s question embedding.

C. Retrain the language model.

D. Build a clustered index.

Answer: B

Explanation

After embeddings already exist, the user question is embedded and compared against the vector index to retrieve the most relevant documents before prompting the language model.


Question 4 (Fill in the Blank)

Complete the following statement.

The SQL clause most commonly used to convert relational query results into JSON documents is:


A. FOR XML

B. OPENJSON

C. JSON_VALUE

D. FOR JSON

Answer: D

Explanation

FOR JSON converts relational data into JSON.

  • FOR JSON AUTO automatically generates JSON.
  • FOR JSON PATH allows customized JSON structures.

Question 5 (Choose THREE)

A database developer wants to create high-quality prompts for a language model.

Which THREE practices are recommended?

A. Include only relevant retrieved context.

B. Include every available document.

C. Clearly specify the model’s task.

D. Remove duplicate retrieved information.

E. Leave instructions ambiguous.

Choose THREE answers.

Answers

✅ A

✅ C

✅ D

Explanation

Effective prompts:

  • include only relevant context,
  • provide clear instructions,
  • remove duplicate or unnecessary information.

Large, irrelevant prompts increase costs and often reduce answer quality.


Question 6 (Match the Answers)

Match each SQL JSON function with its purpose.

FunctionPurpose
1. JSON_VALUEA. Returns a JSON object or array
2. JSON_QUERYB. Converts JSON into relational rows
3. OPENJSONC. Returns a scalar value

Answer

FunctionCorrect Match
JSON_VALUEC
JSON_QUERYA
OPENJSONB

Explanation

  • JSON_VALUE returns a scalar value.
  • JSON_QUERY returns objects or arrays.
  • OPENJSON converts JSON into tabular data.

Question 7 (Single Answer)

Which similarity metric is generally recommended when comparing normalized embedding vectors?

A. Manhattan Distance

B. Euclidean Distance

C. Hamming Distance

D. Cosine Similarity

Answer: D

Explanation

Cosine similarity measures the angle between vectors and is the most commonly used similarity metric for normalized embeddings because it focuses on semantic direction rather than vector magnitude.


Question 8 (Scenario)

Your company stores customer support articles inside Azure SQL Database.

The support team wants an AI assistant that always answers questions using the latest documentation stored in the database.

Which solution should you recommend?

A. Fine-tune the language model every night.

B. Use Retrieval-Augmented Generation (RAG).

C. Train a custom transformer model.

D. Store every support article inside the prompt.

Answer: B

Explanation

RAG retrieves current documentation at query time, ensuring responses reflect the latest information without retraining the language model.


Question 9 (Ordering)

A developer is building a SQL-based RAG application using sp_invoke_external_rest_endpoint.

Arrange the following steps in the correct order.

  1. Retrieve relevant documents.
  2. Call the language model.
  3. Generate embeddings for the user question.
  4. Construct the prompt.

Correct Order

3 → 1 → 4 → 2

Explanation

The workflow is:

  1. Generate an embedding for the user’s question.
  2. Retrieve similar documents.
  3. Build the prompt using the retrieved context.
  4. Send the prompt to the language model.

Question 10 (Scenario-Based)

A company has implemented hybrid search that combines keyword search and vector search.

The search results are merged using Reciprocal Rank Fusion (RRF).

What is the primary purpose of RRF?

A. Generate embeddings.

B. Merge and re-rank results from multiple retrieval methods.

C. Compress vector indexes.

D. Convert SQL data into JSON.

Answer: B

Explanation

Reciprocal Rank Fusion (RRF) combines ranked result lists from different retrieval methods (such as keyword search and vector search) into a single ranking. This often improves search quality by leveraging the strengths of each retrieval technique.


Question 11 (Single Answer)

Your company maintains several stored procedures that perform complex business logic. The procedures are executed thousands of times each hour, but the execution plans frequently become inefficient because parameter values vary significantly.

Which feature should you implement to reduce parameter sensitivity issues?

A. Enable Query Store

B. Use Parameter Sensitive Plan (PSP) optimization

C. Create a clustered columnstore index

D. Enable Dynamic Data Masking

Answer: B

Explanation

Parameter Sensitive Plan (PSP) optimization allows SQL Server to maintain multiple execution plans for different parameter value ranges, improving performance when parameter distributions vary significantly.

  • Query Store helps monitor plans but does not solve parameter sensitivity by itself.
  • Columnstore indexes target analytical workloads.
  • Dynamic Data Masking is unrelated to performance.

Question 12 (Choose TWO)

You are developing a SQL application that calls an Azure AI model by using sp_invoke_external_rest_endpoint.

Which two components are typically required in the REST request?

A. HTTP headers

B. JSON payload

C. XML schema

D. SQL CLR assembly

E. SQL Agent Job

Choose TWO answers.

Answers

A

B

Explanation

REST requests to AI services generally require:

  • HTTP headers (authentication, content type)
  • A JSON request body containing the prompt and parameters

The remaining options are unrelated.


Question 13 (Scenario)

A financial institution is implementing Row-Level Security (RLS).

Managers should see records only for employees in their own department.

Which component enforces this behavior?

A. Dynamic Data Masking

B. Security policy using a predicate function

C. Transparent Data Encryption

D. Query Store

Answer: B

Explanation

Row-Level Security uses an inline table-valued predicate function combined with a security policy to filter rows automatically based on the executing user’s context.


Question 14 (Match the Answers)

Match each SQL object with its primary purpose.

SQL ObjectPurpose
1. ViewA. Stores executable business logic
2. Stored ProcedureB. Represents a virtual table
3. TriggerC. Executes automatically after data modifications

Answer

SQL ObjectCorrect Match
ViewB
Stored ProcedureA
TriggerC

Explanation

  • Views provide virtual tables.
  • Stored procedures encapsulate reusable logic.
  • Triggers automatically execute when INSERT, UPDATE, or DELETE events occur.

Question 15 (Single Answer)

A developer needs to generate embeddings for thousands of product descriptions before building a vector index.

What should happen first?

A. Create the vector index.

B. Build the hybrid search pipeline.

C. Generate embeddings for each document.

D. Call the language model.

Answer: C

Explanation

Embeddings must exist before a vector index can be populated. The typical workflow is:

  1. Generate embeddings.
  2. Store vectors.
  3. Create/populate the vector index.
  4. Perform similarity search.

Question 16 (Choose THREE)

Which three practices improve database security?

A. Enable Transparent Data Encryption (TDE)

B. Implement least-privilege permissions

C. Disable authentication logging

D. Apply Dynamic Data Masking where appropriate

E. Grant db_owner to all developers

Choose THREE answers.

Answers

A

B

D

Explanation

These practices strengthen database security by protecting data at rest, limiting user permissions, and masking sensitive information.

Granting excessive permissions and disabling auditing reduce security.


Question 17 (Scenario)

Your organization uses Azure SQL Database.

Developers frequently overwrite one another’s schema changes during deployment.

Management wants schema changes tracked, versioned, reviewed, and automatically deployed.

Which technology best satisfies these requirements?

A. Query Store

B. SQL Database Projects with Git and CI/CD

C. SQL Profiler

D. SQL Server Agent

Answer: B

Explanation

SQL Database Projects integrate with source control systems and CI/CD pipelines, enabling controlled schema versioning, peer review, automated validation, and repeatable deployments.


Question 18 (Fill in the Blank)

Complete the statement.

The SQL function most commonly used to retrieve a single scalar value from a JSON document is:


A. OPENJSON

B. JSON_QUERY

C. JSON_VALUE

D. FOR JSON PATH

Answer: C

Explanation

JSON_VALUE extracts individual scalar values such as strings, numbers, or Boolean values from JSON documents.


Question 19 (Scenario-Based)

A retail company has implemented hybrid search using both keyword search and vector search.

Testing shows that keyword search finds exact product numbers, while vector search finds semantically similar products.

Management wants both result sets combined into one ranked list.

Which technique should be used?

A. Euclidean Distance

B. Principal Component Analysis

C. Reciprocal Rank Fusion (RRF)

D. K-Means Clustering

Answer: C

Explanation

Reciprocal Rank Fusion combines ranked results from multiple retrieval methods, producing a single ranking that benefits from both lexical and semantic matching.


Question 20 (Multi-Answer)

A SQL developer is preparing structured customer information before sending it to a language model.

Which three practices are recommended?

A. Remove sensitive information that is not required.

B. Convert relational results into JSON.

C. Include every available database column.

D. Send only the fields needed for the prompt.

E. Ignore row-level security because the AI model is trusted.

Choose THREE answers.

Answers

A

B

D

Explanation

Preparing structured data for AI involves:

  • Removing unnecessary or sensitive information.
  • Converting relational data to JSON.
  • Sending only relevant fields to minimize token usage and improve performance.

Including all columns wastes tokens and may expose confidential information. Existing security controls should remain in effect.


Question 21 (Scenario-Based)

A company is building a customer support chatbot using Retrieval-Augmented Generation (RAG). Product manuals are updated daily, and management wants the chatbot to use the newest documentation immediately without retraining the language model.

Which architecture best satisfies this requirement?

A. Fine-tune the language model every evening.

B. Store all manuals directly in the prompt.

C. Use a vector index to retrieve relevant documents during each user query.

D. Convert all manuals into stored procedures.

Answer: C

Explanation

RAG retrieves the most relevant documents at query time using a vector search, allowing the chatbot to use newly added documentation without retraining the model.

  • Fine-tuning is expensive and unnecessary for frequently changing data.
  • Including all manuals in every prompt exceeds token limits.
  • Stored procedures cannot replace document retrieval.

Question 22 (Choose TWO)

Which TWO characteristics are true of embedding vectors?

A. Similar meanings produce vectors that are close together.

B. Embeddings store the original document text.

C. Embeddings represent semantic meaning numerically.

D. Embeddings require clustered indexes.

E. Embeddings replace relational databases.

Choose TWO answers.

Answers

A

C

Explanation

Embeddings are numerical representations of semantic meaning. Similar concepts generate vectors that are close together within vector space.


Question 23 (Single Answer)

A developer wants to improve the performance of a vector similarity search.

Which action provides the greatest benefit?

A. Increase the SQL transaction log size.

B. Create an appropriate vector index.

C. Enable Dynamic Data Masking.

D. Compress the database backup.

Answer: B

Explanation

Vector indexes dramatically improve similarity search performance by reducing the number of vectors that must be examined during nearest-neighbor searches.


Question 24 (Scenario-Based)

A SQL application calls an Azure AI model by using sp_invoke_external_rest_endpoint.

The returned JSON contains the following:

{
"choices": [
{
"message": {
"content": "Always validate user input."
}
}
]
}

Which SQL function should be used to extract only the generated response?

A. OPENJSON

B. JSON_QUERY

C. FOR JSON PATH

D. JSON_VALUE

Answer: D

Explanation

JSON_VALUE() extracts a single scalar value, making it ideal for retrieving choices[0].message.content.


Question 25 (Ordering)

Arrange the following steps for implementing vector search.

  1. Generate embeddings.
  2. Store embeddings in the database.
  3. Create the vector index.
  4. Execute similarity searches.

Correct Order

1 → 2 → 3 → 4

Explanation

Embeddings must first be generated and stored before the vector index can be created and used for similarity searches.


Question 26 (Match the Answers)

Match each AI concept with its description.

ConceptDescription
1. EmbeddingA. Combines keyword and vector search rankings
2. Hybrid SearchB. Numerical representation of semantic meaning
3. Reciprocal Rank FusionC. Executes keyword and vector searches together

Answer

ConceptCorrect Match
EmbeddingB
Hybrid SearchC
Reciprocal Rank FusionA

Explanation

  • Embeddings convert data into semantic vectors.
  • Hybrid search combines lexical and semantic retrieval.
  • RRF merges multiple ranked result lists into a single ranking.

Question 27 (Choose THREE)

Which THREE practices improve prompt quality for Retrieval-Augmented Generation?

A. Include only relevant retrieved documents.

B. Clearly describe the task.

C. Add duplicate context whenever possible.

D. Specify the desired output format.

E. Include unrelated reference material.

Choose THREE answers.

Answers

A

B

D

Explanation

Good prompts:

  • include only relevant context,
  • clearly define the task,
  • specify the expected response format.

Duplicate or unrelated information wastes tokens and may reduce answer quality.


Question 28 (Scenario-Based)

A company stores HR information in Azure SQL Database.

Only Human Resources employees should view employee salaries, even when an AI application queries the database.

Which solution provides the BEST protection?

A. Transparent Data Encryption

B. Row-Level Security

C. Automatic Indexing

D. Query Store

Answer: B

Explanation

Row-Level Security ensures only authorized users can access rows containing sensitive salary information, regardless of whether the data is accessed directly or through an AI-enabled application.


Question 29 (Single Answer)

A developer needs to reduce API costs when sending requests to a language model.

Which action is MOST effective?

A. Increase the embedding dimensions.

B. Send every available database column.

C. Include only relevant context in the prompt.

D. Increase the maximum response tokens.

Answer: C

Explanation

Reducing unnecessary prompt content decreases token usage, lowers costs, improves latency, and often improves answer quality.


Question 30 (Comprehensive Scenario)

A software company is developing an AI-powered knowledge assistant using Azure SQL Database.

The application requirements are:

  • Store technical documents.
  • Support semantic search.
  • Combine keyword and vector search.
  • Retrieve the best documents.
  • Send the retrieved context to a language model.
  • Display AI-generated answers.
  • Use current documentation without retraining.

Which architecture BEST satisfies these requirements?

A. Fine-tune the language model after every documentation update.

B. Store every document inside a single SQL stored procedure.

C. Export all documents into CSV files before every query.

D. Implement a Retrieval-Augmented Generation (RAG) solution using embeddings, vector search, hybrid search, and prompt construction.

Answer: D

Explanation

A RAG architecture provides exactly the required functionality:

  • Documents remain in the database.
  • Embeddings enable semantic retrieval.
  • Hybrid search combines keyword and vector search.
  • Retrieved documents become prompt context.
  • The language model generates grounded responses.
  • Documentation updates are immediately available without retraining.

Go to the DP-800 Exam Prep Hub main page

DP-800 Practice Exam #2 (30 questions)

This post/practice exam is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.


Question 1 (Scenario-Based)

A software company is designing a SQL Server database for an online reservation system. Each reservation has a unique ReservationID that is never updated. Most transactions retrieve reservations by ReservationID.

Which indexing strategy should you recommend?

A. Create a clustered index on ReservationID.

B. Create a nonclustered index on every column.

C. Create a clustered columnstore index.

D. Do not create indexes until performance problems occur.

Answer: A

Explanation

A clustered index on a stable, unique key such as ReservationID is ideal for OLTP workloads because it provides efficient point lookups and organizes the table by the primary access path.

  • Nonclustered indexes on every column increase maintenance overhead.
  • Clustered columnstore indexes are intended for analytics.
  • Waiting to create indexes is not a best practice for well-understood workloads.

Question 2 (Choose TWO)

A development team wants to improve database deployment quality using SQL Database Projects.

Which TWO benefits does this approach provide?

A. Source control integration

B. Automatic vector embedding generation

C. Schema validation before deployment

D. Automatic Row-Level Security configuration

E. Automatic model fine-tuning

Choose TWO answers.

Answers

A

C

Explanation

SQL Database Projects support:

  • Version control integration (Git, Azure DevOps, GitHub)
  • Build-time validation of schema changes
  • Automated CI/CD deployment

They do not automatically configure security policies or AI models.


Question 3 (Single Answer)

A database contains personally identifiable information (PII). Customer service representatives should see only partially masked Social Security numbers, while administrators should see the complete values.

Which feature should you implement?

A. Transparent Data Encryption

B. Row-Level Security

C. Dynamic Data Masking

D. Always Encrypted

Answer: C

Explanation

Dynamic Data Masking hides portions of sensitive data for non-privileged users while allowing authorized users to view the original values.

  • TDE protects data at rest.
  • RLS filters rows.
  • Always Encrypted protects data from the database engine itself and is a stronger encryption solution, but it does not provide role-based masking behavior.

Question 4 (Fill in the Blank)

Complete the statement.

The SQL function used to convert JSON arrays into relational rows is:

A. JSON_VALUE

B. JSON_QUERY

C. OPENJSON

D. FOR JSON AUTO

Answer: C

Explanation

OPENJSON parses JSON objects and arrays into relational rows and columns that can be queried using T-SQL.


Question 5 (Scenario-Based)

Your organization has implemented Retrieval-Augmented Generation (RAG).

Users report that the chatbot often provides outdated information, even though newer documentation has already been uploaded.

Which action is MOST likely to resolve the issue?

A. Increase the model temperature.

B. Regenerate embeddings for the newly added documents and update the vector index.

C. Enable Query Store.

D. Increase MAXDOP.

Answer: B

Explanation

New documents must be embedded and indexed before they can be retrieved through vector search. Without updated embeddings, the retrieval process cannot find the new content.


Question 6 (Match the Answers)

Match each database security feature with its primary purpose.

FeaturePurpose
1. Transparent Data EncryptionA. Restricts visible rows
2. Row-Level SecurityB. Encrypts database files at rest
3. Dynamic Data MaskingC. Masks sensitive column values

Answer

FeatureCorrect Match
Transparent Data EncryptionB
Row-Level SecurityA
Dynamic Data MaskingC

Explanation

  • TDE encrypts the database on disk.
  • RLS filters rows returned to users.
  • DDM masks column values for unauthorized users.

Question 7 (Choose THREE)

Which THREE factors improve the quality of vector search results?

A. Generate high-quality embeddings using an appropriate embedding model.

B. Chunk large documents into meaningful sections.

C. Store embeddings as VARCHAR values.

D. Use an appropriate vector similarity metric.

E. Disable vector indexing.

Choose THREE answers.

Answers

A

B

D

Explanation

Effective vector search depends on:

  • High-quality embeddings
  • Appropriate document chunking
  • Correct similarity metrics (such as cosine similarity)

Storing embeddings as text or disabling indexes reduces performance and effectiveness.


Question 8 (Scenario-Based)

A SQL application sends prompts to an Azure AI model using sp_invoke_external_rest_endpoint.

The application receives HTTP status code 429.

What does this status code indicate?

A. Authentication failed.

B. The request contains malformed JSON.

C. The service is rate limiting requests.

D. The model generated an invalid response.

Answer: C

Explanation

HTTP 429 means Too Many Requests. The application should implement retry logic with exponential backoff to handle temporary throttling.


Question 9 (Ordering)

Arrange the following CI/CD workflow in the correct order.

  1. Commit schema changes.
  2. Validate the SQL Database Project.
  3. Deploy to the production environment.
  4. Build the deployment artifact.

Correct Order

1 → 2 → 4 → 3

Explanation

The typical workflow is:

  1. Commit changes to source control.
  2. Validate the project during the build.
  3. Generate the deployment artifact (such as a DACPAC).
  4. Deploy to production through the release pipeline.

Question 10 (Comprehensive Scenario)

A company is building an AI-powered search application.

Requirements:

  • Support traditional keyword searches.
  • Support semantic similarity searches.
  • Combine both result sets into one ranked list.
  • Improve relevance without retraining the language model.

Which solution best satisfies these requirements?

A. Increase the embedding dimensions.

B. Implement hybrid search with Reciprocal Rank Fusion (RRF).

C. Fine-tune the language model every week.

D. Replace vector search with LIKE queries.

Answer: B

Explanation

Hybrid search combines keyword and vector search results. Reciprocal Rank Fusion (RRF) merges and reranks the results, improving retrieval quality by leveraging both lexical and semantic matching.


Question 11 (Scenario-Based)

A database developer creates the following query:

SELECT *
FROM Sales
WHERE CustomerID = 1050;

The query runs frequently against a table containing 500 million rows.

The query execution plan shows that SQL Server performs a table scan.

What should you do to improve performance?

A. Create a nonclustered index on CustomerID.

B. Enable Transparent Data Encryption.

C. Increase the database compatibility level.

D. Convert the table to JSON format.

Answer: A

Explanation

A nonclustered index on CustomerID allows SQL Server to quickly locate matching rows instead of scanning the entire table.

  • TDE does not improve query performance.
  • Compatibility changes may enable features but do not directly solve this issue.
  • JSON conversion would negatively impact relational query performance.

Question 12 (Choose TWO)

A developer is creating a stored procedure that will be called by an application.

Which TWO practices improve the security and reliability of the stored procedure?

A. Use parameterized inputs.

B. Grant users direct access to all underlying tables.

C. Validate input parameters.

D. Construct SQL statements using string concatenation.

E. Disable error handling.

Choose TWO answers.

Answers

A

C

Explanation

Parameterized inputs reduce SQL injection risk, while input validation ensures the procedure receives expected values.

Avoid:

  • Direct table access when unnecessary.
  • Dynamic SQL built through string concatenation.
  • Removing error handling.

Question 13 (Single Answer)

A company wants to track query performance regressions after deploying database changes.

Which SQL feature should be used?

A. Query Store

B. Dynamic Data Masking

C. Database Mail

D. Change Tracking

Answer: A

Explanation

Query Store captures query execution information, including:

  • Query text
  • Execution plans
  • Runtime statistics
  • Historical performance

This allows administrators to identify regressions after deployments.


Question 14 (Scenario-Based)

A company stores product descriptions in Azure SQL Database.

They want customers to search for:

“comfortable shoes for hiking”

and retrieve products described as:

“lightweight trail footwear designed for long walks.”

A traditional keyword search does not return the correct results.

What should you implement?

A. Foreign key constraints

B. Vector embeddings and similarity search

C. Additional clustered indexes

D. Data compression

Answer: B

Explanation

Keyword search depends on exact terms. Vector search uses embeddings to understand semantic similarity, allowing conceptually related results to be returned.


Question 15 (Fill in the Blank)

Complete the statement.

The process of converting text, images, or other data into numerical representations that capture semantic meaning is called:


A. Tokenization

B. Index fragmentation

C. Embedding

D. Encryption

Answer: C

Explanation

An embedding converts information into a numerical vector representation that can be compared mathematically for similarity.


Question 16 (Match the Answers)

Match each SQL performance feature with its purpose.

FeaturePurpose
1. Query StoreA. Automatically adjusts database performance settings
2. Automatic TuningB. Stores historical query performance information
3. Columnstore IndexC. Optimizes analytical queries over large datasets

Answer

FeatureCorrect Match
Query StoreB
Automatic TuningA
Columnstore IndexC

Explanation

  • Query Store tracks query history.
  • Automatic Tuning can recommend or apply performance improvements.
  • Columnstore indexes accelerate analytical workloads.

Question 17 (Choose THREE)

You are implementing a Retrieval-Augmented Generation solution.

Which THREE components are required?

A. A data source containing grounding information

B. An embedding model

C. A retrieval mechanism

D. A clustered index on every table

E. A database trigger for every document

Choose THREE answers.

Answers

A

B

C

Explanation

A RAG system requires:

  1. Source information.
  2. Embeddings to represent semantic meaning.
  3. Retrieval to find relevant context.

Clustered indexes and triggers are not required components of RAG.


Question 18 (Scenario-Based)

A developer sends database information to a language model.

The prompt contains:

  • Customer name
  • Customer address
  • Internal account identifier
  • Product question

The model only needs the product question and relevant product information.

What should the developer do?

A. Include all data because larger prompts improve accuracy.

B. Remove unnecessary customer information before creating the prompt.

C. Disable database security features.

D. Increase the model temperature.

Answer: B

Explanation

Only relevant information should be sent to the language model.

Benefits include:

  • Reduced token usage
  • Lower cost
  • Better privacy
  • Improved response quality

Question 19 (Single Answer)

A developer needs to retrieve an entire JSON object from an AI model response.

Which SQL function should be used?

A. JSON_VALUE

B. JSON_QUERY

C. LEN

D. STRING_AGG

Answer: B

Explanation

JSON_QUERY returns JSON objects or arrays.

Example:

SELECT JSON_QUERY(@response, '$.choices');

JSON_VALUE is used only for scalar values.


Question 20 (Comprehensive Scenario)

A company is deploying a SQL Database Project through Azure DevOps.

The deployment process must:

  • Validate schema changes
  • Prevent unauthorized database modifications
  • Automatically deploy approved changes

Which approach should be implemented?

A. Allow developers to manually modify production databases.

B. Use source control, build validation, and automated deployment pipelines.

C. Store database scripts on local developer machines.

D. Disable all database permissions during deployment.

Answer: B

Explanation

A proper CI/CD workflow includes:

  • Source control management
  • Automated builds
  • Validation
  • Deployment approvals
  • Automated release pipelines

This improves consistency, security, and reliability.


Question 21 (Scenario-Based)

A company has implemented a vector search solution in Azure SQL Database.

Users report that searches sometimes return documents that contain similar words but do not answer the actual question.

The development team wants results that consider both exact keyword matches and semantic similarity.

What should the team implement?

A. Increase the number of database indexes.

B. Hybrid search combining keyword and vector search.

C. Replace embeddings with relational columns.

D. Increase SQL Server memory allocation.

Answer: B

Explanation

Hybrid search combines:

  • Traditional lexical search (keyword matching)
  • Vector search (semantic similarity)

This improves retrieval quality because each method addresses different search scenarios.


Question 22 (Choose TWO)

A developer is evaluating vector search performance.

Which TWO factors should be considered when selecting a similarity metric?

A. The type of embedding model being used.

B. The database recovery model.

C. Whether vectors are normalized.

D. The number of database users.

E. The table’s foreign keys.

Choose TWO answers.

Answers

A

C

Explanation

Similarity metrics should align with:

  • The characteristics of the embedding model.
  • Whether vectors are normalized.

Common metrics include:

  • Cosine similarity
  • Euclidean distance
  • Dot product

Database recovery models and relational constraints do not affect vector similarity calculations.


Question 23 (Single Answer)

A developer wants to combine rankings from a vector search query and a keyword search query.

Which algorithm should be used?

A. Reciprocal Rank Fusion (RRF)

B. K-means clustering

C. Gradient descent

D. Binary search

Answer: A

Explanation

Reciprocal Rank Fusion combines multiple ranked result lists into a single ranking.

It is commonly used in hybrid search solutions because it does not require the scores from different search systems to be directly comparable.


Question 24 (Scenario-Based)

A company uses an AI assistant to answer questions about internal policies.

The assistant sometimes generates responses that are not supported by company documentation.

Which RAG improvement should be implemented?

A. Remove document retrieval from the workflow.

B. Increase the model temperature.

C. Provide retrieved documents as grounding context in the prompt.

D. Train users to write longer questions.

Answer: C

Explanation

RAG reduces hallucinations by providing the language model with relevant retrieved information as context.

The prompt should include:

  • User question
  • Retrieved documents
  • Instructions to answer using provided information

Question 25 (Ordering)

Arrange the following steps for processing a user question in a RAG application.

  1. Send the augmented prompt to the language model.
  2. Generate an embedding for the user question.
  3. Retrieve similar documents.
  4. Combine the question and retrieved context.

Correct Order

2 → 3 → 4 → 1

Explanation

A RAG workflow follows these steps:

  1. Convert the question into an embedding.
  2. Search the vector index.
  3. Build the augmented prompt.
  4. Send it to the language model.

Question 26 (Match the Answers)

Match each technology with its purpose.

TechnologyPurpose
1. Vector IndexA. Generates natural language responses
2. Embedding ModelB. Enables efficient similarity searches
3. Language ModelC. Converts content into numerical vectors

Answer

TechnologyCorrect Match
Vector IndexB
Embedding ModelC
Language ModelA

Explanation

  • Vector indexes optimize searching through embeddings.
  • Embedding models convert data into numerical representations.
  • Language models generate responses.

Question 27 (Choose THREE)

A developer is implementing an enterprise AI assistant using SQL data.

Which THREE security practices should be followed?

A. Apply least-privilege permissions.

B. Remove unnecessary sensitive information from prompts.

C. Log prompts and responses securely.

D. Grant all AI services administrator permissions.

E. Disable auditing.

Choose THREE answers.

Answers

A

B

C

Explanation

Secure AI solutions should:

  • Follow least privilege.
  • Minimize sensitive data exposure.
  • Maintain secure logging and monitoring.

Granting excessive permissions and disabling auditing increase security risks.


Question 28 (Scenario-Based)

A developer receives this response from an AI service:

{
"choices": [
{
"message": {
"content": "The warranty expires after two years."
}
}
]
}

The developer needs to store only the generated answer in a SQL table.

Which query should be used?

A.

SELECT JSON_VALUE(@response,'$.choices');

B.

SELECT JSON_QUERY(@response,'$.choices[0]');

C.

SELECT JSON_VALUE(@response,'$.choices[0].message.content');

D.

SELECT OPENJSON(@response);

Answer: C

Explanation

JSON_VALUE extracts scalar values.

The generated answer is stored at:

$.choices[0].message.content

Question 29 (Single Answer)

A company notices that a SQL query became slower after a database deployment.

Which feature should administrators use to compare previous and current query performance?

A. Query Store

B. Data Masking

C. Database Mail

D. SQL Server Agent

Answer: A

Explanation

Query Store maintains historical information about:

  • Queries
  • Execution plans
  • Runtime statistics

It helps identify performance regressions after changes.


Question 30 (Comprehensive Scenario)

A company is creating an AI-powered document assistant.

Requirements:

  • Documents are stored in Azure SQL Database.
  • Users search using natural language.
  • Search must return relevant documents even when exact words differ.
  • Exact terms such as product IDs must still work.
  • Responses must be generated using retrieved information.
  • New documents should become available without model retraining.

Which architecture should be implemented?

A. Keyword search only with SQL LIKE queries.

B. Fine-tune the language model whenever documents change.

C. Implement RAG using embeddings, vector search, hybrid search, and prompt augmentation.

D. Store all documents directly in the language model.

Answer: C

Explanation

The correct architecture is a Retrieval-Augmented Generation solution:

  1. Generate embeddings for documents.
  2. Store embeddings in a vector-enabled database.
  3. Perform hybrid search:
    • Keyword search for exact matches.
    • Vector search for semantic similarity.
  4. Add retrieved context to the prompt.
  5. Generate a grounded response.

This allows new documents to become available without retraining the model.


Go to the DP-800 Exam Prep Hub main page

DP-800 Practice Exam #3 (30 questions)

This post/practice exam is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.


Question 1 (Scenario-Based)

A retail company is designing a SQL database for order processing.

Requirements:

  • Orders are frequently retrieved by OrderID.
  • New orders are inserted continuously.
  • The database supports thousands of transactions per minute.
  • Reports are generated against a separate analytical system.

Which indexing strategy should you recommend for the Orders table?

A. Use a clustered index on OrderID.

B. Use a clustered columnstore index.

C. Create nonclustered indexes on every column.

D. Store order data as JSON documents.

Answer: A

Explanation

An OLTP order-processing system benefits from a clustered index on the primary transaction key.

A clustered index:

  • Provides efficient lookups.
  • Supports frequent inserts and updates.
  • Organizes table storage.

Why the others are incorrect:

  • B: Clustered columnstore indexes are optimized for analytics, not high-volume OLTP.
  • C: Excessive indexes increase insert/update overhead.
  • D: JSON storage is not appropriate for a highly relational transaction workload.

Question 2 (Choose TWO)

A developer is creating a reusable database API layer using stored procedures.

Which TWO practices should be implemented?

A. Use input parameters instead of string concatenation.

B. Grant applications direct access to all tables.

C. Include error handling with TRY…CATCH.

D. Store passwords in stored procedure code.

E. Disable transaction handling.

Choose TWO answers.

Answers

A

C

Explanation

Stored procedures should:

  • Accept parameters to reduce SQL injection risks.
  • Include error handling to gracefully manage failures.

The other choices introduce security or reliability issues.


Question 3 (Single Answer)

A developer needs to create a database object that automatically returns only rows belonging to the current user.

Which SQL feature should be used?

A. Dynamic Data Masking

B. Row-Level Security

C. Transparent Data Encryption

D. Columnstore Index

Answer: B

Explanation

Row-Level Security (RLS) controls which rows a user can access.

Example:

A salesperson should only see customers assigned to their territory.

Why the others are incorrect:

  • Dynamic Data Masking hides values but does not filter rows.
  • TDE encrypts data at rest.
  • Columnstore indexes improve analytics performance.

Question 4 (Fill in the Blank)

Complete the statement.

The SQL Server feature that stores historical query execution information and helps identify performance regressions is:

A. Query Store

B. Resource Governor

C. SQL Server Agent

D. Database Mail

Answer: A

Explanation

Query Store captures:

  • Query text
  • Execution plans
  • Runtime statistics

It is commonly used after deployments to determine whether performance has degraded.


Question 5 (Scenario-Based)

A company has a customer table containing:

  • CustomerID
  • Name
  • EmailAddress
  • PhoneNumber

Customer service representatives need to search customers by name and email.

The application frequently executes:

SELECT *
FROM Customers
WHERE EmailAddress = @Email;

The query is slow.

What should you implement?

A. A nonclustered index on EmailAddress.

B. A clustered columnstore index.

C. Database encryption.

D. A JSON document store.

Answer: A

Explanation

A nonclustered index on EmailAddress allows efficient searches using the predicate.

The query optimizer can perform an index seek instead of scanning the entire table.


Question 6 (Matching)

Match each SQL feature with its purpose.

FeaturePurpose
1. Dynamic Data MaskingA. Encrypts database files
2. Transparent Data EncryptionB. Filters rows returned to users
3. Row-Level SecurityC. Hides sensitive column values

Answer

FeatureCorrect Match
Dynamic Data MaskingC
Transparent Data EncryptionA
Row-Level SecurityB

Explanation

  • DDM masks sensitive data.
  • TDE protects stored database files.
  • RLS restricts row visibility.

Question 7 (Scenario-Based)

A company wants to deploy schema changes automatically.

The development team uses Visual Studio SQL Database Projects.

The deployment process must:

  • Detect schema conflicts before deployment.
  • Store database changes in source control.
  • Deploy only approved changes.

Which solution should be implemented?

A. Manually copy SQL scripts to production.

B. Use a CI/CD pipeline with SQL Database Projects.

C. Allow developers to modify production directly.

D. Disable schema validation.

Answer: B

Explanation

SQL Database Projects integrate well with CI/CD pipelines.

Benefits include:

  • Version control.
  • Automated builds.
  • Schema validation.
  • Repeatable deployments.

Question 8 (Choose THREE)

A developer is designing a vector search solution.

Which THREE practices improve search quality?

A. Generate embeddings using a suitable AI model.

B. Select an appropriate similarity metric.

C. Split large documents into meaningful chunks.

D. Convert embeddings into XML.

E. Disable indexing.

Choose THREE answers.

Answers

A

B

C

Explanation

Vector search quality depends on:

  • Good embeddings.
  • Proper chunking.
  • Appropriate similarity calculations.

Converting vectors to XML or disabling indexes reduces effectiveness.


Question 9 (Scenario-Based)

A developer implements a Retrieval-Augmented Generation application.

The application workflow is:

  1. User asks a question.
  2. The system searches documents.
  3. Relevant documents are added to the prompt.
  4. The language model generates an answer.

Users report incorrect answers when documents contain outdated information.

What should be improved?

A. Increase the language model temperature.

B. Ensure document updates regenerate embeddings and refresh the vector index.

C. Remove retrieval from the architecture.

D. Increase SQL transaction isolation.

Answer: B

Explanation

RAG depends on accurate retrieval.

When documents change:

  1. Generate new embeddings.
  2. Update vector storage.
  3. Ensure the search index contains current data.

Question 10 (Single Answer)

A developer wants to retrieve a scalar value from JSON returned by an AI service.

Which SQL function should be used?

A. OPENJSON

B. JSON_QUERY

C. JSON_VALUE

D. FOR JSON PATH

Answer: C

Explanation

JSON_VALUE extracts a single scalar value.

Example:

SELECT JSON_VALUE(@json,'$.answer');

Other functions:

  • OPENJSON converts JSON into rows.
  • JSON_QUERY returns JSON objects or arrays.
  • FOR JSON PATH creates JSON output.

Question 11 (Scenario-Based)

A company has an application that retrieves customer order history.

The following query is executed frequently:

SELECT OrderDate, Amount
FROM Orders
WHERE CustomerID = @CustomerID
ORDER BY OrderDate DESC;

The query is slow because the Orders table contains several hundred million rows.

Which index should you create?

A. A nonclustered index on CustomerID that includes OrderDate and Amount.

B. A clustered columnstore index on the Orders table.

C. A unique constraint on OrderDate.

D. A full-text index on CustomerID.

Answer: A

Explanation

A covering nonclustered index improves this query because:

  • CustomerID is used for filtering.
  • OrderDate supports sorting.
  • Amount is included to avoid additional lookups.

A clustered columnstore index is better suited for analytical workloads.


Question 12 (Choose TWO)

A database developer is writing complex T-SQL code.

Which TWO practices improve maintainability and performance?

A. Use Common Table Expressions (CTEs) when appropriate.

B. Avoid all stored procedures.

C. Use execution plans to analyze queries.

D. Store all business logic in application code.

E. Ignore query statistics.

Choose TWO answers.

Answers

A

C

Explanation

Good T-SQL practices include:

  • Using CTEs to simplify complex queries.
  • Reviewing execution plans to identify bottlenecks.

Execution plans reveal:

  • Table scans
  • Missing indexes
  • Expensive operators

Question 13 (Single Answer)

A company wants to prevent users from viewing sensitive information while allowing applications to access the original values securely.

Which feature should be considered?

A. Dynamic Data Masking

B. Always Encrypted

C. Columnstore Index

D. Query Store

Answer: B

Explanation

Always Encrypted protects sensitive data from being exposed to database administrators or unauthorized users.

Encryption and decryption occur outside the database engine.

Comparison:

  • DDM masks values but privileged users can access original data.
  • TDE protects data at rest.
  • Query Store tracks performance.

Question 14 (Scenario-Based)

A developer creates a stored procedure that dynamically builds SQL statements:

SET @sql =
'SELECT * FROM Customers WHERE Name = '''
+ @Name + '''';
EXEC(@sql);

Security testing identifies a SQL injection vulnerability.

What should the developer do?

A. Use parameterized SQL with sp_executesql.

B. Encrypt the database.

C. Add more indexes.

D. Enable Query Store.

Answer: A

Explanation

Dynamic SQL that concatenates user input can allow SQL injection.

Using:

sp_executesql

with parameters separates:

  • SQL code
  • User-provided values

This improves security and query plan reuse.


Question 15 (Fill in the Blank)

Complete the statement.

A vector search system stores numerical representations of data called __________ that capture semantic meaning.

A. Tokens

B. Embeddings

C. Transactions

D. Partitions

Answer: B

Explanation

Embeddings are numerical vectors generated by AI models.

They allow systems to compare similarity between:

  • Documents
  • Images
  • Questions
  • Other data types

Question 16 (Matching)

Match each Azure SQL AI capability with its purpose.

CapabilityPurpose
1. Vector SearchA. Generates natural language responses
2. EmbeddingsB. Finds semantically similar data
3. Language ModelC. Represents data as numerical vectors

Answer

CapabilityCorrect Match
Vector SearchB
EmbeddingsC
Language ModelA

Explanation

The components work together:

  1. Embeddings convert data into vectors.
  2. Vector search finds similar vectors.
  3. Language models generate responses.

Question 17 (Choose THREE)

A company is optimizing an Azure SQL Database workload.

Which THREE actions can improve query performance?

A. Create appropriate indexes.

B. Review execution plans.

C. Update outdated statistics.

D. Disable all constraints.

E. Remove all indexes.

Choose THREE answers.

Answers

A

B

C

Explanation

Performance optimization commonly includes:

  • Proper indexing.
  • Execution plan analysis.
  • Maintaining statistics.

Removing indexes or disabling constraints generally reduces database quality.


Question 18 (Scenario-Based)

A company wants to create an AI assistant that answers employee questions about internal policies.

The company wants answers based only on approved documents.

Which architecture should be implemented?

A. Store all documents directly inside the language model.

B. Use Retrieval-Augmented Generation with document retrieval.

C. Increase the model temperature.

D. Remove document indexing.

Answer: B

Explanation

RAG provides:

  • External knowledge retrieval.
  • Grounded prompts.
  • Updated information without retraining.

The model receives relevant documents as context when generating responses.


Question 19 (Scenario-Based)

A developer implements hybrid search.

The system performs:

  • Keyword search using SQL full-text capabilities.
  • Vector similarity search using embeddings.

The developer needs to merge both ranked result sets.

Which technique should be used?

A. Reciprocal Rank Fusion

B. Data compression

C. Database normalization

D. Horizontal partitioning

Answer: A

Explanation

Reciprocal Rank Fusion (RRF):

  • Combines multiple ranked lists.
  • Does not require matching score scales.
  • Improves hybrid search relevance.

Question 20 (Choose TWO)

A developer sends SQL data to an external language model.

Which TWO practices should be followed?

A. Remove unnecessary sensitive information before sending prompts.

B. Include all database columns to maximize context.

C. Validate and sanitize generated responses.

D. Disable access controls for AI applications.

E. Store API keys directly in application code.

Choose TWO answers.

Answers

A

C

Explanation

Secure AI implementations should:

  • Minimize data exposure.
  • Validate AI outputs.

Avoid:

  • Sending unnecessary data.
  • Hardcoding secrets.
  • Removing security controls.

Question 21 (Scenario-Based)

A development team is building an AI-powered customer support assistant.

The architecture includes:

  • Azure SQL Database containing product documentation
  • Vector embeddings stored with documents
  • A language model generating answers

Users report that the assistant provides inaccurate answers when documents are updated.

What should the development team implement?

A. Increase the language model temperature.

B. Regenerate embeddings and update the vector index whenever documents change.

C. Increase the size of the language model.

D. Remove vector search and use keyword search only.

Answer: B

Explanation

In a RAG solution, document updates require:

  1. Updating the source data.
  2. Regenerating embeddings.
  3. Updating the vector index.

The language model does not automatically learn from updated documents.


Question 22 (Choose TWO)

A developer is designing a vector search implementation.

Which TWO factors should be evaluated when choosing a vector index strategy?

A. Number of vectors stored.

B. Database user roles.

C. Search latency requirements.

D. Column naming conventions.

E. Stored procedure naming standards.

Choose TWO answers.

Answers

A

C

Explanation

Vector search performance depends on:

  • The size of the vector collection.
  • Required query response times.

Other factors listed do not directly affect vector index selection.


Question 23 (Single Answer)

A developer wants to compare the meaning of two pieces of text instead of comparing exact words.

Which approach should be used?

A. String comparison functions

B. Vector embeddings with similarity search

C. Database triggers

D. Data compression

Answer: B

Explanation

Vector embeddings represent semantic meaning numerically.

Similarity searches can identify related concepts even when the wording differs.

Example:

“automobile repair”

and

“vehicle maintenance”

may be considered similar.


Question 24 (Scenario-Based)

A company creates an AI assistant that uses RAG.

The prompt sent to the language model contains:

  • User question
  • Retrieved documents
  • Instructions

The developer wants the model to answer only from retrieved documents.

Which prompt design approach should be used?

A. Tell the model to use provided context and avoid unsupported answers.

B. Remove retrieved documents from the prompt.

C. Increase randomness using a higher temperature.

D. Include unrelated database information.

Answer: A

Explanation

A well-designed RAG prompt should:

  • Provide relevant context.
  • Define response rules.
  • Reduce hallucinations.

Example instruction:

“Answer only using the supplied documents. If the answer is not present, state that you do not know.”


Question 25 (Ordering)

Arrange the following steps for creating a RAG application.

  1. Generate embeddings for documents.
  2. Retrieve relevant documents.
  3. Store document embeddings.
  4. Send augmented prompt to the language model.
  5. Combine retrieved content with the user question.

Correct Order

1 → 3 → 2 → 5 → 4

Explanation

A typical RAG workflow:

  1. Convert documents into embeddings.
  2. Store vectors in a vector-enabled database.
  3. Search vectors when a user asks a question.
  4. Add retrieved content to the prompt.
  5. Send the prompt to the language model.

Question 26 (Matching)

Match each SQL JSON function with its purpose.

FunctionPurpose
1. JSON_VALUEA. Returns JSON objects or arrays
2. JSON_QUERYB. Converts JSON elements into rows
3. OPENJSONC. Extracts scalar JSON values

Answer

FunctionCorrect Match
JSON_VALUEC
JSON_QUERYA
OPENJSONB

Explanation

SQL Server JSON functions:

JSON_VALUE

  • Retrieves a single scalar value.

JSON_QUERY

  • Retrieves JSON objects or arrays.

OPENJSON

  • Converts JSON data into relational rows.

Question 27 (Choose THREE)

A company is preparing an enterprise AI application using Azure SQL Database.

Which THREE security practices should be implemented?

A. Use managed identities where possible.

B. Apply least-privilege database permissions.

C. Log and monitor AI application activity.

D. Store API keys in source code.

E. Send all customer data to the model.

Choose THREE answers.

Answers

A

B

C

Explanation

Enterprise AI applications should follow security best practices:

  • Managed identities reduce credential exposure.
  • Least privilege limits access.
  • Monitoring supports auditing and governance.

Avoid:

  • Hardcoded credentials.
  • Sending unnecessary sensitive information.

Question 28 (Scenario-Based)

A developer uses:

EXEC sp_invoke_external_rest_endpoint

to call an external AI service.

The request fails with HTTP status code 401.

What is the most likely issue?

A. The AI service returned too many results.

B. Authentication credentials are missing or invalid.

C. The database has insufficient storage.

D. The prompt contains too many tokens.

Answer: B

Explanation

HTTP 401 means:

Unauthorized

Common causes:

  • Missing authentication headers.
  • Invalid credentials.
  • Expired tokens.

Other common HTTP codes:

  • 400 = Bad request.
  • 429 = Too many requests.
  • 500 = Server error.

Question 29 (Scenario-Based)

A company has implemented hybrid search.

The results from keyword search and vector search have different scoring systems.

The team needs to combine the results without manually normalizing scores.

Which approach should be used?

A. Reciprocal Rank Fusion

B. Increase vector dimensions

C. Remove keyword search

D. Use a larger database transaction log

Answer: A

Explanation

Reciprocal Rank Fusion (RRF):

  • Combines ranked lists.
  • Works even when scoring methods differ.
  • Improves hybrid search relevance.

Example:

Keyword search ranking:

  1. Document A
  2. Document B

Vector search ranking:

  1. Document C
  2. Document A

RRF combines these rankings into a unified result list.


Question 30 (Comprehensive Scenario)

A company is building an AI knowledge assistant.

Requirements:

  • Data is stored in Azure SQL Database.
  • Users ask questions using natural language.
  • The system must find relevant information even when wording differs.
  • Exact identifiers such as policy numbers must still work.
  • Responses must be based on company documents.
  • New documents must be available without retraining the AI model.

Which architecture should be implemented?

A. Traditional SQL queries only.

B. Fine-tune the language model whenever documents change.

C. RAG using embeddings, vector search, hybrid search, and prompt augmentation.

D. Export all database content into the language model.

Answer: C

Explanation

The recommended architecture is:

  1. Store documents in Azure SQL Database.
  2. Generate embeddings.
  3. Store embeddings for vector search.
  4. Perform hybrid search:
    • Keyword search handles exact terms.
    • Vector search handles semantic meaning.
  5. Use RRF to merge rankings.
  6. Add retrieved information to the prompt.
  7. Generate a grounded response.

Benefits:

  • Updated information without model retraining.
  • Better accuracy.
  • Reduced hallucination.
  • Improved search relevance.

Go to the DP-800 Exam Prep Hub main page

DP-800 Practice Exam #4 (30 questions)

This post/practice exam is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.


Question 1 (Scenario-Based)

A financial services company is designing a transaction database.

The database must:

  • Process thousands of transactions per second.
  • Support frequent inserts and updates.
  • Retrieve transactions by TransactionID.
  • Maintain strong transactional consistency.

Which table design should you recommend?

A. Create a clustered index on TransactionID.

B. Create a clustered columnstore index on the transaction table.

C. Store transactions as JSON documents.

D. Create indexes only after performance issues occur.


Answer: A

Explanation

A clustered index on a transaction key is appropriate for an OLTP workload.

Benefits:

  • Fast lookups by TransactionID.
  • Efficient storage organization.
  • Good support for inserts and updates.

Why other answers are incorrect:

  • B: Columnstore indexes are optimized for analytics and large scans.
  • C: JSON storage is not ideal for transactional relational workloads.
  • D: Index design should be planned during database development.

Question 2 (Choose TWO)

A developer is creating a SQL stored procedure used by multiple applications.

Which TWO practices should be implemented?

A. Use parameters instead of concatenating user input.

B. Grant applications direct access to every database table.

C. Implement TRY…CATCH error handling.

D. Disable transaction handling.

E. Store database credentials inside the procedure.

Choose TWO answers.


Answers:

✅ A
✅ C

Explanation

Stored procedures should:

  • Use parameters to prevent SQL injection.
  • Include error handling to manage failures.

Incorrect approaches:

  • Direct table access violates security principles.
  • Credentials should never be stored in code.
  • Transactions should be managed appropriately.

Question 3 (Single Answer)

A company needs to prevent users from seeing specific rows in a table based on their department.

Which feature should be implemented?

A. Dynamic Data Masking

B. Row-Level Security

C. Transparent Data Encryption

D. Always Encrypted


Answer: B

Explanation

Row-Level Security (RLS) controls which rows users can access.

Example:

A sales employee can view only customers assigned to their region.

Comparison:

FeaturePurpose
Dynamic Data MaskingHides column values
RLSFilters rows
TDEEncrypts data at rest
Always EncryptedProtects sensitive data from database administrators

Question 4 (Fill in the Blank)

Complete the statement.

The SQL feature that allows developers to analyze historical query execution plans and runtime statistics is:

A. Query Store

B. SQL Server Agent

C. Database Mail

D. Resource Governor


Answer: A

Explanation

Query Store captures:

  • Query text
  • Execution plans
  • Runtime statistics
  • Performance history

It is commonly used to troubleshoot regressions after deployments.


Question 5 (Scenario-Based)

An e-commerce company has a Products table.

The following query is executed frequently:

SELECT ProductName, Price
FROM Products
WHERE CategoryID = 25;

The table contains 200 million rows.

The query currently performs a full table scan.

What should you implement?

A. A nonclustered index on CategoryID.

B. Transparent Data Encryption.

C. Convert the table into XML.

D. Increase the database recovery model.


Answer: A

Explanation

A nonclustered index allows SQL Server to locate products by CategoryID without scanning the entire table.

The other options do not improve query lookup performance.


Question 6 (Matching)

Match each feature with its purpose.

FeaturePurpose
1. Query StoreA. Encrypts stored database files
2. Transparent Data EncryptionB. Tracks query performance history
3. Dynamic Data MaskingC. Hides sensitive column values

Answer

FeatureMatch
Query StoreB
Transparent Data EncryptionA
Dynamic Data MaskingC

Explanation

  • Query Store helps analyze query performance.
  • TDE encrypts data files.
  • DDM masks sensitive values.

Question 7 (Scenario-Based)

A development team manages SQL schemas using SQL Database Projects.

The team requires:

  • Database changes stored in Git.
  • Automated validation before deployment.
  • Repeatable deployments across environments.

Which approach should be used?

A. Manually execute scripts in production.

B. Use SQL Database Projects with a CI/CD pipeline.

C. Allow developers to change production directly.

D. Store scripts only on local computers.


Answer: B

Explanation

SQL Database Projects support modern database DevOps practices:

  • Source control integration.
  • Automated builds.
  • Schema validation.
  • Deployment automation.

Question 8 (Choose THREE)

A company is building a semantic search application.

Which THREE components are required?

A. An embedding model

B. Vector storage

C. Similarity search

D. Database Mail

E. SQL Server Agent jobs

Choose THREE answers.


Answers:

✅ A
✅ B
✅ C

Explanation

Semantic search requires:

  1. Converting content into embeddings.
  2. Storing those vectors.
  3. Searching vectors based on similarity.

Database Mail and SQL Server Agent are unrelated.


Question 9 (Scenario-Based)

A company has implemented Retrieval-Augmented Generation (RAG).

The application retrieves documents but sometimes produces incorrect answers.

The retrieved documents are accurate.

What should the developer review first?

A. The prompt instructions sent to the language model.

B. The database backup schedule.

C. The database file size.

D. The transaction isolation level.


Answer: A

Explanation

When retrieval is correct but answers are incorrect, the prompt design should be reviewed.

The prompt should:

  • Clearly define the task.
  • Include retrieved context.
  • Instruct the model to use provided information.

Question 10 (Single Answer)

A developer receives this JSON response from an AI service:

{
"answer": "The policy expires after one year."
}

Which SQL function should extract the answer value?

A. JSON_QUERY

B. OPENJSON

C. JSON_VALUE

D. FOR JSON PATH


Answer: C

Explanation

JSON_VALUE extracts scalar values from JSON.

Example:

SELECT JSON_VALUE(@response,'$.answer');

Other functions:

  • JSON_QUERY returns objects or arrays.
  • OPENJSON converts JSON into rows.
  • FOR JSON PATH creates JSON output.

Question 11 (Scenario-Based)

A company has an Azure SQL Database containing customer activity data.

The following query is executed frequently:

SELECT
CustomerID,
LastLoginDate,
AccountStatus
FROM Customers
WHERE CustomerID = @CustomerID;

The query execution plan shows an expensive key lookup operation.

What should you do to improve performance?

A. Create a covering nonclustered index that includes LastLoginDate and AccountStatus.

B. Remove all indexes from the table.

C. Convert the table to a clustered columnstore table.

D. Enable Transparent Data Encryption.


Answer: A

Explanation

A covering index contains all columns needed by the query.

Example:

CREATE INDEX IX_Customers_CustomerID
ON Customers(CustomerID)
INCLUDE (LastLoginDate, AccountStatus);

This allows SQL Server to retrieve all required data directly from the index without performing additional lookups.

Incorrect answers:

  • B: Removing indexes reduces performance.
  • C: Columnstore indexes are designed for analytics.
  • D: Encryption does not improve query performance.

Question 12 (Choose TWO)

A developer wants to improve the reliability of database application code.

Which TWO practices should be implemented?

A. Use explicit transactions when multiple operations must succeed together.

B. Ignore transaction failures because SQL Server automatically retries everything.

C. Use appropriate error handling.

D. Store business logic only in client applications.

E. Remove constraints to improve performance.

Choose TWO answers.


Answers:

✅ A
✅ C

Explanation

Reliable database applications use:

  • Transactions for atomic operations.
  • Error handling to properly manage failures.

Incorrect:

  • SQL Server does not automatically handle all failures.
  • Constraints protect data integrity.
  • Business logic can exist in stored procedures when appropriate.

Question 13 (Single Answer)

A company needs to ensure that database administrators cannot view sensitive customer information.

Which feature provides the strongest protection?

A. Dynamic Data Masking

B. Always Encrypted

C. Row-Level Security

D. Transparent Data Encryption


Answer: B

Explanation

Always Encrypted protects sensitive data from being viewed by the database engine or administrators.

Comparison:

FeatureProtection
Dynamic Data MaskingHides displayed values
RLSRestricts rows
TDEEncrypts database files
Always EncryptedProtects data from unauthorized database access

Question 14 (Scenario-Based)

A developer notices a query performs poorly.

The execution plan shows:

  • A table scan
  • A missing index recommendation
  • High logical reads

What should the developer do first?

A. Review the query execution plan and evaluate appropriate indexing.

B. Increase the language model temperature.

C. Enable database encryption.

D. Convert relational tables into JSON.


Answer: A

Explanation

Execution plans identify:

  • Expensive operators.
  • Missing indexes.
  • Inefficient query patterns.

The correct optimization process is to analyze the workload before making changes.


Question 15 (Fill in the Blank)

Complete the statement.

The process of combining keyword search results with vector search results is called:

A. Data normalization

B. Hybrid search

C. Data partitioning

D. Tokenization


Answer: B

Explanation

Hybrid search combines:

  • Lexical search (keywords)
  • Semantic search (vectors)

This improves retrieval accuracy because both exact matching and meaning are considered.


Question 16 (Matching)

Match each AI search concept with its purpose.

ConceptPurpose
1. EmbeddingA. Combines multiple ranked searches
2. Reciprocal Rank FusionB. Converts content into vectors
3. Vector SearchC. Finds similar content based on vectors

Answer

ConceptMatch
EmbeddingB
Reciprocal Rank FusionA
Vector SearchC

Explanation

  • Embeddings represent content numerically.
  • Vector search finds semantically similar information.
  • RRF combines ranked lists from multiple retrieval methods.

Question 17 (Choose THREE)

A company is securing an AI-enabled database application.

Which THREE actions should be implemented?

A. Use managed identities for Azure resources.

B. Apply least-privilege access.

C. Remove unnecessary sensitive data from prompts.

D. Share database administrator credentials with developers.

E. Disable auditing.

Choose THREE answers.


Answers:

✅ A
✅ B
✅ C

Explanation

Secure AI solutions should:

  • Minimize credential exposure.
  • Restrict permissions.
  • Reduce sensitive information sent to AI services.

Incorrect:

  • Shared administrator credentials violate security principles.
  • Auditing supports governance and compliance.

Question 18 (Scenario-Based)

A developer creates a RAG solution.

The retrieval process returns:

  • Product manuals
  • Customer reviews
  • Internal notes

The language model frequently references customer reviews instead of official manuals.

What should the developer implement?

A. Increase the number of unrelated documents retrieved.

B. Improve retrieval filtering and document ranking.

C. Remove all vector embeddings.

D. Disable prompt instructions.


Answer: B

Explanation

RAG quality depends on retrieval quality.

Possible improvements:

  • Metadata filtering.
  • Better ranking.
  • Improved chunking.
  • Adjusted retrieval parameters.

The model can only use the information it receives.


Question 19 (Scenario-Based)

A developer calls an Azure AI service from SQL Server using:

sp_invoke_external_rest_endpoint

The request returns HTTP status code 429.

What should the developer implement?

A. Retry logic with exponential backoff.

B. Change JSON_VALUE to JSON_QUERY.

C. Remove authentication.

D. Disable vector indexing.


Answer: A

Explanation

HTTP 429 means:

Too Many Requests

The service is throttling requests.

Recommended approach:

  • Retry after a delay.
  • Use exponential backoff.
  • Monitor service limits.

Question 20 (Choose TWO)

A developer is designing prompts for a RAG application.

Which TWO practices improve response quality?

A. Include relevant retrieved context.

B. Provide clear instructions about expected responses.

C. Include every database table in every prompt.

D. Remove grounding information.

E. Maximize prompt size regardless of relevance.

Choose TWO answers.


Answers:

✅ A
✅ B

Explanation

Effective prompts:

  • Provide relevant context.
  • Clearly define expected behavior.

Large amounts of irrelevant information can reduce response quality and increase cost.


Question 21 (Scenario-Based)

A company stores product descriptions as vector embeddings in Azure SQL Database.

The search application needs to find products with similar meanings even when users use different words.

Example:

User query:

“waterproof hiking footwear”

Relevant products:

“weather-resistant trail boots”

Which similarity approach should be used?

A. Exact string comparison

B. Vector similarity search

C. Foreign key lookup

D. Transaction log analysis


Answer: B

Explanation

Vector similarity search compares numerical representations of meaning rather than exact words.

Embeddings allow the system to identify semantic relationships between concepts.

Incorrect:

  • String comparison requires exact matches.
  • Foreign keys are relational integrity features.
  • Transaction logs are unrelated to search.

Question 22 (Choose TWO)

A developer is evaluating vector search performance.

Which TWO metrics are important when assessing a vector search implementation?

A. Search relevance

B. Number of database users

C. Query latency

D. Stored procedure naming conventions

E. Database object ownership

Choose TWO answers.


Answers:

✅ A
✅ C

Explanation

Vector search performance is evaluated using:

Search relevance

Measures whether returned results are meaningful.

Query latency

Measures how quickly results are returned.

Other options do not measure vector search quality.


Question 23 (Scenario-Based)

A company implements hybrid search.

The keyword search engine returns:

RankDocument
1Document A
2Document B

The vector search engine returns:

RankDocument
1Document C
2Document A

The company wants to combine rankings without comparing incompatible relevance scores.

Which technique should be used?

A. Reciprocal Rank Fusion

B. Database normalization

C. Index fragmentation

D. Data compression


Answer: A

Explanation

Reciprocal Rank Fusion (RRF):

  • Combines ranked lists.
  • Does not require score normalization.
  • Improves hybrid search results.

RRF assigns higher weight to documents appearing near the top of multiple rankings.


Question 24 (Matching)

Match each search technology with its best use case.

TechnologyUse Case
1. Keyword searchA. Finding similar concepts
2. Vector searchB. Exact identifiers
3. Hybrid searchC. Combining semantic and lexical retrieval

Answer

TechnologyMatch
Keyword searchB
Vector searchA
Hybrid searchC

Explanation

Keyword search:

  • Best for exact terms.
  • Example: product numbers, policy IDs.

Vector search:

  • Best for semantic similarity.

Hybrid search:

  • Combines both approaches.

Question 25 (Ordering)

Arrange the steps for implementing a RAG solution.

  1. Generate embeddings for source documents.
  2. Retrieve relevant documents using search.
  3. Store embeddings in a vector-enabled database.
  4. Add retrieved information to the prompt.
  5. Send the prompt to the language model.

Correct Order:

1 → 3 → 2 → 4 → 5

Explanation

A typical RAG workflow:

Step 1

Documents are converted into embeddings.

Step 2

Embeddings are stored.

Step 3

A user query retrieves similar content.

Step 4

Retrieved information is added to the prompt.

Step 5

The language model generates a response.


Question 26 (Scenario-Based)

A developer creates a RAG chatbot.

Users complain that answers contain information that is not in company documents.

Which improvement should be implemented?

A. Add stronger grounding instructions in the prompt.

B. Increase the temperature value.

C. Remove retrieved documents from the prompt.

D. Increase database transaction isolation.


Answer: A

Explanation

This problem is called hallucination.

Reducing hallucination requires:

  • Better grounding.
  • Clear prompt instructions.
  • Restricting responses to retrieved information.

Example:

“Answer only using the provided documents.”


Question 27 (Single Answer)

A developer receives this response from an AI service:

{
"response": {
"text": "Your request was approved."
}
}

Which SQL function should be used to retrieve the nested text value?

A. JSON_VALUE

B. JSON_QUERY

C. OPENXML

D. STRING_SPLIT


Answer: A

Explanation

JSON_VALUE extracts scalar values.

Example:

SELECT JSON_VALUE(
@json,
'$.response.text'
);

Other functions:

  • JSON_QUERY returns JSON objects or arrays.
  • STRING_SPLIT separates text values.
  • OPENXML is an XML function.

Question 28 (Choose THREE)

A company is designing an enterprise RAG application.

Which THREE design considerations should be implemented?

A. Chunk documents into meaningful sections.

B. Generate embeddings using an appropriate model.

C. Store retrieved documents with metadata.

D. Include every document in every prompt.

E. Ignore document updates.

Choose THREE answers.


Answers:

✅ A
✅ B
✅ C

Explanation

High-quality RAG systems require:

Chunking

Improves retrieval precision.

Embeddings

Enable semantic matching.

Metadata

Supports filtering and ranking.

Incorrect:

  • Sending all documents increases cost and reduces relevance.
  • Updated documents require embedding refreshes.

Question 29 (Scenario-Based)

A developer creates an AI-enabled SQL application.

The application sends customer information to an external language model.

The company requires that only necessary information is shared.

What should the developer implement?

A. Data minimization before sending prompts.

B. Disable encryption.

C. Store API keys in application code.

D. Send the entire database schema.


Answer: A

Explanation

Data minimization is a key AI security practice.

The application should:

  • Send only required information.
  • Remove unnecessary sensitive data.
  • Protect customer privacy.

Incorrect:

  • API keys should not be embedded in code.
  • Encryption should not be disabled.
  • Sending unnecessary data increases risk.

Question 30 (Comprehensive Scenario-Based)

A company is building an AI-powered knowledge assistant using Azure SQL Database.

Requirements:

  • Users ask natural language questions.
  • The assistant must answer using company documents.
  • Exact product codes must be searchable.
  • Similar concepts must also be discovered.
  • Documents are updated frequently.
  • The AI model should not require retraining.

Which architecture should be implemented?

A. Traditional relational queries only.

B. Fine-tune the language model every time documents change.

C. RAG using embeddings, hybrid search, and prompt augmentation.

D. Export all company data directly into the language model.


Answer: C

Explanation

The correct architecture is a Retrieval-Augmented Generation (RAG) solution.

The design should include:

Data preparation

  • Split documents into chunks.
  • Generate embeddings.
  • Store vectors.

Search

  • Use vector search for semantic matching.
  • Use keyword search for exact values.
  • Combine results using hybrid search and RRF.

Generation

  • Add retrieved context to prompts.
  • Send grounded prompts to the language model.

Benefits:

✅ Updated information without retraining
✅ Better accuracy
✅ Reduced hallucinations
✅ Supports enterprise search scenarios


Go to the DP-800 Exam Prep Hub main page