🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: SQL Injection: all 10 questions

Quiz: SQL Injection · Question 2 of 10

What is the correct fix for SQL injection?

What is the correct fix for SQL injection?

  1. A.Remove spaces from input
  2. B.Hide error messages
  3. C.Parameterised queries (prepared statements)
  4. D.Use HTTPS
Answer & explanation

Correct answer: Parameterised queries (prepared statements)

Placeholders send data separately from the SQL, so data can never become code. Hiding errors helps, but doesn't fix the bug.

Can you get the rest right without peeking?

Take the timed Quiz: SQL Injection quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →