N001 Tier 1 · Foundations

SELECT and Column Expressions in SQL

The SELECT clause controls what columns and expressions a query returns. Its scope is the shape of the output — which columns appear and what they contain — with no influence over which rows are included.

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.

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.

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.

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

9 SELECT and Column Expressions practice problems

Start free to practice all 9 SELECT and Column Expressions problems, with instant grading and mastery tracking.

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.

Practice, feedback, mastery, review. That's the loop that turns reading into real skill.

Start free

No account, no credit card. Start solving in under a minute.