ADVERTISEMENT
ADVERTISEMENT

MCQ | SQL – Injection

SQL Injection MCQ: This section contains the Multiple-Choice Questions & Answers on SQL Injection.
Submitted by Anushree Goswami, on October 04, 2021

1. Which of the following statement is TRUE about SQL Injection?

  1. SQL Injection is an Object Penetration Technique
  2. SQL Injection is a Function Penetration Technique
  3. SQL Injection is a Code Penetration Technique
  4. SQL Injection is a Database Penetration Technique

Answer: C) SQL Injection is a Code Penetration Technique

Explanation:

SQL Injection is a Code Penetration Technique and loss to our database could be caused due to SQL Injection.


2. At which of the following stage does SQL Injection occurs?

  1. When the user is asked to logout
  2. When the user is asked to input password
  3. When the user is asked to input captcha
  4. When the user is asked to input username

Answer: D) When the user is asked to input username

Explanation:

SQL Injection occurs when the user is asked to input a username. In replacement of the name or the user ID, a SQL statement is provided by the user.


3. Which of the following is the type of SQL Injection attack?

  1. It inserts the data
  2. It updates the data
  3. It deletes the data
  4. All of the above

Answer: D) All of the above

Explanation:

To insert, update and delete the data are all the types of SQL Injection attacks and the attack can be used to modify the cookies to harm the database query of the web application.


4. Which of the following is TRUE about the type of SQL Injection attack?

  1. Install malicious program
  2. Export valuable data
  3. Get user login detail
  4. All of the above

Answer: D) All of the above

Explanation:

Types of SQL Injection attack includes the installation of malicious program, exporting of the valuable data and to get the user login details.


5. Select the correct statement which will return all the rows from the Table and then also deletes the Table_Add table?

  1. SELECT * FROM Table; DROP TABLE Table_Add
  2. SELECT * WHERE Table; DROP TABLE Table_Add
  3. SELECT * FROM Table; DELETE TABLE Table_Add
  4. SELECT * WHERE Table; DELETE TABLE Table_Add

Answer: A) SELECT * FROM Table; DROP TABLE Table_Add

Explanation:

The correct statement which will return all the rows from the Table and then also deletes the Table_Add table is – SELECT * FROM Table; DROP TABLE Table_Add.


6. Through which system, we can detect SQL Injection attacks?

  1. Injection Detection System
  2. Attack Detection System
  3. Intrusion Detection System
  4. None of the above

Answer: C) Intrusion Detection System

Explanation:

Through Intrusion Detection System, we can detect SQL Injection attacks.


7. Which of the following is TRUE about Intrusion Detection System?

  1. Intrusion Detection System is Network-based
  2. Intrusion Detection System is Host-based
  3. Both A) and B)
  4. None of the above

Answer: C) Both A) and B)

Explanation:

Intrusion Detection System is both Network-based and Host-based.


8. Network-based IDS can be used to monitor –

  1. Web server logs
  2. When something weird occurs
  3. All connections to the database server
  4. None of the above

Answer: C) All connections to the database server

Explanation:

Network-based IDS can be used to monitor all connections to the database server and flags suspicious activities.


9. Host-based IDS can be used to monitor –

  1. Web server logs
  2. When something weird occurs
  3. Both A) and B)
  4. None of the above

Answer: C) Both A) and B)

Explanation:

Host-based IDS can be used to monitor the web server logs and when something weird occurs.


10. How can we prevent SQL Injection attack?

  1. We should pre-define the input type, input field and length of the user data to validate the input for the user authentication.
  2. Access privileges should be restricted for the users
  3. Administrator accounts should not be used.
  4. All of the above

Answer: D) All of the above

Explanation:

In order to prevent the SQL Injection attack, we should pre-define the input type, input field, and length of the user data to validate the input for the user authentication. Access privileges should be restricted for the users and administrator accounts should not be used.


ADVERTISEMENT
ADVERTISEMENT


Comments and Discussions!



ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.