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.

We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.