Bird
0
0

Which SQL clause is essential for keyset pagination to fetch the next page?

easy📝 Syntax Q3 of 15
Rest API - Pagination Patterns
Which SQL clause is essential for keyset pagination to fetch the next page?
ALIMIT :offset, :limit
BORDER BY RANDOM()
CGROUP BY id
DWHERE id > :last_id
Step-by-Step Solution
Solution:
  1. Step 1: Identify filtering condition for keyset

    Keyset pagination filters rows with WHERE id > last_id to get next records after the cursor.
  2. Step 2: Exclude offset-based and irrelevant clauses

    LIMIT with offset is offset pagination; GROUP BY and ORDER BY RANDOM() do not help pagination.
  3. Final Answer:

    WHERE id > :last_id -> Option D
  4. Quick Check:

    Filtering with cursor = B [OK]
Quick Trick: Use WHERE with cursor for keyset, not OFFSET [OK]
Common Mistakes:
  • Using LIMIT with offset instead of WHERE clause
  • Confusing GROUP BY with pagination
  • Using random order which breaks pagination

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes