Microsoft certification · Exam DP-300

DP-300 Mock Exam

Administering Relational Databases on Microsoft Azure

Find out if you're ready for DP-300. Take the free timed mock exam and get your score in minutes, or study the free DP-300 questions below with answers and explanations.

20 questions · 33 minutes · free, no sign-up

Free DP-300 questions

1–10 of 97 free
Question 1
You need to implement statistics maintenance for SalesSQLDb1. The solution must meet the technical requirements.

Which four actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.

Show answerHide answer

Explanation



Correct Sequence:

Create an Azure Automation account.
This is the foundational service that will host and execute the automation job. You must create this account first to have a container for the runbooks, modules, and schedules.

Import the SqlServer module.
The runbook script will require PowerShell cmdlets to interact with SQL Server (e.g., Invoke-SqlCmd). The SqlServer module must be imported into the Automation account before the runbook that depends on it can be authored or run successfully.

Create a runbook that runs a PowerShell script.
The core maintenance logic (e.g., UPDATE STATISTICS commands) is defined here. You create a PowerShell runbook within the Automation account and author the script that will perform the statistics update on SalesSQLDb1.

Create and configure a schedule.
To meet the requirement for automated, regular execution, you create a schedule (e.g., weekly) within the Automation account. You then link this schedule to the published runbook to trigger it automatically.

Incorrect/Unused Actions:

Create a SQL Server Agent job.
This is an on-premises or SQL Server Managed Instance feature. The use of Azure Automation and runbooks indicates the target is likely Azure SQL Database, which does not have SQL Server Agent. This action is not part of an Azure Automation-based solution.

Publish the runbook.
While a necessary step in real life, the "Create a runbook" action in this context implies the final, editable version. In this high-level sequencing task, creating the runbook encompasses the essential step. "Publish" is often an implied sub-step after creation and before linking to a schedule.

Run sp_add_jobserver.
This is a SQL Server system stored procedure used to target a job to a specific server instance. It is not applicable in an Azure Automation context and is not used with PowerShell runbooks targeting Azure SQL Database.
Question 2
You need to recommend a configuration for ManufacturingSQLDb1 after the migration to Azure. The solution must meet the business requirements.

What should you include in the recommendation? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Show answerHide answer

Explanation



Correct Selections:

Quorum model: Cloud witness
For Azure-based SQL Server VMs in an availability group, the cloud witness is the recommended and most Azure-native quorum solution. It uses an Azure Storage blob as a tie-breaking vote, offering high availability without the management overhead of a file share witness or the infrastructure requirement of a disk witness.

Azure resource for the availability group listener: Azure Internal Load Balancer (Inferred as "Azure Basic Load Balancer" in the list)
An Azure Internal Load Balancer is the standard and required component to direct client connection requests to the current primary replica of an availability group listener in the same virtual network. Azure Application Gateway is an HTTP(S) load balancer for web traffic and is not used for SQL Server availability group listeners.

Incorrect Options:

Quorum model: Disk witness & File share witness
A disk witness requires a shared disk cluster, which is complex in Azure. A file share witness requires a separate, highly available file server (like a Windows Server Failover Cluster file share), adding unnecessary infrastructure and management compared to the simple, resilient cloud witness.

Azure resource for the availability group listener: Azure Application Gateway
Azure Application Gateway is a web traffic load balancer (Layer 7) that manages HTTP/HTTPS requests. It is not designed or capable of handling the direct TCP traffic and probe port requirements of a SQL Server Always On availability group listener.

Reference:
Microsoft Docs - Configure a cloud witness for a Failover Cluster
Question 3
You are planning the migration of the SERVER1 databases. The solution must meet the business requirements.

What should you include in the migration plan? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Show answerHide answer

Explanation



Correct Selections:

Azure Database Migration Service pricing tier: Premium 4-vCore
The Premium tier of DMS is required for online migrations, which minimize downtime. Business requirements often mandate minimal disruption during a cutover. The Standard tier only supports offline migrations, which incur significant downtime. The 4-vCore size provides adequate capacity for migrating multiple databases concurrently from a server like SERVER1.

Required Azure resource: A virtual network that has service endpoints
For DMS to connect to the target Azure SQL Database, the DMS instance must be deployed into an Azure Virtual Network (VNet). Service endpoints, specifically for Microsoft.Sql, are typically configured on this VNet's subnet to allow secure, direct connectivity to the target database service.

Incorrect Options:

Azure Database Migration Service pricing tier: Standard 2-vCore or Standard 4-vCore
The Standard pricing tier only supports offline migrations. This would result in considerable application downtime during the cutover, which is likely unacceptable for business requirements that prioritize minimal disruption.

Required Azure resource: A VPN gateway
A VPN gateway is used for establishing a site-to-site VPN connection between on-premises networks and Azure. DMS primarily uses it for connecting to an on-premises source server. The question's context focuses on the "Required Azure resource," implying the core infrastructure in Azure for the migration to function, which is the VNet for DMS deployment and target connectivity.

Required Azure resource: An Azure Logic app
Azure Logic Apps are for workflow automation and orchestration. They are not a required infrastructure component for the DMS migration process itself. DMS handles the data movement directly.
Question 4
You need to recommend the appropriate purchasing model and deployment option for the 30 new databases. The solution must meet the technical requirements and the business requirements.

What should you recommend? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Show answerHide answer

Explanation



Explanation:
This question focuses on the process of configuring Azure Active Directory (Azure AD) authentication for Azure SQL Database. To enable Azure AD identities to access the database, you must establish an administrative link between the Azure AD tenant and the logical SQL Server. Unlike traditional SQL logins, Azure AD integration relies on a central identity provider, requiring a specific sequence of administrative actions to grant access to individual databases while maintaining security and portability.

Correct Option:

Step 1: Create an Azure AD administrator for the logical server: This is the foundational step. Only an Azure AD admin can provision Azure AD-based users in the database.

Step 2: Connect to the databases by using an Azure AD account: You must authenticate as the Azure AD admin to have the permissions necessary to create subsequent users.

Step 3: Create contained database users: Using the CREATE USER ... FROM EXTERNAL PROVIDER syntax creates users mapped to Azure AD identities without requiring logins in the master database.

Incorrect Option:

Create a user in the master database:
While possible, it is not a requirement for contained database users and adds management overhead for multi-database environments.

Enable the contained database authentication option:
This is a requirement for SQL Server on-premises or in VMs, but it is enabled by default and managed automatically in Azure SQL Database.

Modify the Azure SQL server administrator account:
This refers to the SQL Auth "server admin" created during deployment, which cannot manage Azure AD identities.

Reference:
Microsoft Learn: Configure and manage Azure AD authentication with Azure SQL
Question 5 Choose 1
Which audit log destination should you use to meet the monitoring requirements?
Show answerHide answer

Correct answer: C Azure Log Analytics

Explanation

Explanation:
The monitoring requirements (implied but standard in DP-300) typically include long-term retention of logs for compliance (e.g., 8+ years), the ability to perform complex queries for analysis and alerting, and integration with dashboards. Azure SQL Database auditing can write to multiple destinations, each serving a different primary purpose. The correct choice must support the operational analysis and long-term investigative needs of a monitoring solution.

Correct Option:

C. Azure Log Analytics
Azure Log Analytics is the optimal destination for meeting operational monitoring and compliance requirements. It provides a centralized repository where audit logs can be stored for extended periods (retention configurable up to 2 years by default, with archiving options). Most importantly, it enables powerful querying using Kusto Query Language (KQL) for real-time analysis, custom alert creation, and integration with Azure Workbooks and dashboards.

Incorrect Options:

A. Azure Storage
Azure Storage is a low-cost destination suitable for long-term archival of audit logs, especially when retention requirements exceed what Log Analytics offers. However, it is not designed for interactive analysis or alerting. Querying data in storage is slow and complex, making it poor for day-to-day monitoring and investigations.

B. Azure Event Hubs
Azure Event Hubs is a streaming destination. It is used to pipe audit logs in real-time to third-party Security Information and Event Management (SIEM) tools like Splunk or IBM QRadar, or to custom applications. While excellent for real-time ingestion, Event Hubs itself does not store data for querying or analysis—it's a pass-through mechanism.

Reference:
Microsoft Docs - Analyze audit logs in Azure Monitor logs
Question 6 Choose 1
You have an Azure SQL database named sqldb1.

You need to minimize the possibility of Query Store transitioning to a read-only state.

What should you do?
Show answerHide answer

Correct answer: B Decrease by half the value of Data Flush Interval

Explanation

Explanation:
Query Store can transition to a read-only state primarily when it runs out of allocated storage space (MAX_STORAGE_SIZE_MB) and the cleanup policies cannot free enough space. The Data Flush Interval determines how frequently captured runtime statistics are flushed from memory to disk. A shorter interval flushes data more frequently, preventing large in-memory accumulation that could exceed storage limits during a single flush and helping the cleanup mechanism stay ahead of space usage.

Correct Option:

B. Decrease by half the value of Data Flush Interval
Decreasing the Data Flush Interval (e.g., from the default 15 minutes to 7.5 minutes) means data is persisted to disk more frequently. This reduces the risk of a large, single flush overwhelming the allocated storage quota, giving the cleanup policy (based on SIZE_BASED_CLEANUP_MODE and STALE_QUERY_THRESHOLD_DAYS) more regular opportunities to purge old data and maintain free space, thus minimizing the chance of Query Store becoming read-only.

Incorrect Options:

A. Double the value of Data Flush Interval
Increasing the flush interval means data stays in memory longer before being written to disk. This can lead to larger, less frequent flushes, which increase the risk of suddenly exceeding the storage limit when the flush occurs, making a read-only state more likely.

C. Double the value of Statistics Collection Interval
The Statistics Collection Interval defines how often runtime stats are aggregated (default 60 minutes). Increasing this interval collects data less frequently, which reduces the volume of data entering Query Store. While this could help with space, it also reduces the granularity of performance diagnostics. More importantly, it does not address the core flushing mechanism that directly causes read-only states due to large single writes.

D. Decrease by half the value of Statistics Collection Interval
Decreasing this interval (e.g., to 30 minutes) increases the frequency of data collection, creating more granular but also more data to store. This would increase the data volume and storage pressure, making a read-only state more likely, not less.

Reference:
Microsoft Docs - Best practices with Query Store - Avoid read-only state
Question 7 Choose 2
A data engineer creates a table to store employee information for a new application. All
employee names are in the US English alphabet. All addresses are locations in the United
States. The data engineer uses the following statement to create the table
You need to recommend changes to the data types to reduce storage and improve
performance.
Which two actions should you recommend? Each correct answer presents part of the
solution.
NOTE: Each correct selection is worth one point.
Show answerHide answer

Correct answer: A, E Change Salary to the money data type. Change LastHireDate to the date data t

Explanation

Explanation:
The goal is to change data types to reduce storage and improve performance. This involves selecting the most appropriate and efficient data type for each column's actual data domain. Storage savings lead to better cache utilization and reduced I/O, which directly improves performance.

Correct Options:

A. Change Salary to the money data type.
The Salary column is currently VARCHAR(20), which stores character data. A money or decimal data type is appropriate for currency values. Storing numeric data in a numeric type (like money, which uses 8 bytes) is far more efficient for storage and calculations than storing it as a string. It also ensures data integrity and enables proper numeric operations and indexing.

E. Change LastHireDate to the date data type.
The LastHireDate column is currently DATETIME. If only the date component is needed (without time), changing it to the date data type reduces storage from 8 bytes (for DATETIME) to 3 bytes. This is a significant storage reduction, especially over millions of rows, and improves performance by allowing more rows per data page.

Incorrect Options:

B. Change PhoneNumber to the float data type.
FLOAT is an approximate numeric data type for scientific calculations. It is entirely inappropriate for a phone number, which is a discrete identifier, not a continuous number for calculations. Storing it as FLOAT can lead to loss of precision (e.g., leading zeros lost) and is a poor design practice. A string type (VARCHAR) or a specialized type is better for phone numbers.

C. Change LastHireDate to the datetime2(7) data type.
DATETIME2(7) provides higher precision but uses more storage (8 bytes for 7 fractional seconds precision) than DATETIME. If time precision is not required, this change would increase storage, which is the opposite of the goal. It improves accuracy but not storage efficiency.

D. Change PhoneNumber to the bigint data type.
While BIGINT (8 bytes) could store a numeric phone number and might be slightly more storage-efficient than VARCHAR(20) for purely numeric US numbers, it has significant drawbacks. It cannot store formatting (dashes, parentheses), international prefixes with a plus sign (+), or extensions. More critically, BIGINT cannot store a leading zero in a phone number (e.g., an area code like '012'), causing data loss. VARCHAR is more flexible and safer for phone numbers.

Reference:
Microsoft Docs - Data types (Transact-SQL)
Question 8 Choose 2
You have SQL Server on an Azure virtual machine that contains a database named DB1.
DB1 contains a table
named CustomerPII.
You need to record whenever users query the CustomerPII table.
Which two options should you enable? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
Show answerHide answer

Correct answer: A, C server audit specification database audit specification

Explanation

Explanation:
To record (audit) queries on a specific table (CustomerPII), you must enable SQL Server Audit, which is the overarching feature, and then define what to audit at the appropriate scope. SQL Server Audit operates hierarchically: you first create a Server Audit object (the destination), then a Server Audit Specification for server-level actions, and/or a Database Audit Specification for database-level actions. Auditing data access (like a SELECT on a table) is configured at the database level.

Correct Options:

A. Server audit specification
A Server Audit Specification defines the server-level audit actions to capture and must be attached to a Server Audit object. While auditing SELECT on a table is a database-level action, you still need to have the parent Server Audit feature enabled. The listed option "server audit specification" implicitly represents enabling the Server Audit component itself, which is the foundational container that must exist before any database audit specification can be created and where the audit trail is directed (to a file, Windows Security log, etc.).

C. Database audit specification
A Database Audit Specification is required to capture database-scoped actions, such as SELECT, INSERT, UPDATE, or DELETE on a specific table (CustomerPII). You create this specification within the DB1 database, define the audit action (e.g., SELECT on schema::dbo for object::CustomerPII), and associate it with the existing Server Audit.

Incorrect Options:

B. SQL Server audit
"SQL Server audit" is the overall feature name, not a specific component you "enable" in a list. The implementation requires creating the specific objects: a Server Audit and then a Database Audit Specification. In the context of this multiple-choice question, the correct granular steps are enabling the server-level container (A) and the database-level action spec (C).

D. A server principal
A server principal is a login (e.g., SQL or Windows login). This is unrelated to enabling auditing. While audit specifications can be filtered to specific principals, creating a principal is not a step to enable the recording of queries.

Reference:
Microsoft Docs - SQL Server Audit (Database Engine)
Question 9
You have an Azure SQL database named db1.
You need to retrieve the resource usage of db1 from the last week.
How should you complete the statement? To answer, select the appropriate options in the
answer area.
NOTE: Each correct selection is worth one p
Show answerHide answer

Explanation



Explanation:
To retrieve resource usage history for an Azure SQL Database, you must use the correct system view and filter for the last week. For historical usage over a week, the primary view is sys.resource_stats, which retains data for approximately 14 days and provides aggregated resource consumption (CPU, DTU, storage, etc.) in 5-minute intervals. The filter should compare the start_time column to a date seven days ago.

Correct Selections:
FROM: sys.resource_stats

The sys.resource_stats view contains historical resource usage data for the database, aggregated in 5-minute intervals and retained for about 14 days. It is the correct view for analyzing performance trends over the past week. The other DMVs are either for real-time monitoring (sys.dm_db_resource_stats, sys.dm_exec_requests) or internal governance settings (sys.dm_user_db_resource_governance).

WHERE: start_time >
The filter must be applied to the start_time column, which represents the beginning of each 5-minute aggregation interval in the sys.resource_stats view.

DATEADD(day, -7, GETDATE())
This function calculates the date and time exactly seven days ago from the current moment (GETDATE()). Using DATEADD to subtract 7 days is the correct way to filter for all records where the start_time is within the last week.

Incorrect Options:

FROM:
sys.dm_db_resource_stats: This DMV returns resource consumption for the last hour only, in 15-second intervals. It is for real-time diagnostics, not for retrieving a week's worth of history.

sys.dm_exec_requests: This DMV shows currently executing requests. It does not store historical resource usage data.

sys.dm_user_db_resource_governance: This DMV displays the current resource governance settings (like CPU caps) for the database, not historical usage metrics.

DATEADD/DATEDIFF/DATEPART/TODATETIMEOFFSET:
DATEDIFF: Returns the count of time units between two dates (e.g., DATEDIFF(day, start_time, GETDATE()) <= 7). While it could be used, the syntax in the query (start_time > ...) is structured for DATEADD.

DATEPART: Extracts a specific part (like day, hour) from a date. It is not used for calculating relative dates for filtering.

TODATETIMEOFFSET: Adds a time zone offset to a datetime value. It is irrelevant to calculating a date seven days ago.

Reference:
Microsoft Docs - sys.resource_stats (Azure SQL Database)
Question 10 Choose 1
You have 50 Azure SQL databases.
You need to notify the database owner when the database settings, such as the database
size and pricing tier, are modified in Azure.
What should you do?
Show answerHide answer

Correct answer: D Create an alert rule that uses an Activity Log signal type

Explanation

Explanation:
The requirement is to detect and notify when database settings (size, pricing tier) are changed. These changes are administrative operations performed on the Azure SQL Database resource (e.g., via the Azure portal, ARM templates, or PowerShell). Administrative operations are recorded in the Azure Activity Log (specifically the "Administrative" category), not in database performance metrics.

Correct Option:

D. Create an alert rule that uses an Activity Log signal type.
Azure Monitor allows you to create alert rules based on Activity Log events. You can filter on the resource type (Microsoft.Sql/servers/databases), operation name (e.g., Microsoft.Sql/servers/databases/write for scaling), and status (Succeeded). When a matching event occurs (like a pricing tier change), the alert triggers and can send a notification via email, SMS, or webhook to the database owner.

Incorrect Options:

A. Create a diagnostic setting for the activity log that has the Security log enabled.
Diagnostic settings route logs to destinations like Log Analytics or Storage. Enabling the Security log sends Azure SQL Database SQL Security Audit Logs, which track database-level events (like queries and logins), not Azure resource management operations (like scaling). Furthermore, simply sending logs to a destination does not create a notification; an alert rule is required for that.

B. For the database, create a diagnostic setting that has the InstanceAndAppAdvanced metric enabled.
Diagnostic settings for metrics send performance data (like CPU, DTU) to a destination. The InstanceAndAppAdvanced metric set includes database-level performance counters, not logs of configuration changes. This would not capture administrative operations like changing the pricing tier.

C. Create an alert rule that uses a Metric signal type.
Metric alerts monitor performance metrics (e.g., CPU percentage, storage size) and trigger when a metric value crosses a threshold. They cannot detect a one-time administrative event like a configuration change. You cannot set a metric alert for "pricing tier was modified."

Reference:
Microsoft Docs - Create activity log alerts for Azure service notifications
Full mock exam

Sit the DP-300 exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real DP-300 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full DP-300 mock exam
  • 65questions per mock
  • 105 mintime limit
  • 334questions in the bank
  • Newmock on every attempt
These DP-300 practice questions with explanations help candidates learn how to manage and administer databases on Azure. Topics include database deployment, performance tuning, backup and recovery, and security. Each question includes a detailed explanation that helps learners understand database concepts and administrative tasks more clearly. This approach promotes deeper learning and practical understanding. By practicing consistently, candidates can improve their database management skills, identify weak areas, and confidently prepare for the certification exam.

DP-300 - Administering Relational Databases on Microsoft Azure Official Exam Blueprint and Weight:

1. Plan and Implement Data Platform Resources

Official Exam Weight: 15-20%

Subtopics: Configure Azure SQL Database resources, configure Azure SQL Managed Instance resources, configure SQL Server on Azure Virtual Machines, recommend appropriate database service tiers, configure compute and storage resources, configure networking settings and firewall rules, implement authentication and authorization, configure high availability and disaster recovery options, configure database scalability, deploy database resources using Azure portal PowerShell and Azure CLI, monitor resource utilization and costs, configure elastic pools and serverless compute.

2. Implement a Secure Environment

Official Exam Weight: 15-20%

Subtopics: Manage database authentication and authorization, configure Azure Active Directory authentication, implement role-based access control, configure row-level security, configure dynamic data masking, implement Transparent Data Encryption (TDE), configure Always Encrypted, manage auditing and threat detection, configure Microsoft Defender for SQL, implement data classification and sensitivity labels, manage database permissions, secure network access to database resources, configure firewall rules and virtual networks.

3. Monitor Optimize and Troubleshoot Performance

Official Exam Weight: 40-45%

Subtopics: Monitor database performance using Azure Monitor Query Store and Dynamic Management Views (DMVs), identify and resolve blocking and deadlocks, analyze query execution plans, optimize indexes and statistics, configure intelligent performance recommendations, troubleshoot connectivity issues, monitor resource utilization, identify long-running queries, implement performance tuning strategies, optimize workloads for Azure SQL services, configure automatic tuning, troubleshoot high CPU memory and storage usage, monitor availability and latency metrics, implement maintenance tasks for performance optimization.

4. Optimize Operational Resources

Official Exam Weight: 15-20%

Subtopics: Automate administrative tasks, configure alerts and notifications, implement backup and restore strategies, configure geo-replication and failover groups, manage database imports and exports, perform database migrations using Azure Database Migration Service, automate deployments using ARM templates and Azure DevOps, manage maintenance windows, configure retention policies, monitor and optimize operational costs, implement automation using PowerShell Azure CLI and T-SQL scripts, configure patching and updates, manage resource governance.

5. Plan and Implement a High Availability and Disaster Recovery (HADR) Environment

Official Exam Weight: 10-15%

Subtopics: Configure backup strategies, restore databases to a point in time, implement active geo-replication, configure auto-failover groups, configure Always On availability groups, test disaster recovery procedures, monitor replication health, implement business continuity solutions, configure long-term backup retention, validate recovery objectives including RPO and RTO, troubleshoot HADR issues, automate backup validation and recovery testing.


Domain Title Exam Weight
1 Plan and Implement Data Platform Resources 15-20%
2 Implement a Secure Environment 15-20%
3 Monitor Optimize and Troubleshoot Performance 40-45%
4 Optimize Operational Resources 15-20%
5 Plan and Implement a High Availability and Disaster Recovery (HADR) Environment 10-15%


Customer Love


Database administration preparation improved significantly with MSmcqs practice test for Microsoft Certified: Azure Database Administrator Associate (DP-300). The mock exams covered performance tuning and database security thoroughly.
Chen Hao | China