SELECT Statements SQL Topic exerciseEasyVerified answerSQLite + PostgreSQL + MySQL + SQL Server live · 1 guided

SELECT with Expressions

Return employee names with bonus calculated as salary * 0.10.

Exercise brief

Understand the request

Finance analyst The compensation preview needs a proposed bonus equal to ten percent of salary.

For every employee, add a calculated column called bonus that is 10% of their salary (i.e. salary * 0.10). Show first_name, last_name, salary, and bonus.

Return

  • Return first_name, last_name, salary, and bonus.

Constraints

  • Use an arithmetic expression in the SELECT list.

Data you will use

Review the relevant tables before deciding how to join, filter, or aggregate them.

employees

  • first_nameVARCHAR(50)
  • last_nameVARCHAR(50)
  • salaryINTEGER

Hints, when you need them

Open one clue at a time so you still do the reasoning.

Hint 1

You can put arithmetic right inside the SELECT list. Multiply the salary column by a literal 0.10 and give it an alias.

Hint 2

Syntax: SELECT col, col * <number> AS <alias> FROM table;

Hint 3

Add salary multiplied by the decimal bonus rate as the fourth projected expression and name it bonus.

Verified SQL answer

Attempt the problem first, then compare structure and reasoning—not just syntax.

Reveal solution and explanation
SELECT first_name, last_name, salary, salary * 0.10 AS bonus FROM employees;

Why this works

A SELECT list item can be any scalar expression, not just a column name. The new column exists only in the result — it is computed on the fly. The alias `bonus` gives that computed column a name in the output.

Success check

Every employee appears once and bonus equals salary multiplied by 0.10.

Expected result

Use this output to verify values, aliases, ordering, and row count.

first_namelast_namesalarybonus
JohnSmith12000012000
AliceJohnson850008500
BobWilson800008000
CarolDavis600006000
DavidBrown700007000
EmmaTaylor950009500
FrankGreen650006500
GraceWhite900009000
HenryClark550005500
IvyMartinez680006800

Learn the concepts behind this answer

Strengthen your understanding with these targeted learning topics:

Continue practicing

SQL Practice Online

Open the interactive workspace and practice across SQL topics.