Loading

Quipoin Menu

Learn • Practice • Grow

sql / SQL Injection
mcq
Direction: Choose the correct option

Q1.

What is SQL injection?
A. Database error
B. Index corruption
C. Query optimization
D. Malicious SQL inserted into queries
Direction: Choose the correct option

Q2.

Which query is vulnerable to SQL injection?
A. PREPARED STATEMENT
B. 'SELECT * FROM users WHERE username = ''' + userInput + ''''
C. SELECT * FROM users WHERE username = ?
D. SELECT * FROM users
Direction: Choose the correct option

Q3.

How do prepared statements prevent injection?
A. Use functions
B. Validate input
C. Encrypt data
D. Separate query structure from data
Direction: Choose the correct option

Q4.

PREPARE stmt FROM 'SELECT * FROM users WHERE username = ?'; SET @user = 'admin'; EXECUTE stmt USING @user;
What does '?' represent?
A. Placeholder for parameter
B. Any value
C. Wildcard
D. Comment
Direction: Choose the correct option

Q5.

What other practices prevent SQL injection?
A. Escape user input
B. Use stored procedures
C. All of the above
D. Input validation, least privilege