What is the total duration of the album with Id number 2?

You write the SQL query below. Add a GROUP BY clause that will group the data by album Id number.

SELECT
album_id,
SUM(milliseconds) AS total_duration
FROM
track
Correct
You add the clause GROUP BY album_id to group the data by album Id number. The complete query is SELECT album_id, SUM(milliseconds) AS total_duration FROM tracks GROUP BY album_id. The GROUP BY command groups rows that have the same values from a table into summary rows. GROUP BY is always placed as the last command in a SELECT-FROM-WHERE query.

The total duration of the album with ID number 2 is 342562 milliseconds.