Lesson 2: Basic SELECT Statements

20 min read Beginner Lesson 2 of 12 14.1k learners

What is the SELECT Statement?

The SELECT statement is the most commonly used SQL command. It allows you to retrieve specific data from a database table.

SQL
SELECT * FROM customers;

Selecting Specific Columns

You don’t always need all the data. You can specify which columns you want to retrieve:

SQL
SELECT first_name, email FROM customers;

Using Aliases

Aliases let you rename columns for better readability.

SQL
SELECT first_name AS "First Name", email AS "Email Address"
FROM customers;

Execution Order

Even though you write SELECT first, the database actually processes the FROM clause first.

Practice Quiz

Test your understanding of the SELECT statement:

1. Which keyword retrieves data in SQL?
2. What does the asterisk (*) mean in a SELECT statement?
3. Which clause specifies the table to query?
4. Which keyword is used for column aliasing?
5. Which part is executed first in a SELECT query?