Courseiva

CCNA Identify Considerations For Relational Data On Azure Questions

75 of 188 questions · Page 1/3 · Identify Considerations For Relational Data On Azure topic · Answers revealed

1
MCQeasy

A company needs to ensure that their Azure SQL Database is accessible only from a specific virtual network and deny access from public endpoints. Which feature should they configure?

A.Disable public network access
B.Virtual network service endpoints and firewall rules
C.IP firewall rules
D.Azure Private Link
AnswerB

Configure Azure SQL Database firewall to allow connections from a specific virtual network subnet by enabling a service endpoint for Microsoft.Sql on that subnet and adding a virtual network firewall rule. This extends the SQL database's public endpoint to accept traffic from that subnet only, while all other public internet traffic is blocked by default firewall rules. This pairs network-level isolation with firewall rules to restrict access to designated VNets without needing private IPs.

Why this answer

Virtual network service endpoints and firewall rules allow restricting access to a specific VNet while denying public access. Option A is incorrect because disabling public network access alone does not tie to a specific VNet; it would block all access unless combined with Private Link. Option C is incorrect because IP firewall rules allow access from specific public IP addresses, not from a VNet.

Option D is incorrect because Azure Private Link provides private connectivity but does not deny public access by itself; it requires additional configuration to block public endpoints.

2
MCQmedium

A company has an on-premises SQL Server database with a 1 TB 'Sales' table containing historical data. They want to move this table to Azure SQL Database with minimal downtime. The table is actively written to during business hours. Which approach should they use?

A.Use Azure Data Migration Service with continuous sync from on-premises to Azure SQL Database, then cut over
B.Use the Azure SQL Database migration wizard to perform an offline migration over the weekend
C.Export the table as a .bacpac file and import it into Azure SQL Database during off-hours
D.Use SQL Server Management Studio's 'Deploy Database to Azure SQL Database' wizard
AnswerA

Azure Database Migration Service with continuous sync is the correct online method because it reads the source transaction log and continuously applies those changes to the target Azure SQL Database, all while the on-premises database remains online and fully operational. The migration can run for days to sync historical data without blocking active workloads, and only the final cutover step—stopping the source and pointing the application to the target—requires a brief downtime window measured in minutes. Unlike offline approaches, this preserves continuity for a 1 TB database and provides validation and rollback capability during the migration.

Why this answer

Azure Data Migration Service (DMS) with continuous sync is the correct approach because it supports online migration with minimal downtime. It uses transactional replication to keep the on-premises SQL Server database synchronized with Azure SQL Database while the source remains fully operational, allowing a controlled cutover with only seconds of downtime.

Exam trap

The trap here is that candidates often assume offline methods (bacpac, wizard) are sufficient for large tables, underestimating the downtime required for a 1 TB dataset, and fail to recognize that 'minimal downtime' explicitly requires an online migration with continuous sync.

Why the other options are wrong

B

This option is wrong because the question requires minimal downtime, and an offline migration over the weekend still involves downtime during the migration window. The table is actively written to during business hours, so even weekend migration may not be acceptable if the business operates beyond weekdays or requires near-zero downtime.

C

Exporting a 1 TB table as a .bacpac and importing it is an offline operation that requires the table to be idle, but the table is actively written to during business hours, causing data inconsistency and unacceptable downtime.

D

The 'Deploy Database to Azure SQL Database' wizard in SSMS performs an offline migration, which would cause significant downtime for the actively written Sales table. It does not support continuous sync to minimize downtime.

3
MCQmedium

A logistics company uses Azure SQL Database to store millions of shipment records. The table has columns: ShipmentID (primary key), CustomerID, ShipDate, and Destination. Queries frequently filter by CustomerID and ShipDate to retrieve shipments for a specific customer over a date range. Which indexing strategy will most improve query performance?

A.Create a nonclustered index on CustomerID and ShipDate
B.Create a clustered index on ShipmentID
C.Partition the table by ShipmentID
D.Create a full-text index on Destination
AnswerA

This composite index covers both filter columns, enabling efficient seek operations for the WHERE clause conditions.

Why this answer

A nonclustered index on CustomerID and ShipDate is the best choice because it directly supports the frequent query pattern filtering by both columns. This composite index allows SQL Database to perform an index seek rather than a full table scan, drastically reducing I/O for selective queries over millions of rows.

Exam trap

The trap here is that candidates often assume a clustered index on the primary key is always optimal, but for queries that filter on non-key columns, a covering nonclustered index is far more effective.

Why the other options are wrong

B

A clustered index on ShipmentID (the primary key) is already the default, but queries filter by CustomerID and ShipDate, not ShipmentID. This index does not support the filtering columns, so it won't improve performance for the specified queries.

C

Partitioning by ShipmentID does not help queries filtering by CustomerID and ShipDate because the partition key is not used in the WHERE clause, so all partitions must be scanned.

D

A full-text index on Destination is designed for text search (e.g., finding words or phrases in a string), not for filtering on exact values like CustomerID and ShipDate. It does not support range queries or equality filters efficiently, so it won't improve performance for the described queries.

4
MCQeasy

A developer is designing a new application that requires a relational database. The database must support complex queries and stored procedures. Which Azure data service should they choose?

A.Azure SQL Database
B.Azure Table Storage
C.Azure Cosmos DB
D.Azure Blob Storage
AnswerA

Azure SQL Database is a fully managed relational database service that supports schema enforcement, primary and foreign keys, T-SQL queries, stored procedures, and ACID transactions. For an application that requires relational storage, it gives direct support for complex joins, indexed views, and fine-grained permissions out of the box.

Why this answer

Azure SQL Database, is the correct choice because it is a fully managed relational database service that supports complex queries (e.g., joins, subqueries) and stored procedures, which are essential for the described application. Option B (Azure Table Storage) is a NoSQL key-value store and does not support relational queries or stored procedures. Option C (Azure Cosmos DB) is a NoSQL database that, while it can support some query capabilities, is not designed for complex relational queries and stored procedures.

Option D (Azure Blob Storage) is object storage for unstructured data and lacks relational features.

5
MCQeasy

A startup is migrating its on-premises SQL Server database to Azure. They want the least administrative overhead for patching and backups. Which Azure data service should they choose?

A.Azure Database for PostgreSQL
B.SQL Server on Azure Virtual Machines
C.Azure SQL Database
D.Azure Cosmos DB
AnswerC

Azure SQL Database is a fully managed relational database service built on the SQL Server engine, offering near-total compatibility with on-premises SQL Server databases via the Data Migration Assistant and Database Migration Service. It automates patching, backups, point-in-time restore, and provides built-in high availability with a 99.99% SLA, plus intelligent features like automatic performance tuning and threat detection. This makes it the most appropriate choice for a startup wanting to offload maintenance while keeping a relational SQL Server model.

Why this answer

Azure SQL Database is a fully managed platform-as-a-service (PaaS) that automates patching, backups, and high availability. Option A is wrong because Azure Database for PostgreSQL is a different database engine, not SQL Server. Option B is wrong because SQL Server on Azure Virtual Machines (IaaS) requires manual patching and backup management.

Option D is wrong because Azure Cosmos DB is a NoSQL database, not relational.

6
MCQhard

A database administrator manages an Azure SQL Database with a table that has a clustered index on OrderID. Frequent queries filter on OrderDate and then sort the results by CustomerID. These queries perform poorly. Which indexing strategy will most improve performance for these specific queries?

A.Create a nonclustered index on (OrderDate, CustomerID)
B.Create a nonclustered index on (CustomerID, OrderDate)
C.Change the clustered index to (OrderDate)
D.Create a filtered index on OrderDate WHERE CustomerID IS NOT NULL
AnswerA

A composite nonclustered index on (OrderDate, CustomerID) is ideal for a query filtering on OrderDate and ordering by CustomerID. SQL Server can perform an index seek on the leading OrderDate column to isolate the matching rows, and because CustomerID is the second key column, the rows are already returned in the required sort order—eliminating the need for a separate SORT operator and reducing query cost significantly.

Why this answer

The query filters on OrderDate and then sorts by CustomerID. A nonclustered index on (OrderDate, CustomerID) supports both the WHERE clause (by OrderDate) and the ORDER BY clause (by CustomerID) as a covering index, allowing the database engine to perform a single index seek or scan without needing a separate sort operation. This directly addresses the performance bottleneck by eliminating the need to sort the results after filtering.

Exam trap

The trap here is that candidates often think a filtered index or changing the clustered index is the best solution, but they overlook that the query requires both filtering and sorting on different columns, and the leading key in a composite index must match the filter column to support both operations efficiently.

How to eliminate wrong answers

Option B is wrong because the index on (CustomerID, OrderDate) does not support the filter on OrderDate as the leading key; the query would require a full index scan or a separate sort, as the filter on OrderDate cannot use the index efficiently. Option C is wrong because changing the clustered index to OrderDate would reorder the entire table physically, which could improve range scans on OrderDate but would not directly optimize the sort by CustomerID; the query still needs to sort results by CustomerID, and the clustered index order does not help with that sort. Option D is wrong because a filtered index on OrderDate WHERE CustomerID IS NOT NULL does not include CustomerID as a key column, so it cannot help with the ORDER BY CustomerID clause; it also restricts the index to rows where CustomerID is not null, which may not cover all queries.

7
MCQeasy

A company is designing a new application that will store customer orders in a relational database on Azure. The data includes order IDs, customer IDs, product IDs, quantities, and order dates. The application needs to support complex queries that join multiple tables and enforce referential integrity. Which Azure service should the company use?

A.Azure SQL Database
B.Azure Table Storage
C.Azure Cosmos DB
D.Azure Blob Storage
AnswerA

Azure SQL Database is a fully managed relational database engine that provides complete T-SQL support, including table joins with various join types, primary/foreign key enforcement, check constraints, and ACID transactions. This makes it the only option in the list that natively supports the referential integrity and complex relational queries expected when designing an application that stores customer data across normalized tables. It also offers built-in high availability, automated backups, and scaling options, so it aligns with both the relational data model and operational requirements.

Why this answer

Azure SQL Database is the correct choice because it is a fully managed relational database service that supports complex queries with JOINs and enforces referential integrity. In contrast, Azure Cosmos DB is a NoSQL database, Azure Table Storage is a key-value store, and Azure Blob Storage is for unstructured data, none of which are suitable for relational requirements.

8
MCQmedium

A company has a table named 'Sales' in Azure SQL Database with columns: SaleID (int, primary key), ProductID (int), SaleDate (datetime), Quantity (int), UnitPrice (decimal), TotalAmount (computed column). Queries frequently run to retrieve the total Quantity and UnitPrice for a specific ProductID over a date range. The query filters on ProductID and SaleDate and selects only Quantity and UnitPrice. Which index would most improve query performance?

A.Nonclustered index on (ProductID, SaleDate) INCLUDE (Quantity, UnitPrice)
B.Nonclustered index on (SaleDate) INCLUDE (Quantity, UnitPrice)
C.Clustered index on (ProductID, SaleDate)
D.Nonclustered index on (ProductID) INCLUDE (Quantity, UnitPrice)
AnswerA

This covering index includes all columns needed by the query (Quantity, UnitPrice) as included columns, and the key columns (ProductID, SaleDate) support efficient filtering. The query can be satisfied entirely from the index without key lookups.

Why this answer

It creates a covering nonclustered index that supports both the WHERE clause (ProductID, SaleDate) and the SELECT clause (Quantity, UnitPrice) without needing to access the base table. The index key order matches the query filter, and the included columns avoid key lookups, minimizing I/O for the frequent aggregation queries.

Exam trap

The trap here is that candidates often think a clustered index on the filter columns is always best, but they overlook that a nonclustered index with included columns can provide a covering index that avoids costly key lookups, especially when the SELECT list is a subset of columns.

Why the other options are wrong

B

This index does not include ProductID as the leading key, so queries filtering on both ProductID and SaleDate cannot seek on ProductID first; they may scan or seek on SaleDate only, missing the optimal key order for the query's filter.

C

A clustered index on (ProductID, SaleDate) would physically order the table by those columns, but the query selects only Quantity and UnitPrice, which are not included in the index key. This forces key lookups to retrieve those columns, reducing performance compared to a covering nonclustered index.

D

This index does not include SaleDate, so it cannot efficiently support the date range filter. The query would still need to scan all rows for the given ProductID to find those within the date range.

9
MCQmedium

A company uses Azure SQL Database for an order management system. The Orders table has columns: OrderID (int, primary key), CustomerID (int), OrderDate (datetime), Status (varchar), TotalAmount (decimal). Queries frequently filter on CustomerID and OrderDate to find orders from a specific customer within a date range. Which index would most improve performance for these queries?

A.A clustered index on OrderID
B.A non-clustered index on Status
C.A non-clustered index on (CustomerID, OrderDate) INCLUDE (TotalAmount)
D.A non-clustered index on (OrderDate, TotalAmount)
AnswerC

This composite non-clustered index is optimal because CustomerID is the leftmost key column, enabling a seek on CustomerID and then matching the OrderDate range or equality, while TotalAmount is stored as a non-key included column. That makes the index covering for this query, meaning all required data is present in the index pages and no round-trip to the clustered base table is needed, thereby minimizing logical reads and I/O.

Why this answer

The query filters on CustomerID and OrderDate, so a composite non-clustered index on (CustomerID, OrderDate) allows SQL Server to perform an index seek on both columns, drastically reducing the number of rows scanned. Including TotalAmount as a non-key column makes this a covering index, meaning all needed data (including TotalAmount) is in the index leaf pages, avoiding costly key lookups to the clustered index.

Exam trap

The trap here is that candidates often pick an index starting with OrderDate (Option D) because they think date-range filtering is the primary need, forgetting that the equality filter on CustomerID must be the leading column for an efficient seek.

Why the other options are wrong

A

A clustered index on OrderID is already the primary key, so it exists by default. The query filters on CustomerID and OrderDate, not OrderID, so this index does not help with those filters.

D

The index on (OrderDate, TotalAmount) does not include CustomerID, which is a primary filter in the queries. Without CustomerID as a leading key, the index cannot efficiently narrow down rows for a specific customer, leading to scans rather than seeks.

10
MCQmedium

A business analyst needs to query a large Azure SQL Database table that stores sales transactions. The table contains over 100 million rows. The analyst wants to retrieve aggregated sales per product category for the current month. The current query performs a full table scan and takes several minutes. Which indexing strategy will best improve the performance of this aggregation query?

A.Create a clustered index on the transaction date column
B.Create a nonclustered index on the product category column
C.Create a columnstore index on the table
D.Create a filtered index on transactions from the current month
AnswerC

A columnstore index stores each column as a separate, compressed segment and enables SQL Server to read only the columns needed for the query (e.g., amount, category, date) rather than whole rows. It uses batch-mode processing, where the engine processes data in large batches with vectorized operators, dramatically accelerating SUM and GROUP BY over large tables. For a large Azure SQL Database table used in analytical queries, a clustered columnstore index is purpose-built for this exact scenario and requires no query rewrites.

Why this answer

A columnstore index stores data column-wise and uses batch processing, which dramatically accelerates aggregation queries (like SUM, COUNT, GROUP BY) over large tables. For a 100-million-row table, this reduces I/O and CPU by reading only the columns needed for the aggregation, making it the optimal choice for the analyst's current-month sales-per-category query.

Exam trap

The trap here is that candidates often choose a filtered or nonclustered index thinking they will reduce the scan scope, but they overlook that columnstore indexes are specifically designed for high-performance analytical aggregations on large tables, not just for filtering or single-column lookups.

How to eliminate wrong answers

Option A is wrong because a clustered index on transaction date would only speed up range scans or point lookups on that column, not aggregations by product category; the query would still need to scan all rows or perform a costly key lookup. Option B is wrong because a nonclustered index on product category would help with equality or range searches on that column, but for a full-table aggregation with GROUP BY, it would still require a full index scan and does not provide the columnar compression and batch processing benefits needed. Option D is wrong because a filtered index on transactions from the current month would only cover a subset of rows, but the query already filters to the current month; the real performance bottleneck is the aggregation over millions of rows, which a filtered index does not address as effectively as a columnstore index.

11
MCQmedium

Refer to the exhibit. An Azure Policy is defined as shown. A database administrator attempts to create an Azure SQL Database without enabling zone redundancy. What will happen?

A.The database will be created and an audit event will be logged
B.The database creation will be denied
C.The database will be created and zone redundancy will be automatically enabled
D.The database will be created with zone redundancy disabled
AnswerB

This is correct because the policy rule uses a deny effect with a condition that compares the 'zoneRedundant' property to the literal value false. When a user attempts to create a SQL Database with zoneRedundant set to false, the condition evaluates true, causing Azure Resource Manager to block the deployment before the resource provider provisions anything. The request fails with an error indicating the resource was disallowed by policy, so the database is never created. This is the intended behavior of a deny policy.

Why this answer

The policy has an effect of 'deny', so any attempt to create an Azure SQL Database without zone redundancy will be denied. Option B is correct because the policy explicitly denies the creation. Option A is incorrect because the effect is deny, not audit.

Option C is incorrect because the policy denies creation rather than enabling zone redundancy automatically. Option D is incorrect because the policy denies the creation entirely, it does not allow creation with zone redundancy disabled.

12
MCQmedium

An e-commerce company has 20 SQL Server databases that each range from 10 GB to 50 GB and experience unpredictable usage patterns with occasional spikes in user activity. The company wants to migrate to Azure SQL Database to reduce management overhead and minimize costs by allowing databases to share resources. Which Azure SQL Database deployment option should they choose?

A.A: Single database with provisioned throughput
B.B: Elastic pool
C.C: Managed Instance
D.D: SQL Server on Azure VM
AnswerB

An elastic pool allocates a shared set of vCores/eDTUs to multiple Azure SQL databases that reside on the same logical server. Databases can consume extra resources as needed up to a configured per-database cap, while idle databases automatically release unused capacity back to the pool. This shared capacity model is ideal for 20 databases with unpredictable usage because you pay for the aggregate demand of the pool rather than the sum of each database's individual peak, dramatically reducing cost.

Why this answer

Elastic pools allow multiple SQL databases to share a fixed set of resources (eDTUs or vCores), which is ideal for databases with unpredictable usage patterns and occasional spikes. By pooling resources, the company can reduce management overhead and minimize costs compared to provisioning each database individually, as the pool's total resources are shared among all databases, smoothing out peak demands.

Exam trap

The trap here is that candidates may confuse 'reducing management overhead' with choosing a fully managed option like Managed Instance, but fail to recognize that the key requirement is 'sharing resources to minimize costs,' which is uniquely addressed by elastic pools, not by single databases or instance-level offerings.

Why the other options are wrong

A

Single database with provisioned throughput does not allow databases to share resources or minimize costs for unpredictable, spiky workloads across multiple databases. Each database is isolated with dedicated resources, leading to over-provisioning and higher costs.

C

Azure SQL Managed Instance is designed for lift-and-shift migrations requiring near 100% compatibility with on-premises SQL Server, but it does not support resource sharing across multiple databases via elastic pools, so it would not minimize costs for unpredictable, shared workloads.

D

SQL Server on Azure VM requires manual management of the OS and SQL Server, including patching and backups, which does not reduce management overhead. It also cannot share resources across databases to minimize costs like an elastic pool.

13
MCQeasy

A small online retailer wants to migrate its single on-premises SQL Server database to Azure. They require a fully managed relational database service with built-in high availability, automated backups, and no need to manage virtual machines. They do not need features like multiple databases with cross-database queries or SQL Agent. Which Azure service should they choose?

A.Azure SQL Database
B.Azure SQL Managed Instance
C.SQL Server on Azure Virtual Machines
D.Azure Database for MySQL
AnswerA

Azure SQL Database is a fully managed Platform-as-a-Service offering that provides built-in high availability, automated backups, and automatic patching, eliminating all VM and OS management. For migrating a single on-premises SQL Server database, it delivers the needed storage, indexing, and query capabilities without the overhead of maintaining infrastructure, making it the simplest, most cost-effective PaaS choice.

Why this answer

Azure SQL Database is a fully managed Platform-as-a-Service (PaaS) relational database that provides built-in high availability (99.99% SLA with zone-redundant configuration), automated backups with point-in-time restore, and eliminates the need to manage virtual machines or operating system patches. It is the ideal choice for a single database migration when features like cross-database queries and SQL Agent are not required.

Exam trap

The trap here is that candidates often choose Azure SQL Managed Instance because it offers more SQL Server parity, but the question explicitly states the retailer does not need SQL Agent or cross-database queries, making the simpler and more cost-effective Azure SQL Database the correct choice.

How to eliminate wrong answers

Option B (Azure SQL Managed Instance) is wrong because it includes SQL Agent and cross-database query capabilities, which the retailer explicitly does not need, and it still requires managing a virtual network and instance-level configuration, adding unnecessary complexity. Option C (SQL Server on Azure Virtual Machines) is wrong because it is an Infrastructure-as-a-Service (IaaS) offering that requires the customer to manage the VM, apply OS and SQL Server patches, and configure high availability manually, contradicting the requirement for a fully managed service with no VM management. Option D (Azure Database for MySQL) is wrong because it is a different database engine (MySQL) and not a direct migration path for an existing SQL Server database; it would require schema and query changes, and it does not support SQL Server-specific features like T-SQL or CLR integration.

14
MCQhard

A financial services company runs a critical application on Azure SQL Managed Instance. They need to ensure that a recent transaction can be recovered within 15 minutes of a user error. Which feature should they configure?

A.Geo-restore
B.Point-in-time restore (PITR)
C.Automatic failover groups
D.Long-term retention (LTR)
AnswerB

Point-in-time restore (PITR) is the correct solution because it recreates a database to any specific second within the automated backup retention period (default 7 days, up to 35 days for vCore) by replaying transaction logs over a full backup. This lets you roll back an accidental table drop, erroneous UPDATE, or malformed migration without affecting the current production database — the restore creates a new database at the chosen timestamp. It directly addresses the logical error scenario described.

Why this answer

Point-in-time restore (PITR) is the correct feature because it allows you to restore an Azure SQL Managed Instance to a specific point in time within the retention period (default 7 days, configurable up to 35 days). This directly addresses the requirement to recover a recent transaction after a user error, such as an accidental data modification or deletion, within 15 minutes. PITR creates a new database from automated backups, enabling precise recovery to the moment just before the error occurred.

Exam trap

The trap here is that candidates confuse disaster recovery features (Geo-restore, failover groups) with data recovery features (PITR), assuming any backup-related option can recover from a user error, but only PITR provides the granular, time-specific restore needed for transactional errors.

How to eliminate wrong answers

Option A (Geo-restore) is wrong because it restores a database from geo-replicated backups to a different Azure region, which is designed for disaster recovery (e.g., regional outage), not for recovering from a user error within 15 minutes. Option C (Automatic failover groups) is wrong because it manages high availability and failover of a managed instance to a secondary region, not point-in-time recovery of a specific transaction. Option D (Long-term retention) is wrong because it retains backups for up to 10 years for compliance or archival purposes, not for quick recovery of recent user errors within minutes.

15
MCQhard

A company uses the above ARM template snippet to deploy an Azure SQL Database. The deployment fails with an error about invalid SKU. What is the most likely cause?

A.The SKU name 'GP_Gen5_2' is not valid for the 'GeneralPurpose' tier
B.The 'tier' property should be 'Standard' instead of 'GeneralPurpose'
C.The location 'eastus' does not support GeneralPurpose tier
D.The capacity value must be a multiple of 4
AnswerD

Incorrect because GeneralPurpose vCore capacity does not have to be a multiple of 4; 2 vCores is valid.

Why this answer

The deployment would not fail because of a capacity multiple requirement. 'GP_Gen5_2' is a valid vCore SKU for the GeneralPurpose tier with 2 vCores, and Azure SQL Database supports 2 vCores in the GeneralPurpose tier. Therefore none of the listed options is correct; the question is invalid as written.

Exam trap

Candidates often assume there is always a listed correct answer, but if the premise is factually incorrect, no option may be valid.

16
MCQmedium

A company is migrating an on-premises SQL Server database to Azure SQL Database. The database currently uses SQL Server Agent jobs for nightly ETL processes. Which Azure service should the company use to replace these jobs?

A.Azure Automation
B.Azure Logic Apps
C.Elastic Database Jobs
D.Azure Data Factory
AnswerC

Elastic Database Jobs is the native Azure SQL Database service for scheduling T-SQL scripts and stored procedures across one or many databases, directly replacing the SQL Server Agent functionality that is absent in Azure SQL Database. It enables recurring administrative tasks such as index maintenance, data consistency checks, and automated batch operations, with job definitions and history stored in a dedicated job agent database. This provides a secure, scalable, and database-scoped alternative for executing T-SQL logic without external orchestration.

Why this answer

Elastic Database Jobs in Azure SQL Database can replace SQL Server Agent jobs for scheduling T-SQL scripts across multiple databases. Option A is incorrect because Azure Automation is not designed for T-SQL job scheduling; it is used for automating Azure management tasks. Option B is incorrect because Azure Logic Apps is for workflow automation and integration, not for direct T-SQL job scheduling.

Option D is incorrect because Azure Data Factory is primarily for data integration and orchestration, not for scheduling ad-hoc T-SQL jobs.

17
MCQmedium

A company uses Azure SQL Database and needs to implement data masking for sensitive columns like email addresses and credit card numbers, so that only authorized users can see the actual data. Which feature should they configure?

A.Row-Level Security
B.Dynamic Data Masking
C.Auditing
D.Transparent Data Encryption (TDE)
AnswerB

Dynamic Data Masking (DDM) in Azure SQL Database is the correct choice because it applies masking functions to designated sensitive columns at query time, so unauthorized users see obfuscated values (for example, xxxx-xxxx-xxxx-1234) while the underlying stored data remains unchanged. DDM does not alter the database physically; instead, it transforms the result set in place, and users with the ALTER ANY MASK permission can still query the unmasked values. This precisely matches the requirement to hide sensitive data from query results while leaving the data intact.

Why this answer

Dynamic Data Masking (DDM) is the correct feature because it limits exposure of sensitive data by obfuscating columns (e.g., email addresses, credit card numbers) in query results to non-privileged users, while authorized users (with EXEMPT or UNMASK permission) see the actual data. This directly meets the requirement of masking sensitive columns without altering the underlying stored data.

Exam trap

The trap here is that candidates often confuse Dynamic Data Masking (which hides data in query results) with Transparent Data Encryption (which protects data at rest), leading them to select TDE when the requirement is about controlling visibility to specific users.

How to eliminate wrong answers

Option A is wrong because Row-Level Security (RLS) controls access to rows based on user identity or context (e.g., a user can only see their own orders), not by masking column values. Option C is wrong because Auditing logs database events (e.g., SELECT, INSERT) for compliance and monitoring, but does not modify query results to hide sensitive data. Option D is wrong because Transparent Data Encryption (TDE) encrypts the database at rest (on disk) and in backups, but does not control visibility of data in query results to authorized vs. unauthorized users.

18
MCQmedium

A company uses Azure SQL Database for a reporting application. The database is mostly idle during weekdays but experiences heavy load on weekends when reports are generated. They want to minimize costs by only paying for compute resources when the database is active. Which Azure SQL Database pricing model should they choose?

A.Provisioned DTU
B.Provisioned vCore
C.Serverless
D.Hyperscale
AnswerC

Serverless is the correct choice because Azure SQL Database's serverless compute tier is explicitly designed for intermittent workloads like this reporting application. It automatically pauses the database after a configurable period of inactivity (default 60 minutes) and resumes instantly on the next connection, so compute is billed only on actual usage per second during active periods. Storage remains billed separately at all times, but eliminating idle compute charges makes it far cheaper than provisioned models for a reporting app that is used sporadically.

Why this answer

The Serverless pricing model for Azure SQL Database automatically pauses the database during periods of inactivity (e.g., weekdays) and resumes it when load increases (e.g., weekends), charging only for compute resources consumed during active periods. This aligns perfectly with the described workload pattern of mostly idle weekdays and heavy weekend usage, minimizing costs by eliminating charges for idle compute.

Exam trap

The trap here is that candidates may confuse 'Serverless' with 'Hyperscale' because both are modern Azure SQL offerings, but Hyperscale focuses on storage scalability and performance, not on pausing compute to save costs during idle periods.

Why the other options are wrong

A

Provisioned DTU requires paying for a fixed set of resources regardless of usage, which does not allow cost savings during idle periods on weekdays.

B

Provisioned vCore requires continuous payment for allocated compute resources regardless of usage, so it does not allow pausing during idle periods to minimize costs.

D

Hyperscale is designed for very large databases (up to 100 TB) with high scalability and fast recovery, not for cost savings on intermittent workloads. It still requires continuous compute billing, so it does not minimize costs for a database that is idle most of the week.

19
MCQmedium

A company uses Azure SQL Database for an order processing system. The Orders table has columns: OrderID (PK), CustomerID, OrderDate, TotalAmount. The Customers table has CustomerID (PK), Name, Email. The database administrator wants to ensure that when a customer record is deleted, all orders for that customer are also automatically deleted. Which database constraint should be implemented?

A.ON DELETE SET NULL on Orders.CustomerID
B.ON DELETE CASCADE on Orders.CustomerID
C.ON UPDATE CASCADE on Customers.CustomerID
D.A trigger on Customers table
AnswerB

ON DELETE CASCADE is the correct choice because it declaratively tells the database to automatically delete all rows in the Orders table that reference a customer when that customer's row is deleted from the Customers table. This is a built-in referential action on the foreign key constraint, ensuring that no orphaned order rows remain and that the deletion is atomic and enforced by the database engine. Unlike procedural triggers, it cannot be bypassed accidentally and requires no custom T-SQL logic. This exactly meets the requirement for removing a customer and their associated orders.

Why this answer

ON DELETE CASCADE on the foreign key (Orders.CustomerID) automatically deletes all child rows in the Orders table when the parent row in the Customers table is deleted. This ensures referential integrity without requiring additional code or triggers, and is the standard SQL mechanism for cascading deletes in Azure SQL Database.

Exam trap

The trap here is that candidates often confuse ON DELETE CASCADE with ON UPDATE CASCADE, mistakenly thinking that updating a primary key is the same as deleting a record, or they incorrectly assume that a trigger is always required for cascading operations when a declarative constraint is available.

How to eliminate wrong answers

Option A is wrong because ON DELETE SET NULL would set Orders.CustomerID to NULL when the customer is deleted, which does not delete the orders and would leave orphaned rows with a NULL foreign key. Option C is wrong because ON UPDATE CASCADE handles changes to the primary key value (CustomerID), not deletions; it would update the foreign key in Orders when CustomerID changes, but does not address the delete requirement. Option D is wrong because while a trigger could achieve the same result, it is not a database constraint; it is procedural code that is less declarative, more complex to maintain, and can introduce performance overhead compared to the built-in declarative ON DELETE CASCADE constraint.

20
Drag & Dropmedium

Drag and drop the steps to ingest data into Azure Data Explorer (ADX) in the correct order.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4

Why this order

Ingestion involves creating the target table, defining mapping, executing the ingestion, and verifying.

21
MCQmedium

A company wants to migrate an on-premises SQL Server database to Azure. The database uses SQL Agent jobs to run nightly ETL processes and relies on Service Broker for asynchronous messaging between applications. They want to minimize changes to the application and database code. Which Azure SQL deployment option should they choose?

A.Azure SQL Managed Instance
B.Azure SQL Database (single database)
C.Azure SQL Database elastic pool
D.SQL Server on Azure Virtual Machines
AnswerA

Azure SQL Managed Instance is a fully managed PaaS deployment that provides near 100% surface-area compatibility with on-premises SQL Server, including instance-scoped features such as SQL Agent jobs, Service Broker, Database Mail, and CLR assemblies. It integrates with a customer's virtual network yet offloads patching, backups, and high availability to Azure, making it the ideal choice for a lift-and-shift migration with minimal application changes. Unlike single databases, it supports cross-database queries and the full T-SQL surface needed by legacy workloads.

Why this answer

Azure SQL Managed Instance is the correct choice because it provides near 100% compatibility with on-premises SQL Server, including support for SQL Agent jobs and Service Broker. This allows the company to migrate the database with minimal code changes, as these features are not available in Azure SQL Database (single or elastic pool). SQL Server on Azure VMs would also support these features but requires more management overhead and is not a fully managed PaaS option.

Exam trap

The trap here is that candidates may assume SQL Server on Azure VMs is the only option for full compatibility, but Azure SQL Managed Instance offers the same compatibility with less operational overhead, making it the optimal PaaS choice for minimizing code changes.

Why the other options are wrong

B

Azure SQL Database (single database) does not support SQL Agent jobs or Service Broker, which are required by the company's existing ETL processes and asynchronous messaging.

C

Azure SQL Database elastic pool does not support SQL Agent jobs or Service Broker, which are required for the nightly ETL processes and asynchronous messaging without code changes.

D

SQL Server on Azure VMs requires you to manage the OS and SQL Server, including patching and backups, and does not provide native support for Service Broker or SQL Agent jobs without additional configuration. The question emphasizes minimizing changes, but this option would require more management overhead and potential code changes.

22
Multi-Selectmedium

Which TWO features are supported by Azure SQL Database to provide high availability?

Select 2 answers
A.Always On availability groups
B.Point-in-time restore
C.Active geo-replication
D.Auto-failover groups
E.Log shipping
AnswersC, D

Active geo-replication is a built-in Azure SQL Database feature that continuously replicates committed transactions to readable secondary databases in a different Azure region. It supports up to four secondaries per primary, and you can manually initiate failover or configure read workloads to query the secondaries for load balancing. These secondaries are real database endpoints, making the feature a direct high-availability and disaster-recovery mechanism with no need to set up any external infrastructure.

Why this answer

Options C and D are correct. Active geo-replication enables creating readable secondary databases in different regions for failover, while auto-failover groups manage the failover of a group of databases with automatic initiation. Option A is incorrect because Always On availability groups are an on-premises SQL Server feature, not directly used in Azure SQL Database.

Option B is incorrect because point-in-time restore is a backup feature for recovery to a specific time, not for high availability. Option E is incorrect because log shipping is an on-premises disaster recovery technique not natively supported in Azure SQL Database.

23
MCQmedium

A retail company uses Azure SQL Database for its sales transaction table, which contains over 500 million rows. Queries that filter by OrderDate are slow because the database scans the entire table. The database administrator decides to implement table partitioning on the OrderDate column. What is the primary benefit of this partitioning strategy?

A.It reduces the total storage required by compressing older partitions.
B.It improves query performance by enabling partition elimination, where only relevant partitions are scanned.
C.It enforces referential integrity between partitions automatically.
D.It eliminates the need for indexes on the partitioned column.
AnswerB

Partition elimination is a query-processing optimization that allows Azure SQL Database to access only the partition(s) relevant to a query's predicate on the partition key, instead of scanning the entire table. When a WHERE clause includes the partitioning column and the values are sargable, the optimizer can read far fewer pages, reducing I/O and improving response time. This is particularly valuable for large fact tables in a data warehouse where reports typically filter by date ranges.

Why this answer

Table partitioning in Azure SQL Database divides a large table into smaller, manageable segments based on a partition key (here, OrderDate). The primary benefit is partition elimination: queries with filters on OrderDate can scan only the relevant partition(s) instead of the entire 500-million-row table, drastically reducing I/O and improving query performance.

Exam trap

The trap here is that candidates may confuse partitioning with indexing or compression, thinking it automatically solves all performance issues or reduces storage, when its core benefit is query performance via partition elimination.

How to eliminate wrong answers

Option A is wrong because partitioning does not inherently compress older partitions; compression is a separate feature (e.g., page or row compression) that can be applied independently. Option C is wrong because referential integrity (foreign keys) is enforced at the table level, not automatically between partitions; partitioning does not manage relationships. Option D is wrong because partitioning does not eliminate the need for indexes; in fact, indexes are often still required on the partition key or other columns for optimal performance, and partitioning works alongside indexes.

24
MCQmedium

A company uses Azure SQL Database for a customer relationship management (CRM) application. The database has a table named Orders that stores order details. The company needs to ensure that the OrderDate column is automatically set to the current date and time when a new row is inserted, without any application-side logic. Which T-SQL construct should be used?

A.CHECK constraint
B.UNIQUE constraint
C.PRIMARY KEY constraint
D.DEFAULT constraint with GETDATE()
AnswerD

DEFAULT with GETDATE() automatically inserts current date/time.

Why this answer

A DEFAULT constraint with GETDATE() automatically populates the OrderDate column with the current date and time on each insert, without requiring application-side logic. Option A is incorrect because a CHECK constraint enforces data integrity by validating conditions but does not provide default values. Option B is incorrect because a UNIQUE constraint ensures all values in a column are unique, not auto-populate dates.

Option C is incorrect because a PRIMARY KEY constraint uniquely identifies each row and does not set default values.

25
MCQmedium

A company has 15 on-premises SQL Server databases, each 20–40 GB, running on a single instance. They rely on cross-database queries using three-part names (e.g., DB1.dbo.table) and SQL Server Agent for maintenance. They want to migrate to Azure with minimal application changes and reduce administrative overhead. Which Azure SQL deployment option should they choose?

A.Azure SQL Database elastic pool
B.Azure SQL Database single database
C.Azure SQL Managed Instance
D.SQL Server on Azure Virtual Machines
AnswerC

Azure SQL Managed Instance is the correct choice because it is a PaaS offering that provides near-100% compatibility with on-premises SQL Server, including instance-level features such as cross-database queries using three-part names, SQL Server Agent, linked servers, and CLR. You get the administrative benefits of Azure (automated backups, patching, and high availability) without sacrificing the instance-scoped functionality these 15 databases likely rely on. This makes it ideal for lift-and-shift migrations where you need reduced overhead but full SQL Server instance behavior.

Why this answer

Azure SQL Managed Instance is correct because it provides near-100% compatibility with on-premises SQL Server, including support for cross-database queries using three-part names and SQL Server Agent. This allows the company to migrate with minimal application changes while offloading administrative overhead like patching and backups, which are handled by Azure.

Exam trap

The trap here is that candidates often confuse Azure SQL Database's elastic pool with Managed Instance, not realizing that elastic pools still lack cross-database query support and SQL Server Agent, which are critical for the described workload.

Why the other options are wrong

A

Azure SQL Database (single or elastic pool) does not support cross-database queries using three-part names, which the company relies on. It also lacks SQL Server Agent, so maintenance jobs would need to be reimplemented.

B

Azure SQL Database single database does not support cross-database queries using three-part names or SQL Server Agent, so it cannot meet the requirements for minimal application changes and maintenance automation.

D

SQL Server on Azure VMs requires you to manage the OS, SQL Server, and backups, increasing administrative overhead. It also does not natively support cross-database queries with three-part names as seamlessly as Azure SQL Managed Instance, and you would need to configure linked servers or other workarounds.

26
MCQeasy

Refer to the exhibit. This ARM template snippet is used to deploy which Azure resource?

A.Azure Database for MySQL server
B.Azure SQL Managed Instance
C.Azure SQL Database server
D.Azure Synapse Analytics workspace
AnswerC

The ARM template snippet is a match for an Azure SQL Database logical server. The `Microsoft.Sql/servers` resource type uses exactly the properties shown: a server name, `administratorLogin`, `administratorLoginPassword`, and a location. A logical server is a management container for SQL databases and elastic pools, and this template is the standard way to provision that container before adding databases, firewall rules, or other child resources.

Why this answer

The ARM template snippet includes properties such as 'serverName', 'administratorLogin', and 'administratorLoginPassword', which are specific to an Azure SQL Database server deployment. Option A is incorrect because an Azure Database for MySQL server uses different properties like 'mysqlVersion' and 'storageProfile'. Option B is incorrect because Azure SQL Managed Instance requires properties like 'vCores', 'storageSizeInGB', and 'licenseType'.

Option D is incorrect because Azure Synapse Analytics workspace deployments use properties like 'sqlAdministratorLogin' and 'defaultDataLakeStorage' but with different structure.

27
MCQmedium

A SaaS company hosts a multi-tenant application. Each tenant has a separate Azure SQL Database. The databases are small (1-3 GB) and their workloads vary significantly over time, with some tenants active during business hours and others at night. The company wants to maximize resource utilization and minimize costs by pooling compute resources across tenants while maintaining predictable performance per database. Which Azure SQL Database deployment option should they choose?

A.Azure SQL Database Single Database
B.Azure SQL Database Elastic Pool
C.Azure SQL Managed Instance
D.SQL Server on Azure Virtual Machine
AnswerB

An elastic pool allows multiple databases to share a pool of resources. Databases automatically use resources as needed, maximizing utilization and lowering cost while providing predictable performance per database via settings like min and max vCores.

Why this answer

Azure SQL Database Elastic Pool is the correct choice because it allows multiple databases (tenants) to share a fixed pool of compute and storage resources, enabling cost efficiency through resource pooling while providing predictable performance via per-database resource limits (min/max DTU or vCore). This matches the scenario of small databases with variable, non-overlapping workloads across tenants.

Exam trap

The trap here is that candidates may choose Single Database (Option A) thinking it offers the best isolation, but they overlook the cost and resource utilization benefits of Elastic Pool for variable, non-overlapping workloads across many small databases.

Why the other options are wrong

A

Single Database does not allow pooling compute resources across tenants; each database is isolated with its own DTU/vCore allocation, leading to underutilization and higher costs for variable, small workloads.

C

Azure SQL Managed Instance provides near 100% SQL Server compatibility and is designed for lift-and-shift migrations, not for pooling compute resources across multiple small databases with variable workloads. It does not offer the elastic pooling capability to share resources among tenants.

D

SQL Server on Azure VM requires manual management of compute resources and does not provide built-in multi-tenant pooling or elastic scaling across databases. It also incurs higher operational overhead and cost for small, variable workloads compared to an elastic pool.

28
Multi-Selecteasy

Which TWO security features are available in Azure SQL Database to help protect data at rest?

Select 2 answers
A.Firewall rules
B.Dynamic data masking
C.Transparent data encryption (TDE)
D.Azure AD authentication
E.Always Encrypted
AnswersC, E

Transparent data encryption (TDE) encrypts the actual database files (data and log files) at rest by performing real-time I/O encryption and decryption of pages as they are written to and read from disk. The encryption uses a database encryption key that is protected by a certificate or asymmetric key stored either in Azure Key Vault or managed by the service. This operation is transparent to applications, requiring no changes to application code or queries, and explicitly provides the data-at-rest encryption that the question is asking about.

Why this answer

Transparent Data Encryption (TDE) is a feature in Azure SQL Database that encrypts data at rest, including backups and transaction log files, using an AES-256 encryption algorithm. It performs real-time I/O encryption and decryption of the data without requiring changes to the application, ensuring that the physical storage media is protected against unauthorized access. Always Encrypted also protects data at rest by encrypting sensitive columns within the database, but it additionally protects data in transit and during query processing by keeping the encryption keys on the client side.

Exam trap

The trap here is that candidates often confuse dynamic data masking with encryption, or assume that authentication or network controls (like firewall rules) provide data-at-rest protection, when in fact only encryption mechanisms like TDE and Always Encrypted directly secure data stored on disk.

29
MCQmedium

A multinational e-commerce company uses Azure SQL Database for its order processing system. They need to ensure that if an entire Azure region becomes unavailable, the database remains available with minimal data loss and automatic failover. Which feature should they implement?

A.Active geo-replication
B.Automatic tuning
C.Elastic pools
D.Serverless compute
AnswerA

Active geo-replication continuously replicates committed transactions from the primary Azure SQL database to a secondary database in a different Azure region using asynchronous Always On technology. It is the intended disaster-recovery feature because it maintains a readable warm standby that can be promoted during an outage, and when paired with an auto-failover group it can switch customer traffic automatically. This directly addresses the requirement for cross-region availability in a multinational e-commerce deployment.

Why this answer

Active geo-replication (Option A) is correct because it creates readable secondary replicas of an Azure SQL Database in a paired Azure region, enabling automatic failover during a regional outage. This feature provides a recovery point objective (RPO) of as low as 5 seconds and a recovery time objective (RTO) of under 1 hour, ensuring minimal data loss and high availability.

Exam trap

The trap here is that candidates may confuse 'automatic tuning' (a performance feature) with 'automatic failover' (a disaster recovery feature), or assume that serverless compute or elastic pools inherently provide high availability, which they do not.

How to eliminate wrong answers

Option B (Automatic tuning) is wrong because it optimizes query performance through index management and plan regression fixes, not disaster recovery or regional failover. Option C (Elastic pools) is wrong because they are a cost-management model for sharing resources among multiple databases, not a high-availability or geo-replication feature. Option D (Serverless compute) is wrong because it auto-scales compute resources based on workload demand and pauses idle databases, but it does not provide any cross-region replication or automatic failover capability.

30
MCQhard

A software-as-a-service (SaaS) provider hosts a multi-tenant application with a separate database for each tenant. They anticipate scaling to thousands of tenants and want to minimize cost while allowing tenants to share resources flexibly. Which Azure SQL offering is most suitable?

A.Azure SQL Database elastic pool
B.Azure SQL Database (single database)
C.Azure SQL Managed Instance
D.SQL Server on Azure Virtual Machine
AnswerA

Azure SQL Database elastic pools share a set of eDTUs or vCores across multiple databases, letting a SaaS provider assign per-database minimum and maximum performance limits. This design absorbs unpredictable usage spikes from different tenants without over-provisioning each database, making it the most cost-efficient and operationally simple choice for a large multi-tenant workload.

Why this answer

Azure SQL Database elastic pool is the most suitable choice because it allows multiple single databases (one per tenant) to share a fixed set of resources (DTUs or vCores) within a pool, optimizing cost by averaging resource usage across tenants. This model supports scaling to thousands of tenants while providing resource elasticity and predictable pricing, as tenants with low activity can use unused capacity from busy ones without over-provisioning.

Exam trap

The trap here is that candidates often choose Azure SQL Database single database (Option B) because they assume 'separate database for each tenant' implies isolation, but they overlook the cost and scaling inefficiency of dedicating resources per tenant when resource sharing is explicitly desired.

Why the other options are wrong

B

Single databases do not allow resource sharing across tenants; each database is isolated with fixed resources, leading to higher costs and inefficiency when scaling to thousands of tenants with variable usage.

C

Azure SQL Managed Instance is designed for lift-and-shift migrations of on-premises SQL Server workloads with high compatibility, not for multi-tenant SaaS scenarios where elastic pools provide cost-effective resource sharing across thousands of databases.

D

SQL Server on Azure Virtual Machine requires manual management of scaling, high availability, and resource sharing, and does not provide the built-in multi-tenant resource pooling and cost efficiency of elastic pools for thousands of tenants.

31
MCQhard

A multinational corporation runs a mission-critical relational database on Azure SQL Database. They require automatic failover to a secondary region in case of a regional outage, with no data loss. The secondary region must also be readable for reporting purposes. What should they implement?

A.Active Geo-Replication with manual failover
B.Read Scale-Out with a local secondary replica
C.Azure Site Recovery for the database server
D.Failover group with a readable secondary in a different region
AnswerD

A failover group on Azure SQL Database wraps the underlying geo-replication into an automatic, policy-driven failover mechanism, with a read-write listener and a separate read-only listener for reporting workloads. The readable secondary in a different region gives the corporation both a hot standby and a queryable copy for analytics, while automatic failover handles a regional outage without manual intervention. Failover groups are the intended PaaS database-native pattern for exactly this mission-critical, multi-region scenario.

Why this answer

A failover group with a readable secondary in a different region provides automatic failover (no manual intervention) and the secondary can be used for read-only queries. This meets the requirement of automatic failover, no data loss (synchronous replication when using Premium or Business Critical tiers), and read access for reporting. Option A (Active Geo-Replication) requires manual failover, not automatic.

Option B (Read Scale-Out) creates a local readable secondary, not in a different region, and does not provide failover. Option C (Azure Site Recovery) is designed for VM and physical server replication, not for Azure SQL Database.

32
MCQmedium

A company maintains a large 'Transactions' table in Azure SQL Database. The table has a clustered index on a GUID column (TransactionID). Over time, they observe slow insert performance due to index fragmentation and page splits. They also need fast point lookups by TransactionID. Which approach should they take to improve insert performance while still supporting fast lookups?

A.Change the clustered index to a nonclustered index on TransactionID and make the table a heap
B.Change the clustered key to an integer IDENTITY column and keep a nonclustered index on TransactionID
C.Keep the clustered index on TransactionID but rebuild it daily
D.Remove the clustered index entirely and create a nonclustered index on TransactionID
AnswerB

An integer IDENTITY column provides sequential values that reduce fragmentation and page splits, improving insert performance. The nonclustered index on TransactionID supports efficient point lookups. This is a recommended pattern when the natural key is not ideal for clustering.

Why this answer

Using an integer IDENTITY column as the clustered key eliminates the random insertion order and page splits caused by a GUID clustered index, while the nonclustered index on TransactionID provides fast point lookups. In Azure SQL Database, a clustered index determines the physical order of data; a monotonically increasing integer avoids fragmentation and improves insert throughput.

Exam trap

The trap here is that candidates assume rebuilding the clustered index (Option C) is a sufficient maintenance fix, but the DP-900 exam tests understanding that the root cause is the choice of clustered key data type, not just fragmentation management.

Why the other options are wrong

A

Making the table a heap (no clustered index) eliminates page splits from GUID inserts, but point lookups by TransactionID require a nonclustered index, which still suffers from fragmentation and includes a costly key lookup (RID) to the heap, degrading lookup performance.

C

Rebuilding the clustered index daily does not address the root cause of fragmentation and page splits caused by GUID-based clustered keys; inserts will continue to cause fragmentation between rebuilds, leading to ongoing performance degradation.

D

Removing the clustered index entirely and creating only a nonclustered index on TransactionID would make the table a heap, which eliminates page splits but significantly degrades point lookup performance because lookups would require a key lookup (RID) into the heap, adding extra I/O.

33
Multi-Selecthard

Which THREE of the following are valid considerations when choosing between Azure SQL Database and Azure SQL Managed Instance?

Select 3 answers
A.Azure SQL Managed Instance supports SQL Server Agent for job scheduling.
B.Azure SQL Database supports larger database sizes than Azure SQL Managed Instance.
C.Azure SQL Managed Instance supports cross-database queries within the same instance.
D.Azure SQL Managed Instance does not support virtual network integration.
E.Azure SQL Database supports elastic pools for cost-effective resource sharing among multiple databases.
AnswersA, C, E

Azure SQL Managed Instance includes SQL Server Agent, enabling the scheduling of recurring T-SQL jobs such as index maintenance, backup tasks, and data collection. This feature is inherited from the full SQL Server database engine and is not present in Azure SQL Database single databases, where you would need to use Elastic Jobs or external orchestration instead. Because the service runs the actual SQL Server engine, SQL Agent jobs can be managed using the same stored procedures and SQL commands as on-premises deployments.

Why this answer

Options A, C, and E are correct. Azure SQL Managed Instance supports SQL Server Agent (A) and cross-database queries (C) because it shares more features with on-premises SQL Server. Azure SQL Database supports elastic pools (E) for sharing resources across databases.

Option B is incorrect because Azure SQL Managed Instance supports larger database sizes than Azure SQL Database (up to 16 TB vs. up to 4 TB for single databases in SQL Database). Option D is incorrect because Azure SQL Managed Instance always runs within a virtual network, so it supports VNet integration by default.

34
MCQhard

A data warehouse team in Azure Synapse Analytics notices query performance degradation on a large fact table. The table is partitioned by date and has a clustered columnstore index. Which action is most likely to improve performance?

A.Update statistics on the fact table
B.Drop and recreate the partition boundaries
C.Reorganize the clustered columnstore index
D.Change the distribution to ROUND_ROBIN
AnswerC

Reorganizing the clustered columnstore index invokes the tuple mover to force closed rowgroups into compressed segments, merge small compressed segments, and eliminate logically deleted rows. This compacts the physical storage, improves segment density and min/max statistics, and accelerates scan pruning and predicate evaluation. It is the correct, online operation for resolving columnstore fragmentation in Azure Synapse Analytics while avoiding a full rebuild.

Why this answer

Reorganizing the clustered columnstore index (option C) is the most likely action to improve performance because, over time, columnstore indexes can become fragmented due to data modifications (inserts, updates, deletes). Reorganizing the index physically recompresses the data into optimal rowgroups, removing deleted rows and merging small rowgroups, which directly improves query scan efficiency and reduces I/O.

Exam trap

The trap here is that candidates often confuse index maintenance (reorganize/rebuild) with statistics updates or distribution changes, mistakenly believing that stale statistics or a different distribution method are the primary causes of performance degradation on a large, partitioned fact table with a clustered columnstore index.

How to eliminate wrong answers

Option A is wrong because updating statistics helps the query optimizer generate better execution plans, but it does not address the underlying physical fragmentation of the columnstore index that causes degraded scan performance. Option B is wrong because dropping and recreating partition boundaries would change the partitioning scheme, which could disrupt data organization and query patterns; it does not fix fragmentation within the existing columnstore index. Option D is wrong because changing the distribution to ROUND_ROBIN would distribute data evenly across nodes but would eliminate the benefits of collocation for join and aggregation queries, likely worsening performance for typical data warehouse workloads.

35
MCQmedium

A hospital uses Azure SQL Database to store patient records. The database contains tables for patient information, insurance details, and treatment plans. The system must ensure that if a transaction updates a patient's insurance and their treatment plan in two separate rows, either both updates succeed or both fail. Which ACID property guarantees this behavior?

A.Durability
B.Consistency
C.Isolation
D.Atomicity
AnswerD

Atomicity is the ACID property that treats a transaction as an indivisible unit: all statements inside it must succeed, or the entire transaction is aborted and any already-applied changes are rolled back to the original state. In Azure SQL Database, atomicity is implemented via the transaction log and rollback operations—if the second UPDATE of the patient record fails, the first UPDATE is undone, ensuring that the two rows are always updated together. This directly fulfills the hospital's requirement that both rows be updated or neither, regardless of where the failure occurs.

Why this answer

Atomicity ensures that a transaction is treated as a single, indivisible unit of work. In Azure SQL Database, if a transaction updates both the insurance and treatment plan rows, atomicity guarantees that either both updates are committed or both are rolled back, preventing partial updates that could leave data in an inconsistent state.

Exam trap

The trap here is that candidates confuse atomicity with consistency, thinking that consistency alone ensures all-or-nothing updates, but consistency only enforces rules and constraints—it is atomicity that provides the rollback mechanism to prevent partial transactions.

How to eliminate wrong answers

Option A is wrong because durability guarantees that committed transactions persist even after a system failure, but it does not control whether both updates succeed or fail together. Option B is wrong because consistency ensures that a transaction brings the database from one valid state to another, but it relies on atomicity to prevent partial updates that would violate integrity rules. Option C is wrong because isolation controls how concurrent transactions interact (e.g., preventing dirty reads), but it does not enforce the all-or-nothing behavior of a single transaction.

36
MCQmedium

A library management system uses Azure SQL Database. The Books table has 500,000 rows with columns: BookID (primary key, clustered), Title, Author, ISBN, PublishedYear, CopiesAvailable. Queries frequently filter by Author and then sort results by PublishedYear in descending order. Which indexing strategy will most improve query performance?

A.Create a nonclustered index on (Author) INCLUDE (PublishedYear, CopiesAvailable, Title).
B.Create a nonclustered index on (PublishedYear) INCLUDE (Author).
C.Create a nonclustered index on (Author, PublishedYear DESC) INCLUDE (CopiesAvailable, Title, ISBN).
D.Create a nonclustered columnstore index on (Author, PublishedYear, CopiesAvailable, Title, ISBN).
AnswerC

This index is sorted by Author first and then PublishedYear descending, perfectly supporting both the filter and the sort. Included columns make it covering.

Why this answer

It creates a covering index that matches the exact query pattern: filtering by Author and sorting by PublishedYear in descending order. By defining (Author, PublishedYear DESC) as the index key, SQL Server can perform an index seek on Author and an ordered scan on PublishedYear without a separate sort operation. Including the remaining columns (CopiesAvailable, Title, ISBN) as non-key columns makes the index covering, eliminating the need for key lookups to the clustered index.

Exam trap

The trap here is that candidates often choose Option A because they think INCLUDING PublishedYear is sufficient for sorting, but they miss that the index key order must match the ORDER BY clause to avoid an explicit sort operation.

How to eliminate wrong answers

Option A is wrong because it includes PublishedYear only as an included column, not as a key column, so the database cannot use the index to satisfy the ORDER BY PublishedYear DESC clause without performing an explicit sort after the seek on Author. Option B is wrong because it places PublishedYear as the leading key column, which does not support efficient filtering on Author; the query would require a full index scan or a separate lookup for each Author value. Option D is wrong because a nonclustered columnstore index is optimized for large-scale analytical aggregations and scans, not for point lookups or ordered retrieval of a small subset of rows; it would introduce unnecessary overhead for this transactional query pattern.

37
Multi-Selecthard

Which THREE factors should be considered when designing a relational database in Azure to minimize latency for globally distributed users?

Select 3 answers
A.Implement horizontal partitioning (sharding)
B.Use columnstore indexes
C.Configure read replicas
D.Use active geo-replication
E.Choose a service tier that provides higher IOPS
AnswersC, D, E

Configuring read replicas is a standard Azure pattern for reducing read latency in a read-heavy relational database. A read replica is a read-only secondary copy that can be placed in the same region or closer to users, and by redirecting reporting or read-only queries to the replica, the primary server is relieved of read load. This shortens response time for those queries and isolates write-heavy traffic on the primary, but it is important to remember that replicas are asynchronously updated, so they may lag behind the primary.

Why this answer

Geo-replication provides read replicas in multiple regions. Read-replica configurations offload read traffic. Selecting a tier with higher IOPS ensures sufficient throughput.

Horizontal partitioning (sharding) adds complexity and may increase latency for cross-shard queries. Columnstore indexes are for analytics, not latency reduction.

38
MCQmedium

A company is migrating a 500 GB on-premises SQL Server database to Azure. The database uses SQL Server Agent for scheduled maintenance jobs and requires the ability to run cross-database queries within the same logical server. The company wants a PaaS service that minimizes management overhead for patching and backups while preserving these SQL Server features. Which Azure SQL service should they choose?

A.Azure SQL Database
B.Azure SQL Managed Instance
C.SQL Server on Azure Virtual Machine
D.Azure Database for MySQL
AnswerB

Azure SQL Managed Instance is the correct choice because it provides near 100% surface area compatibility with on-premises SQL Server, including SQL Server Agent, linked servers, and cross-database queries within the same instance. As a Platform-as-a-Service (PaaS) offering, it handles patching, backups, and high availability automatically, which directly satisfies the requirement to minimize management overhead during migration. This makes it ideal for a 500 GB database with dependency on SQL Server-specific features.

Why this answer

Azure SQL Managed Instance is the correct choice because it provides near 100% compatibility with on-premises SQL Server, including SQL Server Agent and cross-database queries within the same instance. As a PaaS service, it handles patching and backups automatically, minimizing management overhead while preserving these required features.

Exam trap

The trap here is that candidates often confuse Azure SQL Database's 'logical server' with a true SQL Server instance, assuming it supports SQL Server Agent and cross-database queries, when in fact it does not.

Why the other options are wrong

A

Azure SQL Database does not support SQL Server Agent for scheduled maintenance jobs or cross-database queries within the same logical server, which are required by the question.

C

SQL Server on Azure Virtual Machine is an IaaS solution, not PaaS, requiring the customer to manage patching, backups, and the OS, contradicting the requirement to minimize management overhead.

D

Azure Database for MySQL is a PaaS service for MySQL databases, not SQL Server. It does not support SQL Server Agent, cross-database queries within the same logical server, or SQL Server-specific features required by the question.

39
MCQmedium

A company plans to migrate an on-premises SQL Server database to Azure. The database uses SQL Server Agent for nightly maintenance jobs, Service Broker for asynchronous messaging, and requires cross-database queries within the same instance. The company wants a fully managed Platform as a Service (PaaS) solution that minimizes application code changes. Which Azure SQL deployment option should they choose?

A.Azure SQL Database (single database)
B.Azure SQL Managed Instance
C.Azure SQL Database elastic pool
D.Azure SQL Database Hyperscale
AnswerB

Azure SQL Managed Instance offers high compatibility with on-premises SQL Server, including SQL Agent, Service Broker, and cross-database queries. It is a PaaS solution that requires minimal to no application code changes, making it the best fit for this scenario.

Why this answer

Azure SQL Managed Instance is the correct choice because it provides near 100% compatibility with on-premises SQL Server, including SQL Server Agent, Service Broker, and cross-database queries within the same instance, while being a fully managed PaaS offering. This minimizes application code changes because the migration can be performed with minimal schema or code modifications, unlike Azure SQL Database which lacks these features.

Exam trap

The trap here is that candidates often confuse Azure SQL Database elastic pool with a managed instance, assuming it provides instance-level features, when in fact it is merely a cost-saving container for multiple single databases that still lack SQL Server Agent, Service Broker, and cross-database query support.

Why the other options are wrong

A

Azure SQL Database (single database) does not support SQL Server Agent, Service Broker, or cross-database queries within the same instance, which are required by the scenario.

C

Azure SQL Database elastic pool does not support SQL Server Agent, Service Broker, or cross-database queries within the same instance, which are required by the question.

D

Azure SQL Database Hyperscale is designed for large databases with high scalability and performance needs, but it does not support SQL Server Agent, Service Broker, or cross-database queries within the same instance, which are required by the question.

40
MCQmedium

A database designer is creating a relational database for a library system. Each book can have multiple authors, and each author may have written many books. To avoid data redundancy, the designer creates a separate Authors table and a BookAuthors junction table. This process of organizing data to reduce redundancy and improve integrity is called:

A.Denormalization
B.Indexing
C.Normalization
D.Partitioning
AnswerC

Normalization is the systematic process of structuring a relational database into separate, related tables to eliminate data redundancy, reduce update anomalies, and enforce data integrity. It progresses through normal forms—starting with 1NF for atomic values, then 2NF and 3NF for partial and transitive dependencies—which collectively guide table decomposition. For many-to-many relationships, normalization specifically calls for a junction (associative) table containing foreign keys from both parent tables, making this the correct answer for the designer's goal.

Why this answer

Normalization is the process of organizing data in a relational database to reduce redundancy and improve data integrity by dividing large tables into smaller, related tables and defining relationships between them. In this scenario, creating separate Authors and BookAuthors junction tables eliminates the redundancy of storing author information multiple times for each book, which is a classic example of normalization (specifically achieving third normal form). This directly supports the relational database goal of minimizing duplicate data and ensuring consistency.

Exam trap

The trap here is that candidates often confuse normalization with denormalization, mistakenly thinking that splitting tables to reduce redundancy is a form of denormalization, when in fact it is the core definition of normalization.

How to eliminate wrong answers

Option A is wrong because denormalization is the opposite process—it intentionally introduces redundancy (e.g., combining tables) to improve read performance, often at the cost of data integrity, and is not used to reduce redundancy. Option B is wrong because indexing is a performance optimization technique that creates data structures (e.g., B-trees) to speed up query execution, not a method for organizing data to eliminate redundancy. Option D is wrong because partitioning splits a table into smaller physical segments (e.g., horizontal or vertical partitioning) for manageability or performance, but does not inherently reduce data redundancy or improve integrity.

41
MCQmedium

A company uses Azure SQL Database for an e-commerce application. The Orders table has millions of rows. Queries that filter on CustomerID and order by OrderDate are slow. The table currently has a clustered index on OrderID (the primary key). Which index strategy will best improve these queries?

A.A. Create a nonclustered index on OrderDate only.
B.B. Create a filtered index on CustomerID where Status = 'Active'.
C.C. Create a nonclustered index on (CustomerID, OrderDate).
D.D. Create a nonclustered index on OrderID and OrderDate.
AnswerC

This composite nonclustered index places CustomerID as the leading key, enabling the query optimizer to perform an efficient index seek on the equality predicate CustomerID = @Customer. Because OrderDate is the second column, all rows for a given customer are stored in ascending OrderDate order, so the storage engine can return the results in the required sorted order without a separate SORT operator. If the SELECT list is limited to CustomerID, OrderDate, and perhaps other included columns, the index can also be covering, further eliminating base-table lookups. This design directly matches the WHERE and ORDER BY patterns and is the recommended approach for this query.

Why this answer

Creating a nonclustered index on (CustomerID, OrderDate) directly supports the query's filter (WHERE CustomerID = ?) and sort (ORDER BY OrderDate) operations. This composite index allows SQL Server to seek on CustomerID and then retrieve rows in OrderDate order without a separate sort, eliminating the need for a full clustered index scan on OrderID. It is a covering index for this query pattern, significantly reducing I/O and CPU overhead.

Exam trap

The trap here is that candidates often think a single-column index on the filter column (CustomerID) or the sort column (OrderDate) is sufficient, but they miss that a composite index covering both in the correct order eliminates the need for a separate sort and key lookups, which is critical for large tables in Azure SQL Database.

How to eliminate wrong answers

Option A is wrong because an index on OrderDate only would require a full scan to find rows matching a specific CustomerID, as it does not include the filter column; the query would still need to perform a key lookup or scan to apply the CustomerID predicate. Option B is wrong because a filtered index on CustomerID WHERE Status = 'Active' is too narrow—it only helps queries that include the Status filter, and the original query does not filter on Status, so it would be ignored by the optimizer for this workload. Option D is wrong because an index on (OrderID, OrderDate) does not include CustomerID as the leading key; the query filter on CustomerID cannot use this index efficiently, and it would still require a scan or lookup to satisfy the CustomerID condition.

42
MCQeasy

You need to migrate an on-premises SQL Server database to Azure. The database uses many stored procedures and CLR assemblies. Which Azure service is most compatible without requiring major application changes?

A.Azure Database for MySQL
B.Azure Virtual Machines with SQL Server
C.Azure SQL Database
D.Azure SQL Managed Instance
AnswerD

Azure SQL Managed Instance is a fully managed PaaS service that provides near-total compatibility with on-premises SQL Server. It supports CLR assemblies, stored procedures, SQL Server Agent, linked servers, and other instance-level features, making it the ideal target for a seamless migration. Because Microsoft handles patching, backups, and high availability, it combines the benefits of a managed service with the compatibility requirements of the existing database.

Why this answer

Azure SQL Managed Instance (D) is the most compatible choice because it provides near 100% compatibility with the on-premises SQL Server engine, including full support for CLR assemblies and stored procedures. Unlike Azure SQL Database, Managed Instance does not require rewriting or refactoring code that relies on SQL Server Agent, cross-database queries, or CLR integration, making it ideal for lift-and-shift migrations without major application changes.

Exam trap

The trap here is that candidates often confuse Azure SQL Database with Azure SQL Managed Instance, assuming both are equally compatible, but Azure SQL Database deliberately omits features like CLR and SQL Server Agent to enforce multi-tenant isolation, while Managed Instance is designed for full compatibility with on-premises SQL Server workloads.

How to eliminate wrong answers

Option A is wrong because Azure Database for MySQL is a different database engine that does not support SQL Server-specific features like T-SQL stored procedures or CLR assemblies, requiring a complete rewrite of the database code. Option B is wrong because Azure Virtual Machines with SQL Server, while fully compatible, is an IaaS solution that requires you to manage the VM, patching, and backups, which is not a fully managed PaaS service and involves more operational overhead than necessary for a simple migration. Option C is wrong because Azure SQL Database is a PaaS offering that does not support CLR assemblies, SQL Server Agent, or cross-database queries, forcing significant application changes to remove or replace these features.

43
MCQmedium

An e-commerce company uses Azure SQL Database for order processing. The Orders table has columns: OrderID (unique, clustered index), CustomerID, OrderDate, Status, TotalAmount. A common query filters on CustomerID and OrderDate, and sorts by OrderDate descending. The query also returns TotalAmount. Which indexing strategy will produce the best query performance?

A.Create a nonclustered index on (CustomerID, OrderDate DESC) INCLUDE (TotalAmount)
B.Create a nonclustered index on (OrderDate) INCLUDE (CustomerID, TotalAmount)
C.Create a nonclustered index on (OrderDate DESC) INCLUDE (CustomerID, TotalAmount)
D.Create a nonclustered index on (CustomerID) INCLUDE (OrderDate, TotalAmount)
AnswerA

This composite index supports the exact filter (CustomerID and OrderDate), the sort order (OrderDate DESC is included in the key), and the included TotalAmount column eliminates key lookups, making it a covering index for the query.

Why this answer

It creates a covering index that supports both the equality filter on CustomerID and the range/sort on OrderDate DESC. By including TotalAmount as an included column, the query can be satisfied entirely from the nonclustered index without key lookups to the clustered index, minimizing I/O and improving performance.

Exam trap

The trap here is that candidates often focus on including all columns in the INCLUDE clause but fail to order the key columns correctly to support both the equality filter and the sort order, leading them to pick options that start with the sort column instead of the equality column.

How to eliminate wrong answers

Option B is wrong because the index key starts with OrderDate, which does not support the equality filter on CustomerID efficiently; the database would need to scan all rows matching the OrderDate range and then filter by CustomerID. Option C is wrong for the same reason—leading with OrderDate DESC fails to support the equality predicate on CustomerID, leading to unnecessary scans. Option D is wrong because the index key is only CustomerID, so the sort by OrderDate DESC cannot be satisfied from the index order, requiring an explicit sort operation that degrades performance.

44
MCQhard

A global e-commerce company uses Azure SQL Database for its product catalog. The application experiences high read traffic for product detail pages, often running the same queries for popular items. The database’s write workload is moderate. The company wants to improve read performance without increasing the cost of the primary database tier and without changing the application code. Which Azure SQL Database feature should they implement?

A.Read scale-out
B.Active geo-replication
C.Azure SQL Database elastic pool
D.Query Performance Insight
AnswerA

Read scale-out is correct because Azure SQL Database automatically provisions a read-only replica in the Premium, Business Critical, or Hyperscale service tiers, and you can route reporting queries to that replica by adding `ApplicationIntent=ReadOnly` to the connection string. This offloads read-only workloads from the primary replica, preserving its performance for OLTP traffic, and it operates within the same region as the primary. This is the simplest architectural solution because it requires no separate database, manual copying, or cross-region setup—just a connection string change to enable read-only routing.

Why this answer

Read scale-out (A) is correct because it offloads read-only queries to a secondary replica of the Azure SQL Database without changing the application code. By setting `ApplicationIntent=ReadOnly` in the connection string, the database routes read queries to a read-only replica, improving performance for high-read workloads like product detail pages while keeping the primary tier unchanged and avoiding additional cost for a higher tier.

Exam trap

The trap here is that candidates often confuse Active geo-replication with read scale-out, assuming geo-replication can also offload reads, but geo-replication requires explicit connection string changes and does not provide automatic read routing like read scale-out does.

Why the other options are wrong

B

Active geo-replication is designed for disaster recovery and regional failover, not for offloading read-only queries to a secondary replica. It does not improve read performance for the same queries without changing application code.

C

Elastic pools are designed to manage and share resources among multiple databases to optimize cost, not to improve read performance for a single database without increasing its tier.

D

Query Performance Insight is a diagnostic tool for analyzing query performance, not a feature to improve read performance. It does not offload read traffic or reduce load on the primary database.

45
MCQeasy

A company is designing a relational database solution on Azure for an e-commerce platform. They need to ensure high availability and automatic failover in case of a regional outage. Which Azure service should they use?

A.Azure SQL Database with active geo-replication
B.Azure SQL Managed Instance with local redundancy
C.Azure Database for PostgreSQL with read replicas
D.Azure SQL Database (single database)
AnswerA

Active geo-replication continuously replicates committed transactions from the primary Azure SQL Database to a secondary database in a different Azure region. When combined with an auto-failover group, the service automatically promotes that readable secondary if the primary becomes unavailable, providing a defined recovery point objective (typically up to 5 seconds of data loss) and recovery time objective. This design specifically satisfies the requirement for automated regional failover.

Why this answer

Azure SQL Database with active geo-replication (Option A) is the correct choice because it enables automatic failover to a secondary region in case of a regional outage, meeting the high availability requirement. Option B (Azure SQL Managed Instance with local redundancy) only provides local redundancy within a single region, not cross-region failover. Option C (Azure Database for PostgreSQL with read replicas) does not provide automatic failover; read replicas are for read scaling, not failover.

Option D (Azure SQL Database single database) by default does not have automatic regional failover; active geo-replication is needed for that.

46
MCQmedium

A financial company is migrating a 2-TB on-premises SQL Server database to Azure. The database uses SQL Server Agent jobs for data validation and cleanup, and it performs cross-database queries using three-part names (e.g., DB1.schema.table). The company requires a fully managed PaaS service that supports these features with minimal application changes. Which Azure SQL service should they choose?

A.Azure SQL Database (single database)
B.Azure SQL Managed Instance
C.Azure SQL Database elastic pool
D.SQL Server on Azure Virtual Machine
AnswerB

Azure SQL Managed Instance is a fully managed PaaS service that provides near-total compatibility with the on-premises SQL Server engine, including support for SQL Server Agent jobs and cross-database queries using three-part names. It also offers automatic backups, patching, and high availability, so the 2 TB database can be migrated with only minimal application and code changes. For a financial company looking to move off an on-premises SQL Server while preserving existing features, Managed Instance is the correct choice.

Why this answer

Azure SQL Managed Instance is the correct choice because it provides near-100% compatibility with on-premises SQL Server, including support for SQL Server Agent jobs and cross-database queries using three-part names (e.g., DB1.schema.table). As a fully managed PaaS service, it minimizes application changes while offloading infrastructure management, making it ideal for migrating a 2-TB database with these specific requirements.

Exam trap

The trap here is that candidates often confuse Azure SQL Database elastic pool with Managed Instance, assuming elastic pools support all SQL Server features, when in fact they only scale resources across single databases and lack instance-scoped features like Agent jobs and cross-database three-part name queries.

Why the other options are wrong

A

Azure SQL Database (single database) does not support cross-database queries using three-part names or SQL Server Agent jobs, which are required by the company's existing database.

C

Azure SQL Database elastic pool does not support cross-database queries using three-part names or SQL Server Agent jobs, which are required by the company.

D

SQL Server on Azure VM is an IaaS solution, not fully managed PaaS, and requires the company to manage the VM, SQL Server, and backups, which contradicts the requirement for a fully managed service.

47
Matchingmedium

Match each data processing term to its definition.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

Extract, Transform, Load

Extract, Load, Transform

Processing large volumes of data at scheduled intervals

Processing data in real-time as it arrives

Online Transaction Processing

Why these pairings

Batch processing handles large volumes at scheduled times, while stream processing handles real-time data. ETL transforms before loading; ELT transforms after loading. Common confusion is swapping ETL and ELT definitions or misapplying batch/stream terms.

48
MCQmedium

A retail application uses Azure SQL Database. The Products table contains 200,000 rows with columns: ProductID (primary key, clustered), CategoryID, ProductName, Price, StockQuantity. Queries frequently filter on CategoryID and then sort results by Price in descending order. Which indexing strategy will most improve query performance for these operations?

A.Create a clustered index on CategoryID.
B.Create a nonclustered index on CategoryID that includes Price as an included column.
C.Create a nonclustered index on (CategoryID, Price) with Price in descending order.
D.Create a clustered columnstore index on the table.
AnswerC

This index directly supports both the filter and the sort requirements because the index key columns are listed as (CategoryID, Price), and the Price column is explicitly designated as descending. For a given CategoryID, the index entries are stored in descending Price order, so the query optimizer can perform a seek to the first matching row and then scan forward to retrieve rows already sorted exactly as requested, eliminating the need for a sort operator. Additionally, if the query only references these two columns, the index is covering and avoids lookups, making it the optimal choice for this predicate and ordering.

Why this answer

Creates a composite nonclustered index on (CategoryID, Price DESC) that directly supports both the filter (CategoryID equality) and the sort (Price descending) in a single index seek and ordered scan, eliminating the need for a separate sort operation. This is the most efficient strategy because the index is ordered exactly as the query requires, allowing SQL Server to retrieve matching rows in the correct order without additional processing.

Exam trap

Microsoft often tests the misconception that including Price as an included column (Option B) is sufficient to optimize the sort, when in fact the index must be ordered by Price to avoid a separate sort operation.

How to eliminate wrong answers

Option A is wrong because changing the clustered index to CategoryID would reorganize the entire table by CategoryID, which may fragment the data and does not directly optimize the sort by Price descending; the clustered index should remain on the primary key for uniqueness and row lookup efficiency. Option B is wrong because while it includes Price as an included column, the index is ordered only by CategoryID, so SQL Server would still need to sort the matching rows by Price after the seek, adding a costly Sort operator to the execution plan. Option D is wrong because a clustered columnstore index is designed for large-scale analytical workloads with aggregations and scans, not for point lookups or ordered retrieval on a 200,000-row table; it would degrade performance for the described transactional queries.

49
MCQmedium

A company uses Azure SQL Database to store a large table of sales transactions with columns: TransactionID (primary key), CustomerID, ProductID, SaleDate, Amount. Queries frequently filter by both CustomerID and SaleDate to retrieve sales for a specific customer over a date range. Which indexing strategy will most improve query performance?

A.Create a clustered index on SaleDate
B.Create a nonclustered index on CustomerID and include SaleDate
C.Create a nonclustered index on (CustomerID, SaleDate)
D.Create a nonclustered index on (SaleDate, CustomerID)
AnswerC

A nonclustered index with CustomerID as the leading key and SaleDate as the second key lets the query engine perform an index seek on CustomerID (equality) and then efficiently navigate the ordered SaleDate values within that customer's rows for range filtering. Because the index entries are sorted by CustomerID first and SaleDate second, the engine can stop scanning as soon as the date condition is met for that customer. This index also covers queries that only return CustomerID and SaleDate, avoiding costly key lookups to the clustered index or heap.

Why this answer

Creating a nonclustered index on (CustomerID, SaleDate) as a composite index directly supports the query predicate that filters by both CustomerID and SaleDate. The index is ordered by CustomerID first, enabling efficient seeks for a specific customer, and then by SaleDate within each customer, allowing the query engine to perform a range scan for the date range without scanning the entire table or sorting. This index is a covering index for this query, as it contains all columns needed for the filter, avoiding key lookups.

Exam trap

The trap here is that candidates often choose Option D (SaleDate, CustomerID) thinking the date range should be first, but they overlook that the equality filter on CustomerID should be the leading column to enable a seek, not a scan.

Why the other options are wrong

A

A clustered index on SaleDate alone does not support the equality filter on CustomerID, so queries filtering by both CustomerID and SaleDate would require a full scan or inefficient lookup for CustomerID.

B

Including SaleDate as an included column (not a key column) means the index is ordered by CustomerID only, so it cannot efficiently support range queries on SaleDate for a given customer; the database would still need to scan all rows for that CustomerID to filter by date range.

D

For queries filtering by both CustomerID and SaleDate, a composite index on (CustomerID, SaleDate) is optimal because it allows equality on CustomerID and range on SaleDate. The index on (SaleDate, CustomerID) would require scanning all rows for a given date range before filtering by CustomerID, which is less efficient.

50
MCQmedium

A hospital uses Azure SQL Database to store patient appointment records. The 'Appointments' table has columns: AppointmentID (primary key), PatientID, DoctorID, AppointmentDate, and Status. Queries frequently filter by DoctorID (equality) and AppointmentDate (range) to retrieve a doctor's schedule. Currently, these queries are slow. Which index strategy will most improve performance for these queries?

A.Add a clustered index on AppointmentID.
B.Add a nonclustered index on (DoctorID, AppointmentDate).
C.Add a columnstore index on the Status column.
D.Add a nonclustered index on (AppointmentDate, DoctorID).
AnswerB

This composite index is correctly ordered for the query filter because DoctorID is used with an equality predicate, so SQL Server can perform a seek directly to that doctor's rows. The subsequent key column, AppointmentDate, is used with a range predicate, and once the seek lands on the doctor, scanning the date range is a narrow, contiguous index scan. This maximizes selectivity and minimizes the number of index rows touched compared to the reversed column order.

Why this answer

A nonclustered index on (DoctorID, AppointmentDate) supports both equality filtering on DoctorID and range filtering on AppointmentDate. This index structure allows SQL Server to perform a single index seek for the doctor, then a range scan within that doctor's appointments, avoiding a full table scan. The order of columns matters: the leading column (DoctorID) handles the equality predicate, and the second column (AppointmentDate) handles the range predicate efficiently.

Exam trap

The trap here is that candidates often think the date column should be first because it's a range query, but the correct strategy is to place the equality column first to minimize the scan range, then the range column second for efficient filtering.

Why the other options are wrong

A

A clustered index on AppointmentID optimizes lookups by primary key but does not support the query predicate on DoctorID and AppointmentDate, so the queries will still require a full scan or key lookup for each row.

C

A columnstore index on Status does not support the query pattern of filtering by DoctorID and AppointmentDate; columnstore indexes are optimized for large-scale analytical aggregations, not for point lookups or range scans on specific columns.

D

The index on (AppointmentDate, DoctorID) is less effective because the query filters by DoctorID first (equality) and then AppointmentDate (range). With this column order, the range scan on AppointmentDate may include many rows before filtering by DoctorID, reducing performance.

51
MCQhard

A company is migrating a SQL Server database to Azure SQL Database. The database uses CLR (Common Language Runtime) integration for business logic and has database mail configured. The company needs full instance-level functionality while still benefiting from the platform-as-a-service model. Which Azure SQL deployment option should they choose?

A.Azure SQL Database (single database)
B.Azure SQL Database elastic pool
C.Azure SQL Managed Instance
D.Azure SQL Database Hyperscale
AnswerC

Azure SQL Managed Instance is a Platform-as-a-Service deployment that provides the broadest SQL Server engine compatibility among managed offerings, including support for instance-scoped features like SQL Server Agent, CLR integration, database mail, Service Broker, and cross-database queries. This makes it the appropriate migration target for an existing SQL Server instance that depends on instance-level objects or features. Unlike single databases, it exposes a full SQL Server instance boundary, so logins, server roles, and instance-level permissions are preserved.

Why this answer

Azure SQL Managed Instance is the correct choice because it provides near 100% compatibility with SQL Server on-premises, including support for CLR integration and Database Mail, while still offering a platform-as-a-service (PaaS) model. Single databases and elastic pools lack these instance-scoped features, and Hyperscale is a scaling option for single databases, not a separate deployment type that adds instance-level functionality.

Exam trap

The trap here is that candidates often confuse Azure SQL Database Hyperscale as a separate deployment option that adds instance features, when in fact it is merely a scaling tier for single databases and does not enable CLR or Database Mail.

Why the other options are wrong

A

Azure SQL Database (single database) does not support CLR integration or database mail, which are required by the company for full instance-level functionality.

B

Azure SQL Database elastic pool does not support CLR integration or database mail, which are required for the migration. It also lacks full instance-level functionality, such as SQL Agent and cross-database queries.

D

Azure SQL Database Hyperscale is designed for large-scale, high-throughput workloads with fast scaling, but it does not support CLR integration or database mail, which require instance-level features only available in Azure SQL Managed Instance.

52
MCQmedium

A company uses Azure SQL Database for an e-commerce platform. The Orders table has columns: OrderID (primary key, clustered), CustomerID, OrderDate, TotalAmount. Queries frequently filter on CustomerID and a range of OrderDate, and then sort the results by OrderDate in descending order. The queries also return the TotalAmount column. Which indexing strategy will most improve query performance for these operations?

A.Create a nonclustered index on (CustomerID, OrderDate DESC) with included column TotalAmount
B.Create a nonclustered index on (OrderDate DESC, CustomerID) with included column TotalAmount
C.Change the clustered index to be on (CustomerID, OrderDate DESC)
D.Create a nonclustered index on (OrderDate DESC) without including TotalAmount
AnswerA

This index directly supports the filter on CustomerID and the range/order on OrderDate, and includes TotalAmount to avoid key lookups, making it the most efficient.

Why this answer

It creates a covering index that matches the query's filter predicates (CustomerID equality, OrderDate range) and sort order (OrderDate DESC). By including TotalAmount as an included column, the index fully satisfies the query without needing to access the clustered index (key lookup), minimizing I/O and improving performance.

Exam trap

The trap here is that candidates often choose an index with the sort column first (Option B) or forget to include the non-key column (Option D), not realizing that covering indexes with the correct key order eliminate expensive key lookups and sorts.

How to eliminate wrong answers

Option B is wrong because the leading column is OrderDate, which is less selective than CustomerID for equality filters, making the index less efficient for the primary filter on CustomerID. Option C is wrong because changing the clustered index to (CustomerID, OrderDate DESC) would require rebuilding the table and could impact other queries that rely on the current OrderID clustered index, and it would not eliminate key lookups for TotalAmount. Option D is wrong because it does not include TotalAmount, forcing key lookups to retrieve that column, and the index order (OrderDate DESC) does not support the equality filter on CustomerID efficiently.

53
MCQmedium

A company uses Azure SQL Database for a financial application. Regulatory compliance requires that database backups be retained for 7 years. The current configuration uses the default point-in-time restore (PITR) retention of 7 days. Which Azure SQL Database feature should the company enable to meet the 7-year retention requirement?

A.Long-term retention (LTR) for backups
B.Active geo-replication
C.Auto-failover groups
D.Geo-redundant backup storage
AnswerA

Long-term retention (LTR) enables you to retain full database backups for up to 10 years (or a custom period) in a separate storage container, independent of the automated point-in-time restore (PITR) backups. LTR policies are defined at the database or server level and can specify weekly, monthly, or yearly backup schedules. Because LTR stores these full backups in a dedicated vault and allows restores to any specific point within the retention window, it directly satisfies the 7-year compliance requirement for financial data.

Why this answer

Azure SQL Database's default point-in-time restore (PITR) retains backups for only 7 days, which is insufficient for the 7-year regulatory requirement. Long-term retention (LTR) allows you to retain full database backups for up to 10 years by configuring backup policies in the Azure portal or via T-SQL, meeting the compliance need.

Exam trap

The trap here is that candidates confuse geo-redundant storage (which improves durability) with long-term retention (which extends the retention period), leading them to pick Option D instead of A.

How to eliminate wrong answers

Option B is wrong because active geo-replication provides continuous data replication to a secondary region for disaster recovery, not extended backup retention. Option C is wrong because auto-failover groups manage automatic failover between primary and secondary databases for high availability, not backup retention. Option D is wrong because geo-redundant backup storage (RA-GRS) replicates backups to a paired region for durability but does not extend the retention period beyond the default 7-day PITR window.

54
MCQmedium

A company runs a global e-commerce application on Azure SQL Database. The application has a read-intensive workload with millions of users querying product details simultaneously. The database is experiencing high read latency during peak hours due to the volume of concurrent read requests. The company wants to scale read performance without changing the application code and without affecting write operations. Which Azure SQL Database feature should they implement?

A.Active geo-replication
B.Elastic pools
C.In-memory OLTP
D.Columnstore indexes
AnswerA

Active geo-replication allows you to create up to four readable secondary databases in the same or different regions. Application read queries can be directed to these secondaries, distributing the read load and improving performance without modifying application logic.

Why this answer

Active geo-replication creates readable secondary replicas of the Azure SQL Database in different Azure regions. By configuring read-only routing to these secondaries, the application can offload read queries from the primary database, scaling read performance without any code changes and without impacting write operations on the primary.

Exam trap

The trap here is that candidates often confuse Active geo-replication with failover groups or assume that In-memory OLTP can solve read latency, but the key requirement is scaling read performance without code changes, which only readable secondaries can achieve.

How to eliminate wrong answers

Option B is wrong because Elastic pools are designed to manage and share resources among multiple databases with varying usage patterns, not to offload read traffic from a single database. Option C is wrong because In-memory OLTP accelerates transaction processing by storing tables in memory, but it does not create separate read replicas to handle concurrent read queries. Option D is wrong because Columnstore indexes improve analytical query performance on large datasets, but they do not provide additional read capacity or offload read traffic from the primary database.

55
MCQmedium

A company has 15 SQL Server databases, ranging from 50 GB to 200 GB each. The databases experience unpredictable load spikes during the day. They want to migrate to Azure SQL Database to minimize management overhead and reduce costs by allowing databases to share resources, while ensuring each database can burst to higher performance when needed. Which deployment option should they choose?

A.A) Single database with Provisioned throughput tier
B.B) Elastic pool
C.C) SQL Managed Instance
D.D) SQL Server on Azure Virtual Machine
AnswerB

Elastic pool is correct because it aggregates compute and storage resources across the 15 databases, letting each database automatically consume up to the pool's configured limit during demand spikes. Under the vCore or DTU purchasing models, you pay for the pool's total resource ceiling, not per-database provisioning, which is ideal for workloads like these that are unpredictable but whose peaks do not align across all databases. This shared-resource model keeps costs lower while still guaranteeing a minimum performance level for every database through per-database min/max settings.

Why this answer

Elastic pools allow multiple databases to share a fixed pool of resources (DTUs or vCores), which reduces costs by pooling unused capacity and enables each database to automatically burst to higher performance when needed. This matches the company's need to minimize management overhead while handling unpredictable load spikes across 15 databases ranging from 50 GB to 200 GB.

Exam trap

The trap here is that candidates often confuse SQL Managed Instance's high compatibility with the ability to share resources, but Managed Instance does not support elastic pools and instead allocates dedicated resources per instance, making it unsuitable for cost-efficient resource sharing and bursting across multiple databases.

Why the other options are wrong

A

Single database with Provisioned throughput tier does not allow databases to share resources or enable bursting to higher performance without manual scaling; it isolates each database to its own fixed resources, increasing costs and management overhead.

C

SQL Managed Instance is designed for lift-and-shift migrations requiring near 100% compatibility with on-premises SQL Server, not for sharing resources across multiple databases with elastic bursting. It does not support elastic pools, so each database would have dedicated resources, increasing cost and management overhead.

D

SQL Server on Azure VMs requires manual management of OS, SQL Server, and scaling, which contradicts the goal of minimizing management overhead. It also cannot share resources across databases or provide elastic bursting without manual intervention.

56
MCQeasy

A startup is building a new mobile app that will track user fitness activities. They need a relational database to store user profiles, activity logs, and goals. The database must be easy to set up, require minimal administration, and automatically scale during peak usage. The startup has a limited budget and prefers a consumption-based pricing model. Which Azure service should they choose?

A.Azure Database for MySQL serverless
B.SQL Server on Azure Virtual Machines
C.Azure SQL Database serverless
D.Azure SQL Managed Instance
AnswerC

Serverless offers consumption-based pricing and auto-scaling.

Why this answer

Azure SQL Database serverless is the correct choice because it provides a consumption-based pricing model that automatically pauses during inactivity and scales compute resources based on demand, requiring minimal administration. This aligns perfectly with the startup's need for easy setup, minimal administration, automatic scaling during peak usage, and a limited budget.

Exam trap

The trap here is that candidates may confuse 'serverless' with 'PaaS' and choose Azure Database for MySQL serverless (Option A) because it also offers consumption-based pricing, but the question specifies a relational database for user profiles, activity logs, and goals, and Azure SQL Database serverless provides better integration with .NET and other Microsoft technologies commonly used in mobile app backends.

How to eliminate wrong answers

Option A is wrong because Azure Database for MySQL serverless, while consumption-based and serverless, is not a relational database service that natively integrates with the mobile app ecosystem as seamlessly as Azure SQL Database, and it lacks the same level of built-in features for activity logs and goals tracking that SQL Server provides. Option B is wrong because SQL Server on Azure Virtual Machines requires significant administration (patching, backups, scaling) and has a fixed pricing model (pay for provisioned VMs), not consumption-based, making it unsuitable for a startup with limited budget and minimal administration needs. Option D is wrong because Azure SQL Managed Instance is designed for lift-and-shift migrations with full SQL Server compatibility and is provisioned with fixed compute and storage, not consumption-based pricing, and it requires more administration than serverless options.

57
MCQmedium

A company uses Azure SQL Database for an e-commerce application. The Orders table contains columns: OrderID (int, primary key), CustomerID (int), OrderDate (datetime), TotalAmount (decimal). Queries frequently filter by both CustomerID and OrderDate to retrieve orders for a specific customer within a date range. Which indexing strategy will most improve the performance of these queries?

A.Create a clustered index on OrderID.
B.Create a nonclustered index on (CustomerID, OrderDate).
C.Create a nonclustered index on (OrderDate, CustomerID).
D.Create a nonclustered index on TotalAmount.
AnswerB

This composite nonclustered index is precisely tuned for queries that filter by a specific CustomerID and a range of OrderDate values. The leftmost key column CustomerID enables an equality seek, immediately narrowing the scan to that customer's rows, while OrderDate as the second key column lets SQL Server traverse a contiguous, ordered subset of the B-tree for the date range instead of scanning the entire table. Because the index stores both filter keys together, it also reduces the number of key lookups needed to retrieve the row data, making it the most efficient choice for the described e-commerce workload.

Why this answer

A nonclustered index on (CustomerID, OrderDate) directly supports the query filter that uses both columns. The index is ordered by CustomerID first, enabling SQL Server to quickly locate all rows for a specific customer, and then within that customer, the OrderDate column is ordered to efficiently scan the date range. This index covers the query's WHERE clause without needing to scan the entire table.

Exam trap

The trap here is that candidates often choose Option C, thinking that indexing the date column first is better for date range queries, but they overlook that the query filters by a specific customer first, making the customer column the more selective leading key for the index.

Why the other options are wrong

A

A clustered index on OrderID optimizes lookups by primary key but does not support filtering by CustomerID and OrderDate, leading to table scans for those queries.

C

The query filters by CustomerID first, then OrderDate. With index on (OrderDate, CustomerID), SQL Server cannot seek on CustomerID directly; it must scan or seek on OrderDate first, which is less selective for a specific customer, leading to more rows processed.

D

The query filters by CustomerID and OrderDate, not by TotalAmount. An index on TotalAmount does not help locate rows based on CustomerID or OrderDate, so it will not improve performance for these queries.

58
MCQmedium

You are designing a relational database for an IoT application that ingests high volumes of time-stamped sensor data. The queries frequently filter by device ID and time range. Which index strategy would optimize query performance?

A.Create a non-clustered index on Timestamp only
B.Create a composite index on (DeviceID, Timestamp)
C.Create a clustered index on DeviceID only
D.Create a non-clustered index on SensorType
AnswerB

A composite index on (DeviceID, Timestamp) directly matches the query's equality predicate on DeviceID and range predicate on Timestamp. The leftmost prefix rule lets the optimizer seek to the exact DeviceID value and then use the Timestamp column to efficiently navigate the range, retrieving only the relevant rows in sorted order. This minimizes both the number of index pages read and the associated key lookups, making it the ideal choice for high-volume IoT data where per-device temporal queries are frequent.

Why this answer

A composite index on (DeviceID, Timestamp) directly supports the two most common filter predicates in the query workload: DeviceID (for equality) and Timestamp (for range scans). In SQL Server, a composite index with DeviceID as the leading column allows the query engine to perform an index seek on DeviceID and then a range scan on Timestamp, minimizing I/O and avoiding key lookups. This strategy is optimal for time-series IoT data where queries almost always specify a device and a time window.

Exam trap

The trap here is that candidates often focus on indexing the most selective column (Timestamp) alone, forgetting that composite indexes with the equality column first are far more efficient for queries that filter on both an equality and a range predicate.

How to eliminate wrong answers

Option A is wrong because a non-clustered index on Timestamp only would require a full index scan or a scan of all timestamps, and then a filter on DeviceID, which is inefficient for high-volume IoT queries that always filter by DeviceID first. Option C is wrong because a clustered index on DeviceID only would physically order the table by DeviceID, but without Timestamp as part of the key, range queries on time would require scanning all rows for that device, defeating the purpose of a clustered index for time-range filtering. Option D is wrong because a non-clustered index on SensorType is irrelevant to the primary query filters (DeviceID and Timestamp) and would not optimize the stated workload; it might even cause unnecessary index maintenance overhead.

59
MCQmedium

A global e-commerce company uses Azure SQL Database for its product catalog. The database is hosted in the West US region. To ensure the catalog remains available if West US experiences an outage, the company wants to configure a secondary database in East US that can be used for reads and can be automatically promoted to primary during a disaster. They require a Recovery Point Objective (RPO) of less than 5 seconds and a Recovery Time Objective (RTO) of less than 30 minutes. Which feature should they implement?

A.Active geo-replication
B.Auto-failover groups
C.Geo-restore
D.Transactional replication
AnswerB

Auto-failover groups provide automatic failover to a secondary region, include a readable secondary, and meet the RPO of 5 seconds and RTO of 30 minutes.

Why this answer

Auto-failover groups (Option B) are the correct choice because they provide automatic, orchestrated failover of a primary Azure SQL Database to a secondary region (East US) during an outage, meeting the RPO of less than 5 seconds (typically 5–10 seconds for active geo-replication) and RTO of less than 30 minutes (usually under 1 hour). The secondary database can be used for read-only queries, and the failover group ensures the entire group of databases fails over as a unit, maintaining the same connection string.

Exam trap

The trap here is that candidates confuse active geo-replication with auto-failover groups, assuming both provide automatic failover, but only auto-failover groups offer the orchestrated, automatic promotion required for the specified RTO.

Why the other options are wrong

A

Active geo-replication provides a readable secondary database with an RPO of less than 5 seconds, but it does not support automatic failover; manual failover is required, which cannot guarantee an RTO under 30 minutes.

C

Geo-restore restores a database from a geo-replicated backup, but it does not provide a readable secondary or automatic failover; RTO can be hours, not under 30 minutes, and RPO is typically 1 hour, not under 5 seconds.

D

Transactional replication does not support automatic failover or RTO under 30 minutes; it requires manual intervention to promote a secondary and typically has higher latency, making it unsuitable for the sub-5-second RPO and sub-30-minute RTO requirements.

60
Multi-Selectmedium

Which TWO Azure services can be used to host a relational database that requires native support for JSON data and high availability with automatic failover?

Select 2 answers
A.Azure SQL Database
B.Azure Database for MariaDB
C.Azure SQL Managed Instance
D.Azure Cosmos DB
E.Azure Database for PostgreSQL
AnswersA, C

Correct: Azure SQL Database provides native JSON functions and automatic failover as part of its high-availability architecture.

Why this answer

Azure SQL Database and Azure SQL Managed Instance both support native JSON functions (e.g., JSON_VALUE, JSON_QUERY) and provide high availability with automatic failover through built-in mechanisms. Azure Database for PostgreSQL supports JSON via the jsonb data type, but the exam emphasizes Azure SQL services for relational JSON capabilities. Azure Cosmos DB is NoSQL, and Azure Database for MariaDB lacks native JSON support.

Exam trap

Candidates often choose Azure Database for PostgreSQL because it supports JSON, but the exam expects the two Azure SQL services (Azure SQL Database and Azure SQL Managed Instance) as the primary relational databases with native JSON and automatic failover.

61
MCQmedium

A company uses Azure SQL Database for its order management system. The database has a table named Orders with columns OrderID (INT, PRIMARY KEY), CustomerID (INT), OrderDate (DATE), TotalAmount (DECIMAL). Queries that filter by OrderDate are slow. The database administrator observes that the nonclustered index on OrderDate has high fragmentation and many page splits. Which action will most likely improve query performance for these date-based queries?

A.Rebuild the nonclustered index on OrderDate with a FILLFACTOR of 80.
B.Change the data type of TotalAmount from DECIMAL to FLOAT.
C.Remove the clustered index on OrderID and create a clustered index on OrderDate.
D.Add a columnstore index on the OrderDate column.
AnswerA

Rebuilding the nonclustered index on OrderDate with a FILLFACTOR of 80 is correct because it compacts the index while reserving 20 percent free space in each leaf-level page. This free space accommodates the page splits that frequently occur when new orders are inserted with OrderDate values that fall between existing rows. By reducing page splits, you also reduce logical and extent fragmentation, which lowers I/O for range scans and keeps index performance predictable as new orders accumulate.

Why this answer

Rebuilding the nonclustered index on OrderDate with a FILLFACTOR of 80 reduces page splits by leaving free space in each leaf-level page. This accommodates future insertions and updates that modify the OrderDate values, lowering fragmentation and improving query performance for date-based filters.

Exam trap

The trap here is that candidates may think changing the clustered index to OrderDate (Option C) is the best solution, but they overlook that this would disrupt the primary key and cause even more fragmentation for a table with frequent inserts, whereas rebuilding with a lower fill factor directly addresses page splits without altering the table's physical design.

How to eliminate wrong answers

Option B is wrong because changing TotalAmount from DECIMAL to FLOAT does not address fragmentation or page splits on the OrderDate index; it could introduce rounding errors and is irrelevant to date-based query performance. Option C is wrong because removing the clustered index on OrderID (the primary key) and creating a clustered index on OrderDate would reorganize the entire table by date, which might improve range scans but would severely degrade point lookups by OrderID and cause excessive page splits due to non-sequential date inserts; it is not the most targeted fix. Option D is wrong because a columnstore index is designed for analytical/aggregation workloads on large tables, not for improving point lookup or range filter performance on a single column in an OLTP system; it would add overhead without addressing fragmentation.

62
MCQmedium

A company is designing a multi-tenant SaaS application. Each tenant has its own relational database, but the total number of tenants is expected to grow rapidly. The company wants to manage all databases efficiently and optimize costs by sharing resources among tenants with low usage. What should they use?

A.SQL Server on Azure Virtual Machines
B.Azure SQL Managed Instance
C.Azure Database for MySQL with elastic pools
D.Azure SQL Database elastic pools
AnswerD

Azure SQL Database elastic pools are designed specifically for multi-tenant SaaS: you purchase a shared pool of eDTUs or vCores and place each tenant in its own database inside that pool. Each database is assigned a minimum and maximum resource limit, allowing idle tenants to contribute unused capacity to busy tenants while still guaranteeing a base level of performance. This automatically balances cost and performance across thousands of small, intermittently active tenant workloads, making it the ideal choice for this scenario.

Why this answer

Elastic pools in Azure SQL Database allow sharing resources among multiple databases, optimizing cost for low-usage tenants in a multi-tenant SaaS application. Option A (SQL Server on Azure Virtual Machines) requires manual resource management and does not offer elastic pools. Option B (Azure SQL Managed Instance) is designed for single large databases, not for sharing resources across many databases.

Option C (Azure Database for MySQL) does not have elastic pools; elastic pools are a feature of Azure SQL Database.

63
MCQmedium

A company has an existing on-premises SQL Server database that is 500 GB in size. The database uses SQL Server Agent jobs for scheduled maintenance and linked servers to query data from a remote SQL Server instance. The company wants to migrate to Azure with minimal application changes and needs automated backups and patching. Which Azure SQL service should they choose?

A.Azure SQL Database
B.Azure SQL Managed Instance
C.SQL Server on Azure Virtual Machines
D.Azure Database for PostgreSQL
AnswerB

Azure SQL Managed Instance provides high compatibility with on-premises SQL Server, including support for SQL Agent jobs and linked servers. It also includes automated backups, patching, and high availability, meeting all requirements.

Why this answer

Azure SQL Managed Instance is correct because it provides near 100% compatibility with on-premises SQL Server, including support for SQL Server Agent jobs and linked servers, while offering automated backups and patching. This minimizes application changes during migration, unlike other Azure SQL options that lack these features.

Exam trap

The trap here is that candidates often choose Azure SQL Database for its simplicity, overlooking its lack of SQL Server Agent and linked server support, which are critical for the described workload.

Why the other options are wrong

A

Azure SQL Database does not support SQL Server Agent jobs or linked servers, which are required by the existing on-premises database. The migration would require significant application changes to remove these dependencies.

C

SQL Server on Azure VMs requires manual patching and backup management, and does not provide automated patching and backups as required by the question.

D

Azure Database for PostgreSQL is a non-SQL Server database service, so it does not support SQL Server Agent jobs, linked servers, or the T-SQL surface area required for minimal application changes from an existing SQL Server database.

64
MCQmedium

A financial application stores transactions in an Azure SQL Database table with columns: TransactionID (clustered index), AccountID, TransactionDate, Amount. Queries frequently filter on AccountID and TransactionDate together. The table contains millions of rows. Which index strategy will most improve query performance for these filters?

A.Clustered index on (AccountID, TransactionDate)
B.Nonclustered index on (TransactionDate)
C.Nonclustered index on (AccountID) INCLUDE (TransactionDate)
D.Nonclustered index on (AccountID, TransactionDate)
AnswerD

This composite nonclustered index uses AccountID as the leading key, allowing the query optimizer to seek directly to the index entries for the requested account. Within that account, TransactionDate is the second key column, so the index can perform an ordered range scan to retrieve only the rows whose transaction date falls within the specified window. Because the index contains both columns in its key, it can cover this query without returning to the clustered index, minimizing logical reads and making it the most efficient choice for the described filter.

Why this answer

Creates a nonclustered index on (AccountID, TransactionDate) that acts as a covering index for queries filtering on both columns. SQL Server can seek directly to the matching rows using the composite key order, avoiding a full table scan or key lookup. This is the most efficient strategy because the index is sorted by AccountID first, then TransactionDate, matching the query predicate exactly.

Exam trap

The trap here is that candidates often choose Option A (changing the clustered index) because they think it will be faster for all queries, but they overlook the negative impact on the existing primary key and the fact that a nonclustered covering index is sufficient and less disruptive.

How to eliminate wrong answers

Option A is wrong because changing the clustered index to (AccountID, TransactionDate) would reorganize the entire table's physical order, potentially harming performance for other queries that rely on the existing TransactionID clustered index (e.g., range scans or joins on TransactionID). Option B is wrong because a nonclustered index on TransactionDate alone cannot efficiently filter on AccountID; it would require scanning all rows for each AccountID or performing a key lookup for each match. Option C is wrong because a nonclustered index on AccountID with TransactionDate as an included column only helps when filtering solely on AccountID; it does not support seeking on both columns together, as the included column is not part of the index key and cannot be used for range or equality filtering on TransactionDate.

65
MCQmedium

A DBA runs the following KQL query in Azure Monitor for an Azure SQL Database: `AzureDiagnostics | where Category == 'QueryStoreRuntimeStatistics'`. The query returns no results. What is the most likely reason?

A.Query Store is not enabled on the database
B.The AzureDiagnostics table does not contain SQL data
C.The category name is misspelled
D.The KQL syntax is incorrect
AnswerA

Query Store is the SQL Server and Azure SQL Database feature that captures runtime query metrics such as CPU, duration, and execution counts. The QueryStoreRuntimeStatistics table is populated only when Query Store has been enabled for the database; if it has never been turned on, no rows are written to that table and the KQL query correctly returns an empty result set. Enable Query Store with ALTER DATABASE ... SET QUERY_STORE = ON to begin collecting this telemetry.

Why this answer

That Query Store is not enabled on the database. Query Store must be enabled for each database to capture and store query runtime statistics. The KQL query likely targets the Query Store data, which requires Query Store to be active.

Option B is incorrect because AzureDiagnostics can contain SQL data, but the issue is that the query is looking for Query Store data, not diagnostics. Option C is incorrect because the category name is correct in the query. Option D is incorrect because the KQL syntax is valid.

66
MCQhard

A multinational e-commerce company uses Azure SQL Database active geo-replication to replicate a critical inventory database to a secondary region. During a regional outage, the application automatically fails over to the secondary database. After the primary region recovers, the administrator wants to make the original primary the main database again without losing any data modifications made on the secondary during the outage. What should the administrator do?

A.Drop the geo-replication relationship, then recreate the secondary from the current primary.
B.Perform a forced failover to switch back to the original primary.
C.Initiate a planned failover to switch back to the original primary.
D.Delete the secondary database and restore the original primary from a backup taken before the outage.
AnswerC

A planned failover (graceful failover) synchronizes all data between replicas before switching roles, ensuring zero data loss.

Why this answer

A planned failover (also known as graceful failover) in Azure SQL Database active geo-replication is designed to switch roles between the primary and secondary databases without data loss. After the original primary region recovers, initiating a planned failover synchronizes all data from the current primary (the former secondary) to the original primary, making it the new primary while preserving all modifications made during the outage. This operation ensures zero data loss because it forces a final synchronization before the role swap.

Exam trap

The trap here is confusing a planned failover (graceful, no data loss) with a forced failover (unplanned, potential data loss), leading candidates to incorrectly choose Option B when they need to preserve all modifications made on the secondary during an outage.

How to eliminate wrong answers

Option A is wrong because dropping the geo-replication relationship and recreating the secondary from the current primary would discard the original primary's data modifications made during the outage, as the original primary would be overwritten by the current primary's data. Option B is wrong because a forced failover (also called unplanned failover) is intended for disaster scenarios and can cause data loss; it does not perform a final synchronization and would not guarantee that all modifications from the secondary are preserved when switching back. Option D is wrong because deleting the secondary database and restoring the original primary from a backup taken before the outage would lose all data modifications made on the secondary during the outage, defeating the purpose of geo-replication for high availability.

67
MCQmedium

A company uses Azure SQL Database for an order management system. They have a table 'Orders' with columns: OrderID (PK), CustomerID, OrderDate, TotalAmount. Queries that filter on OrderDate are slow. They create a nonclustered index on OrderDate. However, after many inserts, the index becomes fragmented and page splits occur frequently. Which action should the DBA take to maintain query performance?

A.Rebuild the index online
B.Drop and recreate the index
C.Add a clustered index on OrderDate
D.Change the index to a clustered columnstore index
AnswerA

Rebuilding the index online is the best approach because it eliminates fragmentation caused by page splits and logical ordering issues without locking the underlying table for the entire operation. Azure SQL Database supports the ONLINE option for both clustered and nonclustered index rebuilds, allowing concurrent user queries to continue during the rebuild. This minimizes downtime for the order management system while restoring the index's B-tree structure to a defragmented state.

Why this answer

Rebuilding the index online eliminates fragmentation and page splits without blocking concurrent queries, which is critical for a production order management system. The ALTER INDEX REBUILD operation reorganizes the index B-tree structure, consolidating pages and reducing logical fragmentation, thereby restoring query performance on OrderDate filters.

Exam trap

The trap here is that candidates often confuse index maintenance actions, thinking a drop/recreate is simpler, or they incorrectly assume a clustered index on the filtered column always improves performance, ignoring the impact on write-heavy OLTP workloads.

How to eliminate wrong answers

Option B is wrong because dropping and recreating the index is a heavier operation that requires exclusive locks, causing downtime; it also loses any index metadata or statistics that might be in use, and the same effect can be achieved with a rebuild. Option C is wrong because adding a clustered index on OrderDate would physically reorder the entire table by that column, which could improve range scans but would also slow down inserts due to page splits on the clustered key, and it changes the table's physical structure unnecessarily. Option D is wrong because a clustered columnstore index is designed for large-scale analytical workloads (data warehousing) and is not suitable for an OLTP order management system with frequent inserts and point lookups; it would degrade performance for the typical order queries.

68
MCQmedium

A company uses Azure SQL Database for an employee management system. The Employees table has 10 million rows and a clustered index on EmployeeID (the primary key). Queries that filter employees by Department and then sort by HireDate are very slow. Which indexing strategy will most improve performance for these queries?

A.Create a nonclustered index on (Department, HireDate) and include the other needed columns as included columns.
B.Create a nonclustered index on (HireDate, Department) with no included columns.
C.Create a clustered index on Department.
D.Drop the existing clustered index and recreate a clustered columnstore index.
AnswerA

This index creates a composite key with Department as the leading column, allowing precise seeks for the equality filter, while HireDate as the second key column ensures rows are read in the exact sort order required by ORDER BY, eliminating a separate sort operator. By adding all other columns referenced in the query (such as employee details and salary) as included columns, the index becomes a covering index; the storage engine can return every required column directly from the index pages without performing expensive key lookups to the clustered index, drastically reducing I/O and providing optimal performance for this selective, sorted retrieval pattern.

Why this answer

A nonclustered index on (Department, HireDate) with included columns is optimal because it supports both the WHERE clause filter on Department and the ORDER BY on HireDate as a covering index. The index key order matches the query's filter and sort requirements, allowing SQL Server to perform a single index seek and avoid key lookups by including all needed columns. This eliminates the need to scan the clustered index or sort rows after filtering.

Exam trap

The trap here is that candidates often choose Option B because they think any index on both columns will help, but they overlook that the key column order must match the WHERE clause filter first to enable an efficient seek, not just the sort order.

How to eliminate wrong answers

Option B is wrong because the index key order (HireDate, Department) does not match the query filter on Department first, so SQL Server cannot efficiently seek on Department; it would require scanning or sorting. Option C is wrong because creating a clustered index on Department would reorder the entire table by Department, which is not the primary key and would break the existing clustered index on EmployeeID, likely degrading other queries and not directly optimizing the sort on HireDate. Option D is wrong because a clustered columnstore index is designed for large-scale analytical workloads (data warehousing) and not for point lookups or ordered retrieval in an OLTP employee management system; it would worsen performance for the described query pattern.

69
MCQhard

Refer to the exhibit. You create an external table in Azure SQL Database. Which data source is being used?

A.Azure Blob Storage
B.Azure Files
C.Azure SQL Database
D.Azure Data Lake Storage Gen2
AnswerA

The location string 'https://mystorageaccount.blob.core.windows.net/container' uses the blob.core.windows.net service endpoint, which is the unique DNS suffix for Azure Blob Storage. When you create an external table in Azure SQL Database or Azure Synapse Analytics, you define an external data source with a LOCATION that points to a Blob Storage path. Because the exhibit clearly shows this endpoint, the underlying service must be Azure Blob Storage.

Why this answer

The exhibit shows an external table referencing a data source with the LOCATION set to 'https://mystorage.blob.core.windows.net/...', which is the endpoint for Azure Blob Storage. In Azure SQL Database, external tables are created over external data sources that point to Azure Blob Storage or Azure Data Lake Storage, but the URL format 'blob.core.windows.net' specifically indicates Azure Blob Storage. The CREATE EXTERNAL TABLE statement uses this data source to read data stored as files (e.g., CSV, Parquet) in the blob container.

Exam trap

The trap here is that candidates confuse Azure Blob Storage with Azure Data Lake Storage Gen2 because both can store files, but the endpoint URL (blob.core.windows.net vs. dfs.core.windows.net) is the key differentiator in the exhibit.

How to eliminate wrong answers

Option B is wrong because Azure Files uses the file.core.windows.net endpoint and is accessed via SMB protocol, not the blob.core.windows.net URL shown in the exhibit. Option C is wrong because Azure SQL Database itself cannot be the data source for an external table in the same database; external tables reference external data sources like Blob Storage or Data Lake, not another SQL database. Option D is wrong because Azure Data Lake Storage Gen2 uses the dfs.core.windows.net endpoint (or a blob endpoint with a hierarchical namespace), not the standard blob.core.windows.net URL shown in the exhibit.

70
MCQhard

A company runs an e-commerce application on Azure SQL Database. The database experiences high transaction volume during business hours (9 AM to 6 PM) but very low activity at night and on weekends. They want to optimize costs by paying only for the compute resources used, while ensuring the database can automatically scale up during peak periods and scale down (or pause) during idle times. Which Azure SQL Database purchasing model and compute tier should they choose?

A.DTU-based purchasing model
B.vCore-based purchasing model with provisioned compute tier
C.vCore-based purchasing model with serverless compute tier
D.vCore-based purchasing model with Hyperscale service tier
AnswerC

The vCore-based serverless compute tier is the right fit because it provisions compute capacity for Azure SQL Database that autonomously scales between a configurable minimum and maximum number of vCores based on demand. During periods of low or no activity—such as nights and weekends—the service can scale down to the minimum vCores or fully pause the database, after which billing for compute stops entirely while storage and backups continue to be charged at their own rates. When traffic returns, it resumes automatically, enabling peak-load handling without paying for idle capacity. This directly minimizes costs over a variable workload while preserving compatibility with the vCore architecture.

Why this answer

The vCore-based purchasing model with serverless compute tier is correct because it automatically scales compute resources based on workload demand and can pause during idle periods, charging only for consumed compute and storage. This matches the requirement of high transaction volume during business hours and low activity at night/weekends, optimizing costs by eliminating charges for unused compute capacity.

Exam trap

The trap here is that candidates often confuse the Hyperscale service tier with serverless, but Hyperscale focuses on storage scalability and fast recovery, not compute auto-scaling or pausing, making it unsuitable for cost optimization during idle periods.

Why the other options are wrong

A

The DTU-based purchasing model does not support automatic scaling or pause/resume capabilities; it requires manual scaling or fixed tiers, making it unsuitable for the described variable workload.

B

The vCore-based provisioned compute tier requires manual scaling or scheduled scaling, not automatic scaling based on demand, and does not support pausing during idle times, so it cannot automatically scale down or pause during low activity.

D

The Hyperscale service tier is designed for very large databases (up to 100 TB) with high scalability and fast backup/restore, not for cost optimization through automatic scaling and pausing during idle periods. It does not support the serverless compute model that automatically pauses during inactivity.

71
MCQmedium

A company runs a customer-facing web application that uses an Azure SQL Database. The database experiences highly variable workloads: high traffic during business hours and low traffic at night and on weekends. The company wants to pay only for the compute resources consumed and automatically scale compute capacity based on demand, while maintaining the ability to pause during inactivity. Which Azure SQL Database service tier should they choose?

A.Hyperscale
B.Serverless
C.Provisioned (General Purpose)
D.Business Critical
AnswerB

The Serverless compute tier for Azure SQL Database dynamically scales compute resources between a minimum and maximum vCore range and automatically pauses an idle database—typically after one hour of inactivity—while billing only for the vCores consumed per second. This model is ideal for intermittent, variable workloads where demand fluctuates unpredictably, as it eliminates the cost of maintaining idle capacity. Unlike the other provisioned tiers, it does not charge for compute when paused, only for storage.

Why this answer

The Serverless tier is designed for workloads with variable traffic and idle periods, as it automatically scales compute resources based on demand and can pause the database during inactivity, charging only for consumed compute and storage. This matches the requirement to pay only for resources used and to pause when there is no traffic, such as at night and weekends.

Exam trap

The trap here is that candidates may confuse the Serverless tier's auto-scaling and pausing with the Hyperscale tier's storage scalability, but Hyperscale does not support compute pausing and is designed for continuous high-throughput workloads, not variable demand with idle periods.

Why the other options are wrong

A

Hyperscale is designed for very large databases (up to 100 TB) and high throughput, not for variable workloads with auto-pause and pay-per-use compute. It does not support the serverless compute model that pauses during inactivity.

C

Provisioned (General Purpose) does not support automatic scaling based on demand or the ability to pause during inactivity; it requires manual scaling and always runs, incurring costs even when idle.

D

Business Critical is designed for low-latency, high-availability workloads with provisioned compute, not for auto-scaling or pausing based on demand. It does not support the serverless compute model that automatically scales and pauses during inactivity.

72
MCQmedium

A company runs an e-commerce application on Azure SQL Database. The Orders table has millions of rows. Queries that filter on CustomerID and order by OrderDate DESC are slow. The table currently has a clustered index on OrderID (the primary key). Which indexing strategy will most improve performance for these queries?

A.Create a nonclustered index on CustomerID including OrderDate.
B.Create a nonclustered index on (CustomerID, OrderDate DESC) with included columns for other needed columns.
C.Rebuild the clustered index to be on CustomerID.
D.Create a nonclustered index on OrderDate.
AnswerB

This is the correct design because it creates a covering, composite index whose leftmost key column matches the equality filter on CustomerID, while the second key column OrderDate is flagged DESC to match the ORDER BY direction. The query optimizer can perform an index seek on CustomerID and then read rows from the index in exactly the required sort order, eliminating the sort operator entirely. By including any additional columns referenced in the SELECT list, the index becomes covering, avoiding expensive lookups back to the clustered index.

Why this answer

Creating a nonclustered index on (CustomerID, OrderDate DESC) with included columns allows the query to filter on CustomerID and sort by OrderDate in descending order using a single index seek, avoiding a sort operation. This leverages the index's key order to directly return rows in the desired order, which is critical for performance on large tables in Azure SQL Database.

Exam trap

The trap here is that candidates often think including a column in an index (as an included column) is sufficient for sorting, but only key columns determine the physical order of rows in the index, so a nonclustered index with OrderDate as an included column cannot eliminate the need for a sort operation.

How to eliminate wrong answers

Option A is wrong because including OrderDate as an included column does not make it part of the index key, so the index cannot provide sorted output for OrderDate DESC; the database would still need to perform a sort after filtering on CustomerID. Option C is wrong because rebuilding the clustered index on CustomerID would force the table to be physically ordered by CustomerID, which may help filtering but would not efficiently support ordering by OrderDate DESC, and it could degrade other queries that rely on the primary key OrderID. Option D is wrong because a nonclustered index on OrderDate alone does not support filtering on CustomerID, requiring a full scan or key lookup for each row, which is inefficient for millions of rows.

73
MCQeasy

A startup is building a new application and needs a relational database that supports JSON data, automatic scaling, and a serverless compute tier to minimize costs during low usage periods. Which Azure data service should they choose?

A.Azure Database for PostgreSQL serverless
B.Azure Cosmos DB
C.Azure SQL Database serverless tier
D.Azure SQL Managed Instance
AnswerC

Azure SQL Database serverless supports JSON, auto-scaling, and pauses when idle.

Why this answer

Azure SQL Database serverless tier is a relational database that supports JSON data, offers automatic scaling, and pauses during idle periods to reduce costs. Option A is incorrect because Azure Database for PostgreSQL serverless, while relational and supporting JSON, does not have the same level of automatic scaling and serverless compute optimization as Azure SQL Database serverless. Option B is incorrect because Azure Cosmos DB is a NoSQL database, not relational.

Option D is incorrect because Azure SQL Managed Instance does not have a serverless tier.

74
MCQeasy

A company needs to migrate a large on-premises SQL Server database to Azure. The migration must have minimal downtime and support ongoing replication. Which Azure service should they use?

A.Azure Data Box
B.Azure Data Factory
C.Azure SQL Database
D.Azure Database Migration Service
AnswerD

Azure Database Migration Service (DMS) is the correct choice because it provides online migration capabilities with minimal downtime for on-premises SQL Server databases. DMS performs an initial data and schema copy, then continuously replicates ongoing changes using transaction log shipping, allowing you to cut over only when you are ready. This near-zero downtime approach satisfies the requirement for migrating a large database without an extended outage.

Why this answer

Azure Database Migration Service (DMS) is designed for online migrations with minimal downtime, supporting ongoing replication from SQL Server to Azure SQL Database. It uses the Data Migration Assistant (DMA) for assessment and the Azure DMS for continuous sync, enabling near-zero downtime during cutover.

Exam trap

The trap here is that candidates confuse the target service (Azure SQL Database) with the migration tool, or assume Data Factory can handle live replication, when in fact only DMS provides the necessary online migration and ongoing sync capabilities.

How to eliminate wrong answers

Option A is wrong because Azure Data Box is a physical data transfer appliance for offline bulk data migration, not suitable for minimal downtime or ongoing replication. Option B is wrong because Azure Data Factory is an ETL and orchestration service for data movement and transformation, not a dedicated migration tool with built-in replication and minimal downtime capabilities. Option C is wrong because Azure SQL Database is the target platform, not a migration service; it does not handle the migration process or replication itself.

75
MCQmedium

A company uses Azure SQL Database for an e-commerce platform. The 'Orders' table has millions of rows with columns OrderID (primary key), CustomerID, OrderDate, and TotalAmount. Queries often filter by CustomerID (equality) and OrderDate (range). Currently, these queries are slow. Which index should be created to improve performance?

A.A nonclustered index on OrderID
B.A nonclustered index on (CustomerID, OrderDate)
C.A nonclustered index on OrderDate
D.A clustered index on CustomerID
AnswerB

This composite index covers the query predicate perfectly. CustomerID is the equality column, and OrderDate is the range column. The index allows the database engine to efficiently locate rows for a specific customer and then scan a small range of dates.

Why this answer

The query pattern filters by CustomerID (equality) and OrderDate (range). A composite nonclustered index on (CustomerID, OrderDate) allows SQL Database to seek directly to the matching CustomerID rows and then efficiently scan the ordered OrderDate range within that partition, avoiding a full table scan or key lookup. This index order leverages the index's B-tree structure for both equality and range predicates.

Exam trap

The trap here is that candidates often choose a single-column index on OrderDate (Option C) thinking it covers the range filter, but they overlook that without CustomerID as the leading key, the index cannot efficiently narrow down to a specific customer, resulting in a full index scan instead of a seek.

Why the other options are wrong

A

OrderID is the primary key and likely already has a clustered index. Adding a nonclustered index on OrderID does not help queries filtering by CustomerID and OrderDate, as it does not cover those columns.

C

An index on OrderDate alone would not efficiently support queries filtering by both CustomerID and OrderDate, as it cannot narrow down the search by CustomerID first, leading to unnecessary index scans.

D

A clustered index on CustomerID would physically reorder the entire table by CustomerID, which is not the primary key. This could disrupt the existing primary key structure and may not efficiently support range queries on OrderDate, as the data would be sorted by CustomerID first.

Page 1 of 3 · 188 questions totalNext →

Ready to test yourself?

Try a timed practice session using only Identify Considerations For Relational Data On Azure questions.