Tier 1 · Foundations

SELECT and Column Expressions in SQL

By Owen Middleton · Updated September 2026 · Examples run on PostgreSQL 17

What is SELECT in SQL?

SELECT is how you tell SQL what to compute and what to call the result.

You're already in SQL working on a query. Before running a commission calculation across thousands of deals, you want to verify the formula produces the right number on a known input. SELECT lets you test the arithmetic in isolation — write the expression, give it a label, and SQL evaluates it immediately.

How do you use SELECT without a table?

Before you ever touch a table or pull from a database, SELECT already does useful work. You hand it any arithmetic expression — addition, subtraction, multiplication, division — and it hands back a labeled answer. The AS keyword handles the labeling. You write the expression, write AS, then give the column a name:

SELECT 48000 * 0.075 AS commission_amount

SQL evaluates the expression and returns one row with one column: commission_amount, value 3600. One query, one result. That's it.

You can return several calculations at once by separating them with commas:

SELECT 48000 AS deal_value, 0.075 AS commission_rate, 48000 * 0.075 AS commission_amount

One query, one row, three labeled columns. If someone needs the full breakdown — the deal size, the rate, and the dollar amount — you return all three together.

Which arithmetic operators can you use in SELECT?

SELECT works with all four arithmetic operators: +, -, *, and /. Parentheses control the order of operations, exactly like in regular math:

SELECT (320 - 50) * 1.10 AS final_total

Without the parentheses, SQL multiplies first and you get a different number. With them, the subtraction happens first. Whenever a calculation has multiple steps, parentheses make the order explicit and keep the result from surprising you.

SELECT 43 / 8

Why does 43 / 8 return 5 in SQL?

The one thing that trips people up: integer division.

Divide two whole numbers and SQL drops the decimal entirely. 43 / 8 returns 5, not 5.375. Fix it by writing at least one side with a decimal point: 43.0 / 8 returns 5.375000. Any time you need the fractional part of a result, make sure at least one number in the division has a decimal.

Check your understanding

What does SELECT 43 / 8 return?

Practice SELECT in SQL

Practice · easy

Brightlane's merchandising team is evaluating margin on a new product line ahead of the spring catalog launch. One item in the line sells for $149.99 and carries a production cost of $89.50 per unit.

Write a query to return the gross profit per unit.

Output:

  • A single row with one column, gross_profit.

Run previews · Check grades

Write a query, then run it to see results here.

Worked solution

The full breakdown walks through the shape, each clause, why this approach beats the alternatives, and the trap to avoid.

See the full worked solution
In the game

Station Zero, our free browser SQL game, teaches this concept inside a story. No signup.

write your first SELECT in Station Zero

9 SELECT practice problems

Start learning to practice all 9 SELECT problems, with instant grading and mastery tracking.

Common questions about SELECT

Does SELECT decide which rows a query returns?

No. SELECT controls what each output row contains, not how many rows there are. Asking for one column or five returns the same number of rows either way. WHERE is the clause that decides which rows survive.

Does the order of columns in a SELECT list matter?

It sets the order of the columns in the result and nothing else. Swap two expressions and the two output columns swap with them, while every value stays the same. The order the rows arrive in is a separate question, answered by ORDER BY.

Can one SELECT return several calculations at once?

Yes. Separate the expressions with commas and each becomes its own labelled column in the same row. One query can hand back the deal value, the rate and the commission together, which is more useful to the person asking than three separate answers.

Is SQL case sensitive?

Keywords are not, so select and SELECT do the same thing. Unquoted names are folded to lower case, which is why an alias written as MonthlyRevenue comes back as monthlyrevenue. Wrap a name in double quotes and PostgreSQL keeps the capitals exactly as you typed them.

How you actually get good at SQL

Reading explains SQL. Writing it, over and over with instant feedback, is what makes you fluent.

That's the whole SQLMaxx loop: 600+ real problems, instant AI feedback, mastery you can actually see, and spaced review that won't let you forget.

A stack of SQL practice problem cards, the top card showing an employees table.
615 problems · 66 concepts

Real problems. Not toy examples.

615 hand-built problems spanning all 66 concepts, from basic SELECTs to window functions, built on real schemas and real business questions, the kind you'll actually get asked on the job. Enough reps to make SQL automatic.

A retro computer showing a SQL query marked correct with a green checkmark.
Instant AI feedback

Write a query. Know if it's right in one second.

No copying an answer and hoping it clicked. The AI grader checks your real query against real data, catches exactly what's wrong, and explains the fix in plain English, like a senior analyst reading over your shoulder on every problem.

A circular mastery progress dial filling from blue to green, the SQLMaxx diamond at its center.
Mastery tracking

Stop guessing whether you actually know it.

SQLMaxx tracks every concept and shows you what you've mastered and what's still shaky. Your skills fill in one concept at a time, so 'I think I get joins' becomes something you can prove.

A SQL query editor circled by a blue return arrow with a clock, scheduled to come back for review.
Spaced review

Learn it once. Keep it for good.

Most of what you learn this week fades by next week. So when a concept comes due for review, SQLMaxx hands you a fresh problem to solve from a blank editor, not a flashcard to re-read. A research-backed spaced-repetition algorithm (FSRS) times each return for right before you'd forget, so your SQL is still there months later, when the interview or the job actually needs it.