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_amountSQL 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_amountOne 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_totalWithout 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.
What does SELECT 43 / 8 return?
9 SELECT and Column Expressions practice problems
Write a query to return the gross profit per unit.
Write a query to return the total cost for a 12-month subscription.
Write a query to return both the discount amount and the resulting sale price.
Write a query to return the base salary, commission amount, bonus, and total compensation in a single row.
Write a query to return each charge alongside the total shipping cost in a single row.
Write a query to return the deal value, the commission rate as a decimal, and the commission amount in dollars in one row.
Write a query to return the balance after the credit, the platform fee amount, and the final total the customer owes.
Write a query to return the precise number of boxes per crate, including the fractional portion.
Write a query to return the final net payment amount.
Start free to practice all 9 SELECT and Column Expressions problems, with instant grading and mastery tracking.
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.
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.
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.
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.
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 freeNo account, no credit card. Start solving in under a minute.