How to Use SELECT in SQL

Use SELECT when you need to read data from a table without changing it. This is the most common SQL statement for exploring rows, filtering records, and building reports.

What you’ll build or solve

You’ll learn how to use SELECT in SQL to read specific columns, all columns, and filtered results. You’ll also know how to keep queries readable and efficient.

When this approach works best

This approach is the right choice when you need to retrieve data instead of modifying it.

Common real-world scenarios include:

  • Viewing user records
  • Building dashboards
  • Checking order history
  • Reporting sales
  • Verifying inserted data

This is a bad idea when the goal is to change data. In that case, use UPDATE, INSERT, or DELETE.

Prerequisites

You only need:

  • A SQL database with at least one table
  • Basic table and column knowledge

Step-by-step instructions

Step 1: Select the columns you need

Start with the SELECT keyword, then list the columns.

SELECT first_name, email
FROM users;

This returns only the chosen columns.

Use * when you need every column.

SELECT *
FROM users;

Add a WHERE clause to filter rows.

SELECT order_id, total
FROM orders
WHERE status = 'paid';

What to look for:

  • SELECT reads data only
  • List only needed columns when possible
  • * returns every column
  • WHERE filters matching rows
  • Cleaner column selection improves performance

Examples you can copy

View one user

SELECT *
FROM users
WHERE user_id = 42;

Paid orders

SELECT order_id, total
FROM orders
WHERE status = 'paid';

Product list

SELECT name, price
FROM products;

Common mistakes and how to fix them

Mistake 1: Overusing SELECT *

What the reader might do:

SELECT *
FROM orders;

Why it breaks: unnecessary columns make large queries slower and harder to read.

Corrected approach:

SELECT order_id, total
FROM orders;

Mistake 2: Forgetting quotes for string filters

What the reader might do:

WHERE status = paid

Why it breaks: SQL treats paid like a column name.

Corrected approach:

WHERE status = 'paid'

Mistake 3: Missing the table name

What the reader might do:

SELECT email;

Why it breaks: SQL does not know where the column comes from.

Corrected approach:

SELECT email
FROM users;

Troubleshooting

If the query returns too much data, replace * with exact columns.

If no rows match, verify the WHERE filter value.

If string filters error, add single quotes.

If the column name is ambiguous, include the table alias or table name.

Quick recap

  • Use SELECT to read data
  • List only needed columns
  • Use * only when necessary
  • Add WHERE to filter rows
  • Quote string values with single quotes