SOL-C01 practice question 8 of 30

What is the typical syntax for using the LIMIT clause to retrieve the first 10 rows of a table named employees?

Full set: 214 questions
Answer options
A: SELECT * FROM employees LIMIT 10; Correct answer
B: SELECT LIMIT 10 * FROM employees;
C: LIMIT 10 SELECT * FROM employees;
D: SELECT * FROM employees WHERE LIMIT 10;
Correct Answer:
A. SELECT * FROM employees LIMIT 10;
Explanation

The LIMIT clause in Snowflake SQL is used to restrict the number of rows returned by a query. The correct and standard syntax places the LIMIT clause at the end of the SELECT statement, after the FROM and any WHERE, GROUP BY, or ORDER BY clauses. The syntax SELECT FROM employees LIMIT 10; correctly requests all columns () from the employees table and returns only the first 10 rows encountered.

Why Incorrect

B. SELECT LIMIT 10 ... is syntactically incorrect; LIMIT is not part of the column selection list in the SELECT clause.
C. LIMIT 10 SELECT ... is syntactically incorrect; the SELECT statement must come first.
D. ... WHERE LIMIT 10; is syntactically incorrect; LIMIT is a clause that constrains the final result set, not a condition within the WHERE clause.

References

1. Snowflake Documentation. (n.d.). SELECT. Snowflake Inc. Retrieved from https://docs.snowflake.com/en/sql-reference/sql/select. The syntax summary shows [ LIMIT ] as one of the final clauses of a SELECT statement.

2. Snowflake Documentation. (n.d.). LIMIT / FETCH. Snowflake Inc. Retrieved from https://docs.snowflake.com/en/sql-reference/constructs/limit. The documentation provides examples such as SELECT FROM mytable LIMIT 10;, confirming this structure.

Scroll to Top