Question from the SQL - Fundamentals test

Write a SQL query to calculate the total quantities sold for each product_id.

Easy

Given the following 'sales' table:

| sale_id | product_id | sale_date  | quantity |
|---------|------------|------------|----------|
| 1       | 1          | 2022-01-01 | 10       |
| 2       | 2          | 2022-01-02 | 5        |
| 3       | 1          | 2022-01-03 | 8        |

Which SQL query calculates the total quantities sold for each product_id?

Author: Vincent CotroStatus: PublishedQuestion passed 1353 times
Edit
2
Community EvaluationsNo one has reviewed this question yet, be the first!