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

Quiz: Node, Express and REST · Question 10 of 10

Why should SQL queries use parameters instead of joining strings with user input?

Why should SQL queries use parameters instead of joining strings with user input?

  1. A.Parameters make queries shorter
  2. B.It prevents SQL injection
  3. C.Databases reject string concatenation
  4. D.It removes the need for validation
Answer & explanation

Correct answer: It prevents SQL injection

The database treats parameter values as data, never as SQL code.

Can you get the rest right without peeking?

Take the timed Quiz: Node, Express and REST quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →