Courseiva

200-901 Application Deployment and Security Practice Question

A developer needs to prevent SQL injection in a web application. Which coding practice should be used when constructing database queries?

⚠ Common exam trap

Cisco often tests the distinction between input validation and parameterized queries, trapping candidates who think sanitizing input is sufficient, when the secure standard is to use parameterized queries to enforce separation of code and data.

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

✓

Parameterized queries

Parameterized queries (also known as prepared statements) separate SQL logic from data by using placeholders (e.g., `?` in MySQLi or `:name` in PDO). This ensures user input is always treated as data, never as executable SQL code, effectively neutralizing SQL injection attacks regardless of the input content.

Answer analysis

Option-by-option breakdown

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

  • ✗

    CSRF tokens

    Why it's wrong here

    CSRF tokens verify that a state-changing request originated from the legitimate user's session, defending against forged cross-site requests rather than injection. They are correct when the stem describes an attacker tricking an authenticated browser into submitting an unwanted action.

  • ✗

    Output encoding

    Why it's wrong here

    Output encoding escapes data rendered into HTML, preventing cross-site scripting, but it does not alter how SQL statements are assembled, so injected input still reaches the query parser. It is correct when the stem concerns safely displaying untrusted data in a browser response.

  • ✗

    Input validation

    Why it's wrong here

    Input validation rejects malformed or unexpected values but cannot guarantee that remaining input is treated as data rather than SQL syntax, so crafted payloads can still alter query structure. It is correct when the stem requires enforcing expected formats, types or ranges on user-supplied fields.

  • ✓

    Parameterized queries

    Why this is correct

    Parameterised queries separate SQL code from user-supplied values, so input is treated as data rather than executable SQL. This neutralises injection payloads because the database parses the statement before binding parameters, unlike string concatenation or escaping.

About these practice questions

One of 975 original 200-901 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 200-901 practice question is part of Courseiva's free Cisco 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 200-901 exam.