Beginner

12. SELECT Statement

Learn how the SELECT statement retrieves specific information from a database table.

📘 Lesson 12 of 728 ⏱ 8 min 🎯 Beginner

The SELECT statement is one of the most commonly used SQL statements. It is used to retrieve data from one or more database tables. You can use SELECT to retrieve specific columns, all columns, calculated values, or results produced by SQL functions. SELECT is normally combined with other SQL clauses such as FROM, WHERE, GROUP BY, HAVING, and ORDER BY to create useful queries.

Almost every SQL analysis starts by retrieving data. Data Analysts use SELECT to access the information required for reports, dashboards, investigations, calculations, and business analysis.

Suppose an Employees table contains EmployeeID, EmployeeName, Department, Salary, and Location. If you only need employee names and salaries, SELECT allows you to retrieve only those columns.

SQL
SELECT
    EmployeeName,
    Salary
FROM Employees;

SELECT is used for employee reports, customer analysis, sales reporting, financial analysis, transaction monitoring, operational reporting, and dashboard preparation.

  • SELECT retrieves data.
  • SELECT can retrieve one or more columns.
  • FROM identifies the source table.
  • SELECT * returns all columns.
  • SELECT can contain calculations.
  • SELECT can be combined with other SQL clauses.
What is the purpose of SELECT?

SELECT is used to retrieve data from one or more database tables.

What does SELECT * mean?

SELECT * returns all columns from the specified table.

Have you finished this lesson?

Introduction to SQL – All Lessons