w3resource

Basic SELECT statement: Calculate the specified number

MySQL Basic Select Statement: Exercise-13 with Solution

Write a query to calculate 171*214+625.

-- Performing arithmetic operations: multiplication and addition
SELECT 171 * 214 + 625 Result;

Explanation:

  • This SQL query performs a series of arithmetic operations: multiplication and addition.
  • It multiplies 171 by 214 and then adds 625 to the result.
  • The result of this calculation is displayed in the result set with the alias "Result".

Pictorial Presentation of the above query


Result :


MySQL Code Editor:

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a query to get the first three characters of first name of all employees.
Next: Write a query to get the name (for example Ellen Abel, Sundar Ande etc.) of all the employees from employees table.

What is the difficulty level of this exercise?



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/mysql-exercises/basic-simple-exercises/write-a-query-to-calculate-numbers.php