Full-stack dev quiz question #9

Full-stack dev quiz question #9

quizOracle is one of the most popular database engines. It is good to know how to query such database. The ninth question of the quiz for a full-stack developer is here.

Check the answer to the eighth question.

 

 

The following query was written in SQL to run on Oracle database.

SELECT f.*
FROM (
    SELECT t.*, rownum r
    FROM (
        SELECT id, account_id, value
        FROM transactions
        ORDER BY id) t
    WHERE rownum <= 19) f
WHERE r >= 10

What does it return? Choose one answer.

  1. 10 rows for which a value in the rownum column is at most 19
  2. numbers from 10 to 19
  3. 9 randomly chosen rows from the transactions table
  4. rows that were assigned internal row identifiers from 10 to 19 inclusive
  5. the second page of rows ordered by id where a page has 10 rows
  6. all rows from the transactions table ordered by id

 

For the answer scroll down

.

.

.

 

 

 

 

 

 

 

 

.

.

.

The correct answer is e. For more information about it, see new pagination method in Oracle 12c.