CertSafari

    Free Microsoft Azure SQL AI Developer Associate (DP-800) Sample Questions

    35 free sample questions from our bank of 352+, covering every exam domain, with answers and detailed explanations. Updated October 2026.

    Domain 1: Design and develop database solutions

    Subdomain 1.1: Design and implement database objects

    1.A data engineering team stores 900 million sales transaction rows in Azure SQL Database. Nightly reports run SUM() and AVG() aggregations that scan most of the table with very few single-row lookups. Which index should the team create on this fact table to best support the workload?

    1. A.Create nonclustered rowstore indexes on every foreign key column
    2. B.Create a clustered columnstore index on the fact table
    3. C.Create a unique constraint on the transaction ID column
    4. D.Create a clustered rowstore index on the transaction date column
    Show answer & explanation

    Correct answer: B — Create a clustered columnstore index on the fact table

    • A. Nonclustered rowstore indexes speed up seeks for small numbers of rows, but they do not help a workload dominated by large aggregations across most of the table, and maintaining many of them adds write overhead.
    • B. Column-by-column storage with segment elimination and batch-mode execution is built for exactly this kind of large-scale scan and aggregation workload, and it delivers far higher compression than rowstore.
    • C. A uniqueness constraint enforces data integrity on one column but provides no benefit for scan-heavy aggregation queries across billions of rows.
    • D. A clustered rowstore index physically orders rows by date, which helps range filtering but still requires row-by-row processing for the wide aggregations described here.

    Subdomain 1.1: Design and implement database objects

    2.Reports frequently filter products by a 'Brand' value nested inside a JSON column, and the query plan shows an expensive full scan of the column on every execution. Which approach improves this filtering performance while keeping the data stored as JSON?

    1. A.Add a computed column using JSON_VALUE on the Brand path and index it
    2. B.Convert the entire JSON column to an nvarchar(max) column with no formatting
    3. C.Wrap every query in a CONVERT function to force an index seek
    4. D.Replace the JSON column with an XML column and use XML indexes instead
    Show answer & explanation

    Correct answer: A — Add a computed column using JSON_VALUE on the Brand path and index it

    • A. Defining a computed column that extracts the Brand value with JSON_VALUE and indexing that computed column lets the optimizer seek directly on Brand instead of scanning the raw JSON text.
    • B. Simply reformatting the storage type does not create any index structure the optimizer can use to avoid scanning every row for the Brand value.
    • C. A CONVERT wrapper does not create an index and typically prevents index usage rather than enabling a seek.
    • D. Switching to XML changes the data model entirely and is unnecessary; JSON data can be indexed efficiently via a computed column without abandoning the JSON format.

    Subdomain 1.1: Design and implement database objects

    3.The native ___ data type stores JSON documents in an internal binary format, improving read and write performance compared to storing the same documents in nvarchar(max).

    1. A.json
    2. B.varchar
    3. C.xml
    Show answer & explanation

    Correct answer: A — json

    • A. The json data type parses and stores documents in an efficient binary form, avoiding repeated text parsing on every read and allowing targeted updates without rewriting the whole document.
    • B. varchar stores JSON as plain text and requires the engine to re-parse the entire string on every access, which is the inefficiency the native type is designed to remove.
    • C. xml is a separate markup format with its own type system and indexing; it is not the type introduced for efficient native JSON storage.

    Subdomain 1.2: Implement programmability objects

    4.A scalar UDF that queries a large lookup table is called from the SELECT list of a query returning two million rows. Performance is far worse than an equivalent inline computation. What is the most likely cause?

    1. A.The scalar function executes once per row, effectively causing row-by-row processing
    2. B.The scalar function forces the outer query to use a table scan instead of an index seek
    3. C.The scalar function's results are cached in tempdb, and tempdb latency is the bottleneck
    4. D.Scalar functions referenced in the SELECT list disable parallelism for the entire server
    Show answer & explanation

    Correct answer: A — The scalar function executes once per row, effectively causing row-by-row processing

    • A. Interpreted scalar UDFs invoked per row create implicit row-by-row execution, much like a cursor, and this per-row overhead dominates runtime across millions of rows.
    • B. The function's presence in the SELECT list does not itself force a scan of the outer query's driving table; the dominant cost is repeated invocation, not access-path selection.
    • C. SQL Server does not automatically cache scalar function results across rows in tempdb, so tempdb caching is not the source of this slowdown.
    • D. Scalar UDF usage can restrict parallelism for the query that calls it, but it does not disable parallelism server-wide for other queries.

    Subdomain 1.2: Implement programmability objects

    5.Views in SQL Server can accept input parameters the same way stored procedures do, allowing a caller to pass a value directly into the view's WHERE clause.

    1. A.True
    2. B.False
    Show answer & explanation

    Correct answer: B — False

    • A. Views cannot declare a parameter list; any filtering must be applied by querying the view with a WHERE clause afterward, not by passing arguments into it.
    • B. This is correct: views have no parameter list, so achieving parameterized filtering requires an outer WHERE clause or switching to an inline table-valued function instead.

    Subdomain 1.2: Implement programmability objects

    6.INSTEAD OF triggers can be defined on both tables and views, while AFTER triggers can only be defined on tables.

    1. A.True
    2. B.False
    Show answer & explanation

    Correct answer: A — True

    • A. This is correct: INSTEAD OF triggers work on both tables and views, whereas AFTER triggers are supported only on tables, not on views.
    • B. This statement accurately reflects SQL Server's trigger placement rules, so marking it false would be incorrect.

    Subdomain 1.3: Write advanced T-SQL code

    7.Scenario: A developer needs to split a comma-separated list stored in a single column into multiple rows, and separately needs to return every regular expression match in a string, not just the first one, as multiple rows. Which two regex functions return a table of rows rather than a single scalar value? (Select all that apply.)(Select 2)

    1. A.REGEXP_SPLIT_TO_TABLE
    2. B.REGEXP_MATCHES
    3. C.REGEXP_LIKE
    4. D.REGEXP_COUNT
    5. E.REGEXP_INSTR
    6. F.REGEXP_REPLACE
    Show answer & explanation

    Correct answers: A, B — REGEXP_SPLIT_TO_TABLE; REGEXP_MATCHES

    • REGEXP_SPLIT_TO_TABLE. This is correct because this function splits an input string into pieces delimited by a regex pattern and returns each piece as a separate row in a table.
    • REGEXP_MATCHES. This is correct because this function returns a table of every captured substring that matches the given pattern, producing one row per match found in the string.
    • REGEXP_LIKE. This is incorrect because this function returns a single scalar boolean value indicating whether a match exists, not a set of rows.
    • REGEXP_COUNT. This is incorrect because this function returns a single scalar integer representing the number of matches, not the matches themselves as rows.
    • REGEXP_INSTR. This is incorrect because this function returns a single scalar integer position of a match, not a table of results.
    • REGEXP_REPLACE. This is incorrect because this function returns a single scalar string with replacements applied, not a set of rows.

    Subdomain 1.3: Write advanced T-SQL code

    8.True or False: A recursive common table expression must contain at least one anchor member and at least one recursive member, combined using UNION ALL, where the recursive member references the CTE name itself.

    1. A.True
    2. B.False
    Show answer & explanation

    Correct answer: A — True

    • True. This is correct because this anchor-plus-recursive-member structure joined by UNION ALL, with the recursive member self-referencing the CTE, is the required shape of a recursive CTE in T-SQL.
    • False. This is incorrect because omitting either the anchor member, the recursive member, or the self-reference to the CTE name would result in an invalid or non-recursive query rather than a working recursive CTE.

    Subdomain 1.3: Write advanced T-SQL code

    9.Scenario: A developer uses a regex count function with the pattern '[0-9]+' to determine how many separate numeric substrings appear in a product description. True or False: This function returns the total number of times the pattern matches within the string, not just whether it matches at least once.

    1. A.True
    2. B.False
    Show answer & explanation

    Correct answer: A — True

    • True. This is correct because this function is defined to return a count of the number of times the given regex pattern occurs within the string, which differs from a boolean existence check.
    • False. This is incorrect because returning a boolean existence flag describes a different function; the count function specifically tallies every occurrence of the pattern.

    Subdomain 1.4: Design and implement SQL solutions by using AI-assisted tools

    10.A developer wants MCP servers to be available across every SSMS session for their Windows user account, configured entirely through a JSON file rather than the Tools panel UI. Which file should they create or edit?

    1. A.%USERPROFILE%\.mcp.json
    2. B.%PROGRAMDATA%\SSMS\mcp-servers.json
    3. C.A project-level mcpconfig.sqlproj file
    4. D.%USERPROFILE%\Documents\SSMS\Settings.xml
    Show answer & explanation

    Correct answer: A — %USERPROFILE%\.mcp.json

    • A. Correct. The .mcp.json file under the user's profile is the global configuration file that makes configured MCP servers available for that user account across sessions.
    • B. Incorrect. There is no ProgramData-based mcp-servers.json file used by SSMS; MCP configuration is read from the user profile's .mcp.json file.
    • C. Incorrect. SQL Database Project files describe database schema for CI/CD, not MCP server configuration, and aren't read by Copilot Chat for this purpose.
    • D. Incorrect. MCP servers are configured in a JSON file, not an XML settings file, and this path isn't the one SSMS watches for MCP configuration.

    Subdomain 1.4: Design and implement SQL solutions by using AI-assisted tools

    11.Which practices reduce the security risk of using AI-assisted tools like GitHub Copilot when writing SQL against production systems? (Select all that apply.)(Select 3)

    1. A.Review AI-generated code before executing it, especially statements that modify or delete data.
    2. B.Grant the MCP server's underlying connection only the least privilege needed for its intended tools.
    3. C.Treat every AI suggestion as inherently safe once the model shows high confidence.
    4. D.Avoid pasting production credentials or sensitive data directly into chat prompts.
    5. E.Disable auditing on databases that Copilot Agent mode can access, to reduce noise.
    6. F.Assume generated T-SQL never needs testing because the model was trained on SQL Server documentation.
    Show answer & explanation

    Correct answers: A, B, D — Review AI-generated code before executing it, especially statements that modify or delete data.; Grant the MCP server's underlying connection only the least privilege needed for its intended tools.; Avoid pasting production credentials or sensitive data directly into chat prompts.

    • A. Correct. Reviewing generated code before execution, particularly data-modifying statements, catches unsafe or incorrect suggestions before they run against real data.
    • B. Correct. Constraining the MCP connection to least privilege limits the damage if the AI issues an unintended or overly broad command.
    • C. Incorrect. Confidence displayed by a model doesn't guarantee correctness or safety, so treating suggestions as automatically safe undermines the other safeguards.
    • D. Correct. Keeping production credentials and sensitive data out of prompts prevents that information from being exposed to or retained by the AI service.
    • E. Incorrect. Turning off auditing removes the record needed to investigate what an AI-assisted session actually did, increasing rather than reducing risk.
    • F. Incorrect. Generated T-SQL still needs the same testing as hand-written code; training data doesn't guarantee correctness for a specific schema or workload.

    Subdomain 1.4: Design and implement SQL solutions by using AI-assisted tools

    12.An enterprise wants Copilot Chat in SSMS to use a language model they've already provisioned in their own Azure OpenAI resource instead of one of the built-in models. What should they do in the model picker?

    1. A.Select Manage Models, then choose Azure as the provider and add the provisioned model.
    2. B.Edit the .mcp.json file to redirect all model chat requests to the Azure OpenAI endpoint.
    3. C.Rename the Azure OpenAI deployment so it matches an existing built-in model name.
    4. D.Enable Ask mode, which automatically discovers any Azure-hosted model on the network.
    Show answer & explanation

    Correct answer: A — Select Manage Models, then choose Azure as the provider and add the provisioned model.

    • A. Correct. The model picker's Manage Models option lets you add a model from a custom provider. Choosing Azure as the provider brings in the model already provisioned in your own Azure OpenAI resource, so Copilot Chat can use it instead of a built-in model.
    • B. Incorrect. The `.mcp.json` file configures MCP servers and the tools they expose to Copilot. It does not control which language model powers Copilot Chat, so it cannot redirect model requests to an Azure OpenAI endpoint.
    • C. Incorrect. Renaming an Azure OpenAI deployment does not register it with Copilot or substitute it for a built-in model. The model must be added explicitly through the Manage Models workflow in the model picker.
    • D. Incorrect. Ask mode is a chat interaction mode and does not perform network discovery of Azure-hosted models. Custom models are added deliberately through Manage Models in the model picker.

    Subdomain 1.2: Implement programmability objects

    13.A developer creates a view that aggregates sales data and wants to guarantee that no one can drop or alter the underlying Sales table's columns in a way that would break the view, without first dropping or altering the view. Which clause should be added to the CREATE VIEW statement?

    1. A.SCHEMABINDING ;
    2. B.WITH CHECK OPTION.
    3. C.WITH ENCRYPTION.
    4. D.WITH RECOMPILE.
    Show answer & explanation

    Correct answer: A — SCHEMABINDING ;

    • A. Correct. `SCHEMABINDING` binds the view to the schema of the objects it references, so the Sales table's referenced columns cannot be dropped or altered in a way that breaks the view unless the view is dropped or altered first. This is exactly the protection the stem asks for, and it requires two-part object names such as `dbo.Sales` in the view definition.
    • B. Incorrect. `WITH CHECK OPTION` makes sure that INSERT and UPDATE statements issued through the view still satisfy the view's WHERE clause. It does not lock the schema of the underlying Sales table, so columns could still be dropped or altered.
    • C. Incorrect. `WITH ENCRYPTION` only obfuscates the view's definition text in system catalog views. It provides no protection against schema changes on the base table, so the view could still break.
    • D. Incorrect. `WITH RECOMPILE` forces plan recompilation and is valid on stored procedures, not on views. It therefore cannot provide the requested schema protection.

    Domain 2: Secure, optimize, and deploy database solutions

    Subdomain 2.1: Implement data security and compliance

    14.An application needs to run LIKE pattern-matching searches and range comparisons directly against an encrypted column, and also wants to re-encrypt that column in place during key rotation without exporting data out of the database. Which capability satisfies both requirements?

    1. A.Always Encrypted with secure enclaves
    2. B.Always Encrypted using randomized encryption only, without enclaves
    3. C.Dynamic Data Masking applied to the same column
    4. D.Row-Level Security applied to the same column
    Show answer & explanation

    Correct answer: A — Always Encrypted with secure enclaves

    • A. Secure enclaves let the database engine process encrypted data inside a protected memory region, enabling pattern matching, richer comparison operators, and in-place encryption or re-encryption without moving data outside the database.
    • B. Randomized encryption without enclaves blocks all computation on the encrypted values, including pattern matching and range comparisons, so this configuration would not support the required searches.
    • C. Dynamic Data Masking only changes what appears in query results for nonprivileged users; it does not encrypt data or enable secure server-side computation on ciphertext.
    • D. Row-Level Security filters which rows a user can see based on identity, but it has no role in enabling computation on encrypted column values.

    Subdomain 2.1: Implement data security and compliance

    15.A security team is designing granular Dynamic Data Masking access for a customer table. Which of the following statements about the DDM permission model are correct? (Select all that apply.)(Select 3)

    1. A.Members of the db_owner role can view unmasked data without any additional grant
    2. B.The UNMASK permission can be granted at the column, table, schema, or database level
    3. C.Masking changes the actual stored data value in the underlying table
    4. D.Combined with Microsoft Entra ID, UNMASK access can be managed for users, groups, and applications
    5. E.Dynamic Data Masking alone guarantees protection against all methods of data exfiltration, including bulk export
    6. F.Dynamic Data Masking requires Always Encrypted to already be configured on the same column
    Show answer & explanation

    Correct answers: A, B, D — Members of the db_owner role can view unmasked data without any additional grant; The UNMASK permission can be granted at the column, table, schema, or database level; Combined with Microsoft Entra ID, UNMASK access can be managed for users, groups, and applications

    • A. Users with administrative rights such as server admin, Microsoft Entra admin, and the db_owner role automatically see original, unmasked data without needing a separate UNMASK grant.
    • B. UNMASK can be granted or revoked at multiple scopes, from a single column up through table, schema, and database level, giving fine-grained control over who bypasses masking.
    • C. Because masking policies operate only on the result set returned by a query, they can be layered on top of Microsoft Entra-managed identities so that unmask access follows the same central identity governance as other Azure services.
    • D. Because masking policies operate only on the result set returned by a query, they can be layered on top of Microsoft Entra-managed identities so that unmask access follows the same central identity governance as other Azure services.
    • E. This is not accurate. Dynamic Data Masking is a result-set obfuscation feature, not a comprehensive data-loss-prevention control, so it must be paired with proper access control and auditing rather than relied on alone.
    • F. This is not accurate. Dynamic Data Masking is independent of Always Encrypted and can be configured on any eligible column without any prior encryption feature being enabled.

    Subdomain 2.1: Implement data security and compliance

    16.A developer forgets to add a permissions block for the Orders entity in dab-config.json. Because Data API builder is secure by default, the entity becomes ____ to all roles.

    1. A.inaccessible
    2. B.fully readable
    3. C.writable but not readable
    Show answer & explanation

    Correct answer: A — inaccessible

    • A. Data API builder denies access by default, so any entity without explicit permissions defined for a role is completely unreachable through the REST or GraphQL endpoints for that role.
    • B. This describes the opposite of Data API builder's secure-by-default design; no read access is granted automatically without an explicit permissions entry.
    • C. This is inaccurate because an entity with no permissions block has no configured actions at all, including no write access, not merely restricted read access.

    Subdomain 2.2: Optimize database performance

    17.A batch job needs to delete 2 million old rows from a heavily used OLTP table during business hours without holding a table-level exclusive lock for an extended period and blocking other transactions. Which approach best addresses this?

    1. A.Delete the rows in small batches using a loop with TOP(n) and a WHERE filter, committing each batch
    2. B.Run the entire DELETE statement in a single transaction with SERIALIZABLE isolation
    3. C.Add a Sch-M schema modification lock hint to the DELETE statement
    4. D.Disable the transaction log for the duration of the delete operation
    Show answer & explanation

    Correct answer: A — Delete the rows in small batches using a loop with TOP(n) and a WHERE filter, committing each batch

    • A. Correct. Breaking a large delete into small, committed batches keeps each transaction's lock footprint small and short-lived, avoiding lock escalation to the table level and minimizing blocking of concurrent OLTP activity.
    • B. Incorrect. Running the full delete as one large SERIALIZABLE transaction increases lock scope and duration, making blocking of concurrent sessions worse, not better.
    • C. Incorrect. A schema modification lock blocks all concurrent access to the table for DDL purposes and is not an appropriate or available hint for reducing blocking during row deletes.
    • D. Incorrect. The transaction log cannot be disabled in Azure SQL Database, and doing so would eliminate crash recovery guarantees rather than address blocking.

    Subdomain 2.2: Optimize database performance

    18.When SQL Server detects a circular lock wait between two transactions, it resolves the situation by choosing one transaction as the ___ and rolling it back with error 1205.

    1. A.deadlock victim
    2. B.head blocker
    3. C.orphaned connection
    Show answer & explanation

    Correct answer: A — deadlock victim

    • A. Correct. The deadlock monitor selects one of the participating transactions as this and terminates it, returning error 1205 to the client so the other transaction can proceed.
    • B. Incorrect. A head blocker is the session at the root of a blocking chain that is not itself waiting on anyone else, a different concept from the transaction chosen to be killed in a deadlock.
    • C. Incorrect. An orphaned connection refers to a client session that disconnected without cleanly releasing its resources, which is unrelated to deadlock victim selection.

    Subdomain 2.3: Implement CI/CD by using SQL Database Projects

    19.A post-deployment script references three separate seed-data files using SQLCMD :r includes. What must be done in the .sqlproj file so the build process does not try to compile those referenced files as schema objects?

    1. A.Add Build Remove and None Include entries for each referenced file
    2. B.Add each referenced file as an additional PostDeploy entry
    3. C.Move each referenced file into the Tables folder so it's treated as data
    4. D.Add a SqlCmdVariable entry for each referenced file path
    Show answer & explanation

    Correct answer: A — Add Build Remove and None Include entries for each referenced file

    • A. Correct. Using Build Remove excludes the referenced file from schema compilation, and None Include keeps it visible in the project as a plain file, which is the documented pattern for files pulled in via :r includes.
    • B. Incorrect. A project supports exactly one PostDeploy entry; the :r include mechanism inside that single script is how multiple seed files are chained, not by declaring each as its own PostDeploy item.
    • C. Incorrect. Folder location has no effect on build compilation behavior; placing a data script in the Tables folder would not stop it from being compiled as a schema object.
    • D. Incorrect. SqlCmdVariable entries define token replacement values used inside scripts; they do not control whether a file is excluded from schema compilation.

    Subdomain 2.3: Implement CI/CD by using SQL Database Projects

    20.A pipeline needs to install SqlPackage as a .NET global tool on a Linux self-hosted runner before it can build and deploy a SQL database project. Complete the command: dotnet tool install --global ____.

    1. A.microsoft.sqlpackage
    2. B.microsoft.dacpacverify
    3. C.microsoft.build.sql
    4. D.azure.sql-action
    Show answer & explanation

    Correct answer: A — microsoft.sqlpackage

    • A. Correct. `dotnet tool install --global microsoft.sqlpackage` is the documented command to install SqlPackage as a cross-platform .NET global tool on Windows, Linux, or macOS.
    • B. Incorrect. microsoft.dacpacverify installs the DacpacVerify tool for comparing two dacpac files, not the SqlPackage deployment tool itself.
    • C. Incorrect. Microsoft.Build.Sql is the NuGet package/SDK referenced inside an SDK-style .sqlproj file for building the project; it is not installed as a global CLI tool via this command.
    • D. Incorrect. azure/sql-action is a GitHub Actions marketplace action referenced in workflow YAML, not a package installed with dotnet tool install.

    Subdomain 2.4: Integrate SQL solutions with Azure services

    21.A catalog API built with Data API builder exposes a Products entity with heavy read traffic and infrequent updates. To reduce database load, the team wants responses served from memory for 30 seconds before a fresh query is made, shared across multiple scaled-out DAB instances. Which entity-level configuration achieves this?

    1. A.cache with enabled true, ttl-seconds 30, and level L1L2
    2. B.cache with enabled true, ttl-seconds 30, and level L1
    3. C.rest with methods restricted to get only
    4. D.graphql with operation set to query
    Show answer & explanation

    Correct answer: A — cache with enabled true, ttl-seconds 30, and level L1L2

    • A. Correct. Setting a 30-second time-to-live with the L1L2 level enables both the in-memory cache and the distributed cache tier, so cached responses are shared consistently across scaled-out DAB instances.
    • B. Incorrect. The L1 level caches only in-memory per instance and is not shared across scaled-out replicas, so different instances could return stale or inconsistent cached results.
    • C. Incorrect. Restricting REST methods controls which HTTP verbs are allowed on the entity but has no effect on response caching or reducing database load.
    • D. Incorrect. Setting the GraphQL operation type only affects whether a stored-procedure entity appears under Query or Mutation in the schema; it does not enable caching.

    Subdomain 2.4: Integrate SQL solutions with Azure services

    22.A company runs Data API builder in a Docker container that must scale out horizontally behind a load balancer. Which deployment target listed in Microsoft's DAB deployment options guide is purpose-built for orchestrating and scaling multiple container replicas?

    1. A.Azure Kubernetes Service
    2. B.Local Docker container on a developer workstation
    3. C.Run from source on a single virtual machine
    4. D.Air-gapped environment with manual installation
    Show answer & explanation

    Correct answer: A — Azure Kubernetes Service

    • A. Correct. Azure Kubernetes Service is the container orchestration platform among DAB's documented deployment options that manages scaling, load balancing, and health of multiple container replicas in production.
    • B. Incorrect. Running a single Docker container locally is intended for development and testing, not for orchestrating scaled-out production replicas behind a load balancer.
    • C. Incorrect. Building and running DAB from source on one machine is a development workflow and provides no built-in orchestration or scaling across replicas.
    • D. Incorrect. Air-gapped deployment addresses installing DAB without internet access; it describes a network constraint, not a scaling or orchestration mechanism.

    Subdomain 2.4: Integrate SQL solutions with Azure services

    23.A monitoring team wants to run KQL queries across DAB request traces, correlate them with other Azure resource logs, and set up long-term retention and alerting rules in a centralized workspace, rather than viewing telemetry only in an application-scoped dashboard. Which Azure Monitor component should the DAB telemetry ultimately be routed to?

    1. A.Log Analytics workspace
    2. B.Application Insights Live Metrics
    3. C.Azure Advisor
    4. D.Azure Policy
    Show answer & explanation

    Correct answer: A — Log Analytics workspace

    • A. Correct. A Log Analytics workspace is the centralized data store where KQL queries can be run across telemetry from multiple resources, with configurable retention and alert rules, making it the right target for cross-resource correlation.
    • B. Incorrect. Live Metrics offers a low-latency, real-time view of current activity for a single Application Insights resource, but it is not designed for long-term retention or cross-resource KQL analysis.
    • C. Incorrect. Azure Advisor provides cost, security, and performance recommendations based on resource configuration; it does not ingest or query application telemetry.
    • D. Incorrect. Azure Policy enforces and audits resource configuration compliance; it has no role in collecting or querying application request telemetry.

    Subdomain 2.2: Optimize database performance

    24.During a performance review, a DBA needs to recommend database configuration changes for an Azure SQL Database experiencing tempdb contention and excessive lock waits from long-running write transactions. Which two configuration recommendations directly address these symptoms? (Select 2)(Select 2)

    1. A.Enable READ_COMMITTED_SNAPSHOT so readers use row versions kept in tempdb instead of shared locks, removing read-write blocking on busy tables.
    2. B.Break large write transactions into smaller batches and commit sooner to shorten lock hold duration and reduce contention on hot rows and pages.
    3. C.Increase the geo-replication read-only replica count so reporting queries move off the primary and reduce write latency during long transactions.
    4. D.Change the collation of all string columns to a case-insensitive collation so comparisons skip case folding and tempdb sort spills are reduced.
    5. E.Disable automatic tuning recommendations so the query optimizer stops adapting plans and forced plan changes no longer add extra tempdb overhead.
    Show answer & explanation

    Correct answers: A, B — Enable READ_COMMITTED_SNAPSHOT so readers use row versions kept in tempdb instead of shared locks, removing read-write blocking on busy tables.; Break large write transactions into smaller batches and commit sooner to shorten lock hold duration and reduce contention on hot rows and pages.

    • A. Correct. With READ_COMMITTED_SNAPSHOT, readers use row versions instead of taking shared locks, so they no longer block behind writers and lock waits drop on busy tables. The version store lives in the database (with accelerated database recovery) or in tempdb, so confirm that the added versioning load fits your capacity.
    • B. Correct. Breaking large writes into smaller batches that commit sooner shortens how long locks are held. That reduces blocking and lock waits on hot rows and pages, and it keeps long transactions from holding resources such as tempdb space and the version store.
    • C. Incorrect. Geo-replicas can offload read-only reporting queries, but they don't change how long write transactions hold locks on the primary. They also do nothing for tempdb contention on the primary, so the lock waits from long writes remain.
    • D. Incorrect. Collation affects how strings are compared and sorted, not how locks are acquired or held. A case-insensitive collation doesn't skip any work, and changing the collation of every column is a disruptive change that doesn't address blocking or tempdb contention.
    • E. Incorrect. Automatic tuning detects regressions and can force the last known good plan, and it doesn't cause the lock waits or tempdb contention described. Disabling it removes a performance safeguard without shortening the write transactions that cause the blocking.

    Subdomain 2.3: Implement CI/CD by using SQL Database Projects

    25.A pipeline currently authenticates to Azure SQL Database using a stored connection string secret containing a SQL login and password. Security wants to eliminate the stored password entirely while still letting the pipeline authenticate to Azure. Which approach removes the password?

    1. A.Configure OpenID Connect with azure/login using a service principal's client ID, tenant ID, and subscription ID as federated credentials.
    2. B.Base64-encode the existing SQL password, store the encoded value as a second repository secret, and decode it in the pipeline step at connect time.
    3. C.Move the plaintext password into a comment in the pipeline YAML file, and have the deploy step parse that comment to build the connection string.
    4. D.Replace the SQL login with a second SQL login that has a shorter password, and keep its connection string in the pipeline's secret store.
    Show answer & explanation

    Correct answer: A — Configure OpenID Connect with azure/login using a service principal's client ID, tenant ID, and subscription ID as federated credentials.

    • A. Correct. With OpenID Connect, `azure/login` exchanges a short-lived token from the pipeline provider for an Azure access token. That exchange relies on a federated credential on the service principal, and the client ID, tenant ID, and subscription ID are only identifiers, not secrets. No password or client secret is stored anywhere, so the stored password is removed.
    • B. Incorrect. Base64 is a reversible encoding, not encryption, so anyone with access to the encoded secret can recover the password immediately. The pipeline still has to decode and use the same SQL password at connect time. The stored password is still there, and the change adds an extra secret to manage.
    • C. Incorrect. Putting the plaintext password in a YAML comment commits it to source control, where everyone with repository access can read it, including through its history. This makes security worse. The password also still exists and is still used to build the connection string, so it is not removed.
    • D. Incorrect. A second SQL login with a shorter password still depends on a stored password in the secret store, so the pipeline authenticates with a password just as before. A shorter password is also weaker, not stronger. Only a passwordless method such as federated credentials removes the password.

    Subdomain 2.4: Integrate SQL solutions with Azure services

    26.In a Data API builder entity configuration, a database column named sku_title must be exposed to API consumers under the friendlier name title, and the underlying id column must be designated as the entity's primary key. Which configuration approach should be used in DAB 2.0?

    1. A.A fields array aliasing sku_title to title and flagging id as key.
    2. B.The deprecated mappings object plus source.key-fields for the key.
    3. C.A relationships object mapping sku_title to a title field and id key.
    4. D.A permissions policy that renames sku_title for the anonymous role.
    Show answer & explanation

    Correct answer: A — A fields array aliasing sku_title to title and flagging id as key.

    • A. Correct. The `fields` array is the unified DAB 2.0 mechanism for describing columns. Each entry can set `alias` to expose `sku_title` as `title` and set `primary-key` to `true` to mark `id` as the key, which replaces the older `mappings` and `key-fields` settings.
    • B. Incorrect. Both `mappings` and `source.key-fields` are deprecated in DAB 2.0. The schema also does not allow them to be combined with the newer `fields` array on the same entity, so this is not the approach to use.
    • C. Incorrect. A `relationships` object defines how one entity links to another entity, for example for GraphQL navigation. It cannot rename a column such as `sku_title` or designate `id` as the primary key.
    • D. Incorrect. A permissions policy controls which fields a role can access, or filters rows with database predicates. It has no way to rename a column for API consumers or to flag a primary key, and it applies to a specific role such as `anonymous` rather than to the entity's shape.

    Domain 3: Implement AI capabilities in database solutions

    Subdomain 3.1: Design and implement models and embeddings

    27.AI_GENERATE_CHUNKS is called with CHUNK_SIZE = 200 and OVERLAP = 25. Approximately how many characters of the preceding chunk are repeated at the start of the next chunk?

    1. A.50 characters
    2. B.25 characters
    3. C.175 characters
    4. D.200 characters
    Show answer & explanation

    Correct answer: A — 50 characters

    • A. Correct. OVERLAP is a percentage applied to CHUNK_SIZE to determine how many characters carry over, and 25 percent of 200 characters is 50 characters.
    • B. This would be the case only if OVERLAP were treated as an absolute character count rather than a percentage of CHUNK_SIZE, which is not how the parameter is defined.
    • C. This value represents the non-overlapping remainder of the chunk, not the portion that is repeated at the start of the next chunk.
    • D. This would mean the entire chunk repeats, which would only happen at 100 percent overlap, not the 25 percent specified here.

    Subdomain 3.1: Design and implement models and embeddings

    28.Change Data Capture (CDC) retains a more complete history of row changes than Change Tracking, which reports only the latest net change per row.

    1. A.True
    2. B.False
    Show answer & explanation

    Correct answer: A — True

    • A. Correct. CDC stores every change to a monitored table in dedicated change tables, preserving full change history, while Change Tracking is lighter-weight and only surfaces the latest net state of changed rows.
    • B. Incorrect. CDC is documented as more comprehensive than Change Tracking precisely because it preserves full change history rather than just the latest net change.

    Subdomain 3.1: Design and implement models and embeddings

    29.To confirm which external models are registered in a database along with their API_FORMAT and MODEL_TYPE, query the ______ catalog view.

    1. A.sys.external_models
    2. B.sys.credentials
    3. C.sys.dm_exec_requests
    Show answer & explanation

    Correct answer: A — sys.external_models

    • A. Correct. This catalog view exposes metadata about registered external model objects, including their configuration, to principals with access to a given model.
    • B. This catalog view lists database scoped credentials used for authentication, not the external model objects or their configured API_FORMAT and MODEL_TYPE.
    • C. This dynamic management view shows currently executing requests on the instance; it has no relationship to reporting on registered external models.

    Subdomain 3.2: Design and implement intelligent search

    30.Which of the following are valid distance metrics that can be specified in the METRIC argument of CREATE VECTOR INDEX or in VECTOR_DISTANCE? (Select all that apply.)(Select 3)

    1. A.cosine
    2. B.euclidean
    3. C.dot
    4. D.manhattan
    5. E.jaccard
    Show answer & explanation

    Correct answers: A, B, C — cosine; euclidean; dot

    • A. Cosine distance measures the angle between two vectors and is a supported metric for both VECTOR_DISTANCE and CREATE VECTOR INDEX.
    • B. Euclidean distance measures straight-line distance between vector endpoints and is one of the officially supported metrics.
    • C. Dot product (returned as a negative value so smaller means closer) is a supported metric used for similarity scoring in these functions.
    • D. Manhattan (L1/taxicab) distance is not one of the metrics exposed by VECTOR_DISTANCE or CREATE VECTOR INDEX in SQL Server or Azure SQL.
    • E. Jaccard similarity is used for comparing sets, not dense numeric embedding vectors, and is not a supported metric for these T-SQL vector functions.

    Subdomain 3.3: Design and implement retrieval-augmented generation (RAG)

    31.A DBA grants a service account the minimum permission needed to run sp_invoke_external_rest_endpoint, without granting broader server-level rights. Which database permission must be granted to that account?

    1. A.EXECUTE ANY EXTERNAL ENDPOINT
    2. B.CONTROL SERVER
    3. C.ALTER ANY CREDENTIAL
    4. D.VIEW SERVER STATE
    Show answer & explanation

    Correct answer: A — EXECUTE ANY EXTERNAL ENDPOINT

    • A. EXECUTE ANY EXTERNAL ENDPOINT is the specific database permission required to run sp_invoke_external_rest_endpoint, matching the principle of least privilege for this scenario.
    • B. CONTROL SERVER grants near-complete server-wide rights and far exceeds what's needed just to invoke a REST endpoint.
    • C. ALTER ANY CREDENTIAL allows managing credential objects but doesn't by itself authorize execution of the REST endpoint procedure.
    • D. VIEW SERVER STATE only allows viewing server state metadata and DMVs; it grants no ability to execute the REST call procedure.

    Subdomain 3.3: Design and implement retrieval-augmented generation (RAG)

    32.Once encoded as UTF-8 for transmission, the payload sent to or received from sp_invoke_external_rest_endpoint must not exceed ___ in size.

    1. A.10 MB
    2. B.100 MB
    3. C.1 GB
    Show answer & explanation

    Correct answer: B — 100 MB

    • A. 10 MB understates the documented limit for the payload size.
    • B. 100 MB is the documented cap on payload size, both sent and received, once UTF-8 encoded for transmission.
    • C. 1 GB overstates the documented limit; payloads of that size would exceed the enforced cap.

    Subdomain 3.2: Design and implement intelligent search

    33.A search engineer benchmarking hybrid search notices that reciprocal rank fusion scores are dominated by whichever list ranks a document higher, even when the other list ranks it far lower. They want to understand the underlying reason. Which explanation is correct?

    1. A.RRF sums reciprocal rank contributions from each list, so a very high rank (small rank number) in either list produces a large 1/(k+rank) term that can dominate the combined score.
    2. B.RRF always weights the vector search list twice as heavily as the full-text search list by design, so a high vector rank outweighs an equally high rank in the full-text search list.
    3. C.RRF discards any document that does not appear in both ranked lists before computing a score, so only documents present in both lists are scored and the top-ranked shared hit dominates.
    4. D.RRF requires normalizing raw distance scores to a 0-1 range before it can be applied at all, so the list with larger unnormalized score magnitudes ends up dominating the fused ranking.
    Show answer & explanation

    Correct answer: A — RRF sums reciprocal rank contributions from each list, so a very high rank (small rank number) in either list produces a large 1/(k+rank) term that can dominate the combined score.

    • A. Correct. RRF sums a `1/(k+rank)` term from each list, so a document ranked near the top (a small rank number) in either list gets a large reciprocal term. That term can dominate the fused score even when the other list ranks the document much lower.
    • B. Incorrect. RRF does not build in a fixed 2x weight for vector search over full-text search. The formula treats each list's rank contribution the same way unless you deliberately add custom weights. An equally high rank in either list therefore contributes equally.
    • C. Incorrect. RRF does not discard documents that appear in only one list. A fusion query typically uses a full outer join with `COALESCE` and a zero default, so a document present in just one list still gets a partial score from that list. Dominance by a high rank therefore doesn't depend on a document being in both lists.
    • D. Incorrect. RRF works on rank positions, not raw distance or relevance scores, so it needs no 0-1 normalization. Avoiding normalization across dissimilar full-text and vector scoring scales is its main advantage. Score magnitudes therefore can't be what causes one list to dominate.

    Subdomain 3.2: Design and implement intelligent search

    34.A database has a table with only 40 rows containing non-NULL vector values, and a developer attempts to run CREATE VECTOR INDEX on the vector column. What is the expected outcome?

    1. A.The statement fails because a vector index requires at least 100 rows with non-NULL vectors to build.
    2. B.The statement succeeds immediately and builds the vector index using only the 40 available non-NULL rows.
    3. C.The statement succeeds but automatically pads the table with 60 zero-vector placeholder rows to reach the minimum.
    4. D.The statement succeeds but silently falls back to creating a full-text index on the column instead.
    Show answer & explanation

    Correct answer: A — The statement fails because a vector index requires at least 100 rows with non-NULL vectors to build.

    • A. Correct. `CREATE VECTOR INDEX` requires at least 100 rows with non-NULL vector values in the column. With only 40 qualifying rows, the statement fails with an explicit error instead of building an index.
    • B. Incorrect. The engine does not build a vector index from fewer rows than the minimum. It enforces the 100-row requirement and returns an error, so the statement does not succeed with the 40 available rows.
    • C. Incorrect. SQL Server never inserts placeholder or synthetic zero-vector rows to meet the minimum row requirement. The developer must supply enough real rows with non-NULL vector data before the index can be created.
    • D. Incorrect. `CREATE VECTOR INDEX` and full-text indexing are unrelated features. No fallback substitutes a full-text index when the row minimum isn't met, and the statement fails instead of succeeding silently.

    Subdomain 3.3: Design and implement retrieval-augmented generation (RAG)

    35.A team is evaluating whether several proposed scenarios are good fits for a retrieval-augmented generation (RAG) pattern built on Azure SQL Database and a language model. Which of the following are appropriate RAG use cases? (Select all that apply.)(Select 3)

    1. A.Answering support questions by grounding responses in product documentation stored in SQL tables.
    2. B.Summarizing a customer's recent order history from a transactional table for a support chatbot.
    3. C.Training a new foundation language model from scratch using the company's sales history.
    4. D.Grounding chatbot answers in an internal knowledge base without retraining the underlying model.
    5. E.Applying Always Encrypted to protect sensitive columns from unauthorized viewing by DBAs.
    6. F.Replacing all OLTP indexing strategies with vector search for a high-write transactional workload.
    Show answer & explanation

    Correct answers: A, B, D — Answering support questions by grounding responses in product documentation stored in SQL tables.; Summarizing a customer's recent order history from a transactional table for a support chatbot.; Grounding chatbot answers in an internal knowledge base without retraining the underlying model.

    • A. Correct. Answering support questions from product documentation stored in SQL tables is a classic RAG scenario. Relevant passages are retrieved at query time and passed to the model as context, so its answers are grounded in your own content.
    • B. Correct. Retrieving a customer's recent orders from a transactional table and passing them to the model as context is a valid RAG use case. It combines current data from the database with the model's language ability to produce an accurate summary for the support conversation.
    • C. Incorrect. Training a new foundation model from scratch is a separate and far more expensive undertaking than RAG. RAG reuses an existing pretrained model and supplies retrieved data as context at query time, so it involves no model training.
    • D. Correct. Grounding chatbot answers in an internal knowledge base without retraining the model is the core value of RAG. The model draws on current, proprietary data supplied at query time, with no fine-tuning step needed.
    • E. Incorrect. Always Encrypted is a security feature that protects the confidentiality of sensitive columns, including from DBAs. It does not retrieve data or ground model responses, so it is not a RAG use case.
    • F. Incorrect. Replacing all OLTP indexing strategies with vector search for a high-write transactional workload is a database design choice, not a RAG use case. Vector search complements traditional indexes for similarity retrieval and does not replace them for transactional access patterns.

    Want the full experience?

    These are just samples. Practice the full Microsoft Azure SQL AI Developer Associate (DP-800) question bank in quiz mode — free, no signup, with domain practice and exam simulation.