On January 28th at 9:00 UTC Academy will be unavailable for 10 minutes due to planned maintenance break.
Kickstart 2020 with new opportunities! - hours only!Up to 80% off on all courses and bundles.-Close
Returning all data from a table
Select some columns
Filtering rows
Text patterns
To be or NULL to be
A bit of mathematics
22. Basic mathematical operators
Let's practice


Nice! We may now move on to our next problem: simple mathematics. Can you add or multiply numbers in SQL? Yes, you can! Take a look at the example:

WHERE (MonthlySalary * 12) > 50000;

In the above example, we multiply the monthly salary by 12 to get the annual salary by using the multiplication operator, which happens to be the asterisk symbol (*). We may then do whatever we want with the new value – in this case, we compare it with 50,000.

In this way, you can add (+), subtract (-), multiply (*), and divide (/) numbers.


Select all cars with a tax value exceeding 2000. The tax rate for all cars is 20%; you can represent this equivalently as 0.2 in your query. Multiply the price by 0.2 to get the tax value.

Stuck? Here's a hint!


WHERE (Price * 0.2) > 2000;