nerdexam
EC-Council

412-79V8 · Question #26

A WHERE clause in SQL specifies that a SQL Data Manipulation Language (DML) statement should only affect rows that meet specified criteria. The criteria are expressed in the form of predicates…

The correct answer is C. SELECT * FROM StudentTable WHERE roll_number = '' or '1' = '1`. See the full explanation below for the reasoning.

Question

A WHERE clause in SQL specifies that a SQL Data Manipulation Language (DML) statement should only affect rows that meet specified criteria. The criteria are expressed in the form of predicates. WHERE clauses are not mandatory clauses of SQL DML statements, but can be used to limit the number of rows affected by a SQL DML statement or returned by a query. A pen tester is trying to gain access to a database by inserting exploited query statements with a WHERE clause. The pen tester wants to retrieve all the entries from the database using the WHERE clause from a particular table (e.g. StudentTable). What query does he need to write to retrieve the information?

Exhibit

412-79V8 question #26 exhibit

Options

  • AEXTRACT* FROM StudentTable WHERE roll_number = 1 order by 1000
  • BDUMP * FROM StudentTable WHERE roll_number = 1 AND 1=1--
  • CSELECT * FROM StudentTable WHERE roll_number = '' or '1' = '1`
  • DRETRIVE * FROM StudentTable WHERE roll_number = 1'#

How the community answered

(30 responses)
  • A
    3% (1)
  • B
    13% (4)
  • C
    77% (23)
  • D
    7% (2)

Community Discussion

No community discussion yet for this question.

Full 412-79V8 Practice