Skip to main content

SQL SELECT Statement Explained with Examples | Complete Beginner Guide (2026)

SQL SELECT Statement Explained with Examples

If you're beginning your SQL journey, the SELECT statement is the very first command you should learn.

Almost every SQL query starts with SELECT because it is used to retrieve data from a database.

In this beginner-friendly guide by DataWithAnmol, you'll learn how the SELECT statement works with simple examples.


What is the SQL SELECT Statement?

The SELECT statement is used to retrieve data from one or more tables in a database.

Think of a database as a library.

The SELECT command helps you find exactly the books (data) you need.


Basic Syntax

SQL
SELECT column_name
FROM table_name;

Example Table

Imagine we have an Employees table.

EmployeeID Name Department Salary
101 Amit HR 50000
102 Neha IT 65000
103 Raj IT 48000
104 Priya Sales 72000
105 Ravi Finance 60000

Select All Columns

SQL
SELECT *
FROM Employees;

The asterisk (*) means "retrieve every column."

Result / Output
EmployeeID Name Department Salary
101 Amit HR 50000
102 Neha IT 65000
103 Raj IT 48000
104 Priya Sales 72000
105 Ravi Finance 60000

Select Specific Columns

Instead of retrieving everything, you can choose only the columns you need.

SQL
SELECT Name, Salary
FROM Employees;
Result / Output
Name Salary
Amit 50000
Neha 65000
Raj 48000
Priya 72000
Ravi 60000

This makes your queries faster and easier to understand.


Rename Column Using AS

You can change the display name of a column.

SQL
SELECT Name AS Employee_Name,
Salary AS Monthly_Salary
FROM Employees;
Result / Output
Employee_Name Monthly_Salary
Amit 50000
Neha 65000
Raj 48000
Priya 72000
Ravi 60000

Remove Duplicate Values

Use the DISTINCT keyword.

SQL
SELECT DISTINCT Department
FROM Employees;
Result / Output
  • HR
  • IT
  • Sales
  • Finance

Each department appears only once.


Common Mistakes Beginners Make

❌ Forgetting the FROM clause:

Incorrect SQL
SELECT Name;

Correct Alignment:

Correct SQL
SELECT Name
FROM Employees;

❌ Using SELECT * when only one or two columns are needed:

Fetching only the required columns significantly improves query performance.


Real-World Example

Imagine your manager asks:

"Show me the names and salaries of all employees."

The SQL query would be:

SQL
SELECT Name, Salary
FROM Employees;

Simple, fast, and exactly what the manager needs.


Key Takeaways

  • SELECT retrieves data from a table.

  • * returns all columns.

  • You can select specific columns.

  • AS renames columns in the output.

  • DISTINCT removes duplicate values.

  • Using only required columns improves efficiency.


What's Next?

Now that you've learned the SELECT statement, the next topic is WHERE, which allows you to filter records based on conditions.

Stay connected with DataWithAnmol for more beginner-friendly SQL tutorials, practice questions, and Data Analytics learning resources.

📺 YouTube: https://youtube.com/@datawithanmolofficial?si=8APtSK5TY6Tl9Xd_


Suggested internal links for your blog

At the end of this post, add links to:



About DataWithAnmol

Hi! I'm Anmol Raj, founder of DataWithAnmol.

My goal is to make Data Analytics easy for beginners through practical tutorials, SQL challenges, Power BI projects, Excel tips, and career guidance.

You can also learn with me on YouTube:

DataWithAnmol
https://youtube.com/@datawithanmolofficial?si=8APtSK5TY6Tl9Xd_



Meta Description:

Learn the SQL SELECT statement with simple examples. Understand how to retrieve data from a database using SQL. Perfect for beginners learning SQL with DataWithAnmol.


Comments

Popular posts from this blog

What is SQL? The Complete Beginner's Guide (2026) | Learn SQL with DataWithAnmol

What is SQL? The Complete Beginner's Guide (2026) If you're planning to become a Data Analyst , Business Analyst , Data Scientist , or even a Software Developer , one skill appears in almost every job description. That skill is SQL . Whether you are just starting your data journey or preparing for interviews, learning SQL is one of the best investments you can make. In this guide, I'll explain SQL in the simplest way possible. Welcome to DataWithAnmol . Who am I? Hi! I'm Anmol Raj , founder of DataWithAnmol . I created this platform to help beginners learn Data Analytics through practical examples instead of confusing theory. On my YouTube channel, I regularly share tutorials on: SQL Power BI Excel Python Data Analytics Projects Career Guidance Interview Preparation 📺 Subscribe here: https://youtube.com/@datawithanmolofficial?si=8APtSK5TY6Tl9Xd _ What i...

Anmol Raj | Data Analyst Resume 2026 | SQL, Power BI, Python

Anmol Raj | Data Analyst Resume 2026 | SQL, Power BI, Python Welcome to my professional resume page. I am Anmol Raj , a Data Analyst passionate about transforming raw data into meaningful business insights through analytics, visualization, and reporting. About Me I am a Computer Science graduate with hands-on experience in SQL , Power BI , Excel, and Python . My expertise includes data cleaning, dashboard development, KPI reporting, business intelligence , and analytical problem-solving. I enjoy working with data to uncover trends, improve decision-making, and support business growth. Contact Information Name: Anmol Raj Location: Muzaffarpur, Bihar, India Email: anmolraj530@gmail.com Phone: +91-9128823417 Professional Summary Business-focused Data Analyst skilled in SQL, Power BI, Excel, and Python with practical experience in dashboard creation, reporting automation, data visualization , and business analytics . Adept at converting complex datasets into actionable insights that he...