200-901 Application Deployment and Security Practice Question
A developer is implementing secure coding practices to prevent SQL injection. Which approach is most effective when building a SQL query with user input?
⚠ Common exam trap
200-901 often tests the misconception that escaping or input validation is equivalent to parameterization — candidates must recognize that only prepared statements structurally separate code from data, making them the definitive fix.
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
✓
Using parameterized queries with prepared statements
Parameterized queries with prepared statements separate SQL code from user-supplied data, so the database treats input strictly as data and never as executable SQL. This eliminates the root cause of SQL injection because the query structure is fixed and parsed before parameters are bound. It is the most robust and recommended defense across all major database platforms.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Validating user input to allow only alphanumeric characters
Why it's wrong here
Allowlisting alphanumerics breaks legitimate input such as names, emails and free text, and does not protect numeric or quoted contexts where injection still occurs. It is tempting because strict validation feels defensive. Parameterised queries with bound placeholders remain the primary control, since they separate SQL structure from user-supplied values at execution.
- ✓
Using parameterized queries with prepared statements
Why this is correct
Parameterised queries with prepared statements send SQL structure and user input separately, so input is bound as data and never parsed as executable SQL. That mechanism neutralises injection regardless of input content, satisfying the secure-coding requirement more reliably than escaping or validation alone.
- ✗
Storing user input in a database before using it in a query
Why it's wrong here
Storing input first changes nothing: the value is still concatenated into the query later, so injection remains possible. It is tempting because persistence feels like sanitisation, but the database simply holds the malicious string intact. Parameterised queries with bound placeholders are required, since they separate code from data at execution.
- ✗
Escaping all user input with a function like mysqli_real_escape_string
Why it's wrong here
Escaping is error-prone: it depends on correct charset, connection encoding and consistent application, and a single missed call reintroduces injection. It is tempting because it appears to neutralise quotes directly. Parameterised queries with bound parameters are the effective control, as the database treats input strictly as data, never executable SQL.
Go deeper
Related to this question
About these practice questions
This 200-901 question is part of Courseiva's 975-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Cisco exam blueprint
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.