Exercise 9 of 17
Paginated results
Fixed training server
Order the sequences by strain, skip the first 50 and return the next 25, showing only the strain, country and date.
The output should have this shape:
strain | country | date
---------- | ------- | ----------
sample-051 | Germany | 2021-01-15
sample-052 | France | 2021-01-16Write a query and run it. The result is compared with the reference answer without considering row order.
Loading query editor…
Loading query editor…
Explanation
Order the table by strain to give the rows a stable order. Use offset to skip the first 50 rows, keep the next 25 and project the requested columns.
Reference answer
default
.orderBy({strain})
.offset(50)
.limit(25)
.project({strain, country, date})