w3resource
SQL exercises

SQL Exercises: Find the total purchase amount for all orders

SQL Aggregate Functions: Exercise-1 with Solution

Write a SQL statement to find the total purchase amount for all orders.

Sample table: orders


Sample Solution:

SELECT SUM (purch_amt) 
FROM orders;

Output of the Query:

sum
17541.18

Explanation:

Syntax of total purchase amount for all orders

Pictorial presentation:

Result of total purchase amount for all orders

Query Visualization:

Duration:

Query visualization of Find the total purchase amount for all orders - Duration

Rows:

Query visualization of Find the total purchase amount for all orders - Rows

Cost:

Query visualization of Find the total purchase amount for all orders - Cost

 

Practice Online


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

Previous: SQL Aggregate Functions Exercises Home
Next: Write a SQL statement to find the average purchase amount of all orders.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming