🎙 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 1 of 10

Why did the username admin' -- log in without a password?

Why did the username admin' -- log in without a password?

  1. A.SQLite ignores passwords
  2. B.The quote closed the string and -- commented out the password check
  3. C.The admin had no password
  4. D.UNION merged the tables
Answer & explanation

Correct answer: The quote closed the string and -- commented out the password check

The input changed the query's structure: everything after -- became a comment, so only username = 'admin' was checked.

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 →