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?
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 separate SQL code from data, preventing injection. Input validation helps but not sufficient alone. Stored procedures can help but parameterized queries are standard. Escaping is error-prone.
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
Validation reduces risk but is not foolproof; parameterized queries are better.
- ✓
Using parameterized queries with prepared statements
Why this is correct
Parameterized queries ensure input is treated as data, not executable code.
- ✗
Storing user input in a database before using it in a query
Why it's wrong here
Still vulnerable if the retrieval does not use parameterized queries.
- ✗
Escaping all user input with a function like mysqli_real_escape_string
Why it's wrong here
Escaping can be bypassed and is not recommended as primary defense.
Go deeper
Related to this question
About these practice questions
This 200-901 question is part of Courseiva's 989-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 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.