Oracle 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.
- 10 rows for which a value in the rownum column is at most 19
- numbers from 10 to 19
- 9 randomly chosen rows from the transactions table
- rows that were assigned internal row identifiers from 10 to 19 inclusive
- the second page of rows ordered by id where a page has 10 rows
- 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.