Learn With Grito

SQL SELECT Statement
Explained for Beginners

A comprehensive data analyst guide to retrieving data, aliasing columns, and writing your first SELECT queries.

Tutorial Series10 Mins ReadSQL Level 2

The SQL SELECT statement is the most used SQL command. If you become a data analyst, you will write SELECT queries almost every day.

You use SELECT to retrieve data from databases, inspect tables, filter columns, preview records, analyze metrics, and answer business questions. If SQL is the language of databases, SELECT is the sentence you use most.

In this guide, you’ll learn:

  • What the SQL SELECT statement does
  • SQL SELECT syntax
  • How to select single or multiple columns
  • How SELECT works with real business data
  • Beginner mistakes
  • Interview use cases

What Is the SQL SELECT Statement?

The SQL SELECT statement is used to retrieve data from a database table.

Basic Syntax
SELECT column_name
FROM table_name;
Example Query
SELECT customer_name
FROM customers;

This query returns the customer_name column from the customers table.

Simple Idea: SELECT tells SQL what information you want.

Why Data Analysts Use SELECT Constantly

Analysts rarely create databases. They mostly ask questions to solve business problems.

Examples of questions analysts ask:

  • Show all active customers
  • Get total orders from last month
  • Pull product revenue
  • Retrieve website event data
  • Inspect missing values
  • Compare campaign performance

Every one of these questions starts with a SELECT statement. For example:

Example Query
SELECT order_id, customer_id, revenue
FROM orders;

This fetches order-level business data from the database.

SQL SELECT Statement Syntax Breakdown

Here is the core structure of a query:

SELECT column1, column2
FROM table_name;
SELECT

Specifies the columns you want.

FROM

Specifies the table where the data lives.

Let's look at this example:

SELECT name, city
FROM customers;
namecity
RahulMumbai
PriyaDelhi
ArjunBangalore

Selecting Single or Multiple Columns

Selecting a Single Column

Use this when you only need one field. Efficient querying matters.

Example Query
SELECT email
FROM customers;

Selecting Multiple Columns

To query multiple fields, separate column names using commas.

Example Query
SELECT name, city, signup_date
FROM customers;
namecitysignup_date
RahulMumbai2025-01-10
PriyaDelhi2025-02-14
ArjunBangalore2025-03-01

SELECT * in SQL (Selecting All Columns)

In SQL, the asterisk symbol (*) means all columns.

Example Query
SELECT *
FROM customers;

This returns everything from the table, containing fields such as:customer_id | name | email | city | signup_date | phone | status

Should You Use SELECT *?

Beginners use it constantly. Professionals avoid it unless exploring. Why?

1. Slower Queries

Large tables may contain dozens or hundreds of columns. Fetching everything wastes network and server resources.

2. Harder Debugging

A specific query statement is easier to read and debug than a generic wildcard statement. For example, SELECT * is less readable than SELECT customer_id, revenue.

3. Schema Changes Break Workflows

If new columns are added later, your query output changes unexpectedly, potentially breaking dashboards or reports down the line.

Best Practice: Use SELECT * for quick exploration. Use explicit columns for real analysis.

SQL SELECT with Real Business Example

Business Question:

"Which customer details do we need for a retention campaign?"

Instead of fetching everything, adopt targeted analyst thinking: pull only the exact columns needed to answer the business question.

Targeted Query
SELECT customer_id, name, email, city
FROM customers;

Column Order in SELECT

SQL returns columns in the order you specify. Change order intentionally for readability:

SELECT city, name
FROM customers;
cityname
MumbaiRahul
DelhiPriya

Using Column Aliases with SELECT

Aliases rename columns temporarily in the query output using the AS keyword. This is useful for:

  • Dashboards
  • Reports
  • Stakeholder readability
  • Interview clarity
Example Query
SELECT revenue AS total_revenue
FROM orders;
total_revenue
4500
6200
1900

You can rename multiple columns in the same select query statement:

SELECT
    customer_id AS id,
    revenue AS order_revenue
FROM orders;

SELECT DISTINCT Preview

Sometimes tables contain duplicates.

SELECT city
FROM customers;
Output with Duplicates
Mumbai
Delhi
Mumbai
Pune
Delhi

To query only unique values, use the DISTINCT keyword:

Using DISTINCT
SELECT DISTINCT city
FROM customers;
Unique Values Output
Mumbai
Delhi
Pune

This deserves its own detailed article later.

SELECT with Expressions & Text Columns

SELECT with Expressions

The SELECT statement can calculate values. Derived calculation column example:

Derived Query
SELECT revenue * 0.18 AS gst_amount
FROM orders;
gst_amount
180
360
540

Derived expressions are highly useful for:

  • Taxes
  • Discounts
  • Commissions
  • Derived metrics

Analysts use this constantly.

SELECT with Text Columns

Text values work normally:

SELECT first_name, last_name
FROM employees;

Common Beginner Mistakes

Watch out for these four common errors:

1. Missing FROM

Wrong: SELECT customer_name;
Correct: SELECT customer_name FROM customers;

2. Misspelled Column Names

SQL throws an error if fields are not spelled correctly. Always verify schema.
Wrong: SELECT custmer_name FROM customers;

3. Missing Commas

Wrong: SELECT name city FROM customers;
Correct: SELECT name, city FROM customers;

4. Overusing SELECT *

Wastes query execution efficiency.
Bad habit: SELECT * FROM orders;
Better: SELECT order_id, revenue FROM orders;

SELECT vs Excel Thinking

Excel users often think: “I can just open everything.”

Databases don’t work like spreadsheets. With SQL, good analysts adopt a goal-oriented mindset and ask: "What exact data do I need?"

That mindset improves:

  • Query speed
  • Clarity
  • Performance
  • Business communication

SQL SELECT in Data Analyst Interviews

Interviewers test your basic data selection logic by asking questions like:

Retrieve customer names
SELECT customer_name
FROM customers;
Pull multiple columns
SELECT customer_id, revenue
FROM orders;
Return unique values
SELECT DISTINCT country
FROM users;

Interviewers test:

  • Syntax comfort
  • Clarity
  • SQL fundamentals
  • Data selection logic

Real Analyst Workflow Example

Suppose your manager asks: “Show me customer emails for inactive users.”

Step 1: Pull relevant columns

SELECT customer_id, email, status
FROM customers;
Step 2: Later you’ll add filtering with WHERE. That’s the natural progression.

What Comes After SELECT?

Once you understand SELECT, learn:

1. WHERE clause
2. DISTINCT
3. ORDER BY
4. LIMIT
5. Aliases
6. Aggregate functions
7. GROUP BY

Practice Questions

Try writing queries for these exercises:

1

Retrieve employee names.

Show Solution Query
SELECT name FROM employees;
2

Retrieve product name and price.

Show Solution Query
SELECT product_name, price FROM products;
3

Retrieve all columns from orders.

Show Solution Query
SELECT * FROM orders;
4

Rename revenue as total_sales.

Show Solution Query
SELECT revenue AS total_sales FROM orders;
5

Return unique customer cities.

Show Solution Query
SELECT DISTINCT city FROM customers;

Final Thoughts

The SQL SELECT statement is your starting point for real analytics work. Master this first.

Then layer filtering, sorting, grouping, joins, and advanced analysis. Most SQL complexity becomes manageable once SELECT feels natural.

Grit Over Excuses.

— The Grito Team