SELECT
Feb 23, 2026
·
5
min read
Category: Data Query Language (DQL)
Platform Support:
✅ Snowflake | ✅ BigQuery | ✅ Databricks
Description
The SELECT statement retrieves data from one or more tables in a database. It's the most fundamental and commonly used SQL command for querying data.
Syntax
Platform-Specific Notes
Snowflake:
Supports
LIMITandTOPsyntaxCase-insensitive by default
Supports
QUALIFYclause for window function filtering
BigQuery:
Uses
LIMIT(notTOP)Requires backticks for reserved keywords
Supports
QUALIFYclause
Databricks:
Supports both
LIMITandTOPCase-insensitive by default
Does not support
QUALIFY(use subquery instead)
Example 1: Basic SELECT
Sample Data (customers table):
id | first_name | country | |
|---|---|---|---|
1 | John | USA | |
2 | Maria | Spain | |
3 | Sarah | USA | |
4 | Ahmed | Egypt |
Result:
first_name | country | |
|---|---|---|
John | USA | |
Sarah | USA |
Example 2: SELECT with Aggregation
All Platforms:
Sample Data:
id | first_name | country | |
|---|---|---|---|
1 | John | USA | |
2 | Maria | Spain | |
3 | Sarah | USA | |
4 | Bob | USA | |
5 | Carlos | Spain |
Result:
country | customer_count | unique_emails |
|---|---|---|
USA | 3 | 3 |
Spain | 2 | 2 |
Best Practices
Always specify column names explicitly rather than using
SELECT *in production codeUse aliases for better readability
Add
LIMITfor exploratory queries on large tablesConsider using
QUALIFY(Snowflake/BigQuery) for filtering window functions





