Sitemap
Miranjali Mane

Miranjali Mane

Retrieving Data with SELECT | The Data Analytics Notes

2 min readApr 19, 2026

After inserting data into tables, the next step is to retrieve or view the data stored in the database.

This is done using the SELECT statement.

What is SELECT?

The SELECT statement is used to fetch data from one or more tables.

It allows you to:

View all data

View specific columns

Analyse stored information

Basic Syntax:

SELECT * FROM table_name;

Selecting All Columns

To retrieve all columns from a table, we use *:

Example:

SELECT * FROM Employees;

Press enter or click to view image in full size

This returns all columns and all rows from the table.

Selecting Specific Columns

You can also select only the columns you need.

Example:

Get Miranjali Mane’s stories in your inbox

Join Medium for free to get updates from this writer.

SELECT emp_id, emp_name, salary

FROM Employees;

This returns only the selected columns.

Using DISTINCT

To remove duplicate values:

SELECT DISTINCT department_id

FROM Employees;

Press enter or click to view image in full size

Returns only unique values.

Using Aliases (AS)

You can rename columns for better readability.

Example:

SELECT Emp_name AS Name, salary AS Income

FROM Employees;

Press enter or click to view image in full size

Takeaway:

The SELECT statement is the starting point for working with data.

It helps you view, understand, and analyse the information stored in your database.

Next Up:

Now that we know how to retrieve data, the next step is to filter it using the WHERE clause.

--

--