Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to skip the first 10 rows in the result.
SQL
SELECT * FROM employees ORDER BY id [1] 10;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using LIMIT instead of OFFSET to skip rows.
Placing OFFSET before ORDER BY.
✗ Incorrect
The OFFSET keyword skips the first N rows before returning the result.
2fill in blank
mediumComplete the code to get 5 rows after skipping the first 20 rows.
SQL
SELECT * FROM products ORDER BY price DESC LIMIT 5 [1] 20;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using WHERE to filter rows instead of OFFSET.
Placing OFFSET before LIMIT.
✗ Incorrect
Use OFFSET after LIMIT to skip rows and limit the number of rows returned.
3fill in blank
hardFix the error in the query to correctly paginate results by skipping 15 rows.
SQL
SELECT name FROM customers ORDER BY signup_date LIMIT 10 [1] 15;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using LIMIT instead of OFFSET to skip rows.
Placing WHERE instead of OFFSET.
✗ Incorrect
The OFFSET keyword must be used to skip rows before limiting the result set.
4fill in blank
hardFill both blanks to select 8 rows after skipping the first 30 rows, ordered by date.
SQL
SELECT * FROM orders ORDER BY order_date [1] 8 [2] 30;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping LIMIT and OFFSET positions.
Using WHERE instead of OFFSET.
✗ Incorrect
Use OFFSET to skip rows and LIMIT to restrict the number of rows returned.
5fill in blank
hardFill the blanks to paginate products: skip 40 rows, then get 10 rows ordered by name.
SQL
SELECT * FROM products ORDER BY product_name [1] 10 [2] 40;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using WHERE instead of OFFSET or LIMIT.
Placing OFFSET before LIMIT.
✗ Incorrect
Use OFFSET to skip rows and LIMIT to get a fixed number of rows.