Courseiva

DP-300 Implement a secure environment Practice Question

You are configuring security for an Azure SQL Database that will be used by a web application. The application uses a connection string with SQL authentication. You need to protect the database from SQL injection attacks. Which two measures should you implement? (Choose two.)

⚠ Common exam trap

Test-takers frequently confuse data-at-rest or data-masking features (TDE, DDM, Always Encrypted) with injection prevention, when in fact only query-level controls like parameterized queries and validated stored procedures directly mitigate SQL injection.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Use parameterized queries in the application.

Parameterized queries ensure that user input is treated as data, not executable code, by separating SQL logic from input values. This prevents attackers from injecting malicious SQL statements into the query string, which is the primary defense against SQL injection attacks.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Enable Transparent Data Encryption (TDE).

    Why it's wrong here

    TDE encrypts data at rest, protecting files and backups, but does nothing against injection, which exploits query logic. Parameterised queries and least-privilege accounts address injection. TDE would be correct for meeting encryption-at-rest compliance, not for preventing SQL injection.

  • ✓

    Use parameterized queries in the application.

    Why this is correct

    Parameterised queries send user input as bound parameters rather than concatenated SQL text, so the database treats injected payloads as data, never executable code. This directly neutralises the injection vector in the application's SQL-authenticated connection string.

  • ✗

    Configure Dynamic Data Masking (DDM).

    Why it's wrong here

    DDM masks data in query results but does not stop injection; it only obscures returned values. Parameterised queries and input validation prevent injection. DDM would be correct when hiding sensitive columns from non-privileged users, not for blocking SQL injection.

  • ✓

    Implement stored procedures with input validation.

    Why this is correct

    Stored procedures with input validation constrain executable SQL to predefined statements, so injected payloads cannot alter query structure. This complements parameterisation by enforcing validation server-side, satisfying the requirement to protect the SQL-authenticated database from injection.

  • ✗

    Enable Always Encrypted on sensitive columns.

    Why it's wrong here

    Always Encrypted protects column data from the database engine, but injection still executes against query logic. Parameterised queries and input validation prevent injection. Always Encrypted would be correct when keeping sensitive columns unreadable to DBAs, not for blocking injection.

Go deeper

Related to this question

About these practice questions

One of 574 original DP-300 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DP-300 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DP-300 exam.