Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to select the first 5 rows using LIMIT syntax.
SQL
SELECT * FROM employees [1] 5;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using TOP instead of LIMIT in MySQL or PostgreSQL.
Placing LIMIT before FROM clause.
✗ Incorrect
The LIMIT keyword is used in SQL dialects like MySQL and PostgreSQL to restrict the number of rows returned.
2fill in blank
mediumComplete the code to select the top 3 rows using TOP syntax.
SQL
SELECT [1] 3 * FROM sales;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using LIMIT instead of TOP in SQL Server.
Placing TOP after FROM clause.
✗ Incorrect
The TOP keyword is used in SQL Server to get the first N rows.
3fill in blank
hardFix the error in the FETCH FIRST syntax to select 10 rows.
SQL
SELECT * FROM orders [1] 10 ROWS ONLY;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using LIMIT or TOP keywords with FETCH FIRST syntax.
Omitting ROWS ONLY at the end.
✗ Incorrect
The correct syntax to limit rows in standard SQL is FETCH FIRST N ROWS ONLY.
4fill in blank
hardFill both blanks to select 7 rows using FETCH FIRST syntax.
SQL
SELECT * FROM products ORDER BY price [1] 7 [2] ONLY;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using LIMIT instead of FETCH FIRST.
Using ROW instead of ROWS for multiple rows.
✗ Incorrect
The standard syntax is FETCH FIRST N ROWS ONLY to limit rows.
5fill in blank
hardFill all three blanks to select top 4 rows using TOP syntax with alias.
SQL
SELECT [1] 4 [2] FROM sales_data AS top_sales [3];
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using LIMIT instead of TOP in SQL Server.
Omitting the WHERE clause when filtering is needed.
✗ Incorrect
Use TOP after SELECT, then columns (like *), and optionally a WHERE clause for filtering.