SQL SELECT Statement

SELECT is how you read data in SQL. You list the columns you want after SELECT and name the table after FROM. Almost every query you write will start this way.

Updated December 1, 2026

Syntax

SELECT column1, column2
FROM table_name;

Select specific columns

List the columns you need, separated by commas. The result keeps them in the order you wrote them, whatever order they have in the table.

SELECT name, price
FROM drinks;
Result on the SQL Café sample data (10 rows)
nameprice
Espresso3
Latte4.5
Cappuccino4.25
Mocha5
Cold Brew4.75
Matcha Latte5.25
Chai Latte4.75
Peppermint Tea3.25
Hot Chocolate4
Lemonade3.5

Select every column with *

SELECT * returns every column. It’s handy for exploring a table you haven’t seen before. In real applications, list the columns instead, so your query doesn’t change when someone adds a column.

SELECT *
FROM customers;
Result on the SQL Café sample data (8 rows)
idnamecityjoined
1AvaAustin2024-01-15
2BenSeattle2024-02-03
3CaraDenver2024-02-20
4DevAustin2024-03-11
5EliSeattle2024-04-08
6FayNULL2024-05-19
7GusDenver2024-06-01
8HanaAustin2024-06-24

Calculate new values

A column in SELECT doesn’t have to exist in the table. You can do arithmetic and call functions, then name the result with AS. Here we add 10% tax and round to cents.

SELECT name, price, ROUND(price * 1.10, 2) AS price_with_tax
FROM drinks;
Result on the SQL Café sample data (10 rows, first 5 shown)
namepriceprice_with_tax
Espresso33.3
Latte4.54.95
Cappuccino4.254.68
Mocha55.5
Cold Brew4.755.23

Common mistakes

Practice SELECT Statement interactively

Write real queries in your browser and get instant feedback in the lesson “Your first SELECT” (Unit 1). It’s free.

Frequently asked questions

Is SQL case sensitive?

Keywords like SELECT and FROM are not. Writing them in capitals is just a convention. Whether text values like 'Latte' match case-sensitively depends on the database and its settings.

Do I need a semicolon at the end?

It marks the end of a statement. Many tools accept a single query without one, but it’s good practice, and it’s required when you run several statements together.

Can I SELECT without FROM?

In most databases, yes: SELECT 2 + 2; returns 4. Oracle needs FROM dual.

Related SQL tutorials