Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a single SQL (using SQLite) statement to list albums with three columns: t

ID: 3591219 • Letter: W

Question

Write a single SQL (using SQLite) statement to list albums with three columns: the title of the album, the total number of tracks in that album, and the price of the album. Exclude albums that are priced lower than thirty dollars from the output. Rename the column headings appropriately, and sort the output by the price descendingly.

Track Table

Album Table

TrackID AlbumID MediaTypeID Filter Com Filter Millisecond Filter Name GenreI poser Byte UnitPrice Filter Filter Filter Filter 11170334 5510424 3990994 4331779 6290521 6713451 7636561 6852860 6599424 8611245 6566314 8596840 6706347 8817038 Filter 0.99 0.99 0.99 0.99 0.99 0.99 0.99 0.99 0.99 0.99 0.99 0.99 0.99 0.99 Filter For Those Ab... 1 Balls to the Wall 2 Fast As a Shark 3 Angus Young,... 343719 342562 estless and 3 Princess of th... 3 Put The Finge... 1 Let's Get It Up 1 Inject The Ve... 1 Snowballed Evil Walks C.O.D Breaking The.. 1 Night Of The 1 Spellbound F. Baltes, S. K... 230619 F. Baltes, R.A.. 252051 Deaffy & R.A. 375418 Angus Young 205662 Angus Young 233926 Angus Young 210834 Angus Young,... 203102 Angus Young,. 263497 Angus Young,...199836 Angus Young 263288 Angus Young,.. 205688 Angus Young,. 270863 4 9 10 12 13 14

Explanation / Answer

Hi,
you can use the below query,


select title,sum(UnitPrice) as Totalprice,count(*) as 'number of tracks' from track group by AlbumID having Totalprice>=30 order by Totalprice desc;


what this does is first group data according to the albumId then, filtet them which have price<30 and then display them in descending order of price.
Thumbs up if this was helpful, otherwise let me know in comments

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote