Question: Using the WHERE and HAVING clauses, filter the track table for the tracks with the media _ type _ id set to 1 , grouped

Using the WHERE and HAVING clauses, filter the track table for the tracks with the media_type_id set to 1, grouped by the genre_id having the number of tracks greater than 10. Provide the list of genre_id's and the count of tracks that fit these criteria.
Which of the following queries would provide the correct results?
a.)
SELECT genre_id, count(track_id)
FROM track
WHERE media_type_id =1
GROUP BY genre_id
HAVING count(track_id)>10
b.)
SELECT genre_id, count(track_id)
FROM track
WHERE media_type_id =1
HAVING count(track_id)>10
GROUP BY genre_id
c.)
SELECT genre_id, sum(track_id)
FROM track
WHERE media_type_id =1
GROUP BY genre_id
HAVING sum(track_id)>10
d.)
SELECT genre_id, count(track_id)
FROM track
WHERE count(track_id)>10
GROUP BY genre_id
HAVING media_type_id =1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!