SQLite Exercise: Calculate 171*214+625
Write a query to calculate 171*214+625.
SQLite Code :
-- Calculating the result of the expression 171 multiplied by 214, and then adding 625
SELECT 171 * 214 + 625 Result;
Output:
Result ---------------- 37219
Explanation:
The above SQLite query calculates the result of the expression 171 multiplied by 214, and then adds 625 to that product. The final result is assigned the alias "Result".
Here's a brief explanation of each part of SQLite code:
- SELECT clause:
- It performs a mathematical calculation: 171 multiplied by 214.
- It then adds the result of the multiplication to 625.
- Result alias:
- The result of the entire expression is aliased as "Result".
Practice SQLite Online
Model Database
Structure of 'hr' database :
Improve this sample solution and post your code through Disqus.
Previous: Write a query to get the first 3 characters of first name from employees table.
Next: Write a query to get the names (for example Ellen Abel, Sundar Ande etc.) of all the employees from employees table.
What is the difficulty level of this exercise?
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics