Question: b ) Your team is working on a super exciting project for the Music Billboard [ consider the schema of Q 2 ( a )

b) Your team is working on a super exciting project for the Music Billboard [consider the schema of
Q2(a)]. You've got this amazing script that's supposed to help analyze the songs and albums. But, oh
no! When they try to run it, it's throwing errors left and right. It's time for you, the SQL wizard, to
step in and save the day!
The team hands you this script:
WITH AvgArtistID AS (
SELECT AVG(ArtistID) AS AvgID
FROM Song
SELECT Title, Genre, AVG(Duration)
FROM Song, AvgArtistID
WHERE AVG(Duration)> Duration
GROUP BY Genre
HAVING Genre = 'Pop';
Select * from AvgArtistID;
You need to find out what went wrong and fix it.
Q2(a) Schema :Consider the following Schema:
Artist (ArtistID, Name, Genre, Country, DebutYear)
Album (AlbumID, Title, ReleaseDate, ArtistID (Foreign Key), Genre)
Song (SongID, Title, Duration (in seconds), AlbumID (Foreign Key), ReleaseDate)
BillboardChart (ChartID, ChartDate, ChartName)
ChartEntry (EntryID, ChartID (Foreign Key), SongID (Foreign Key), Position,
WeeksOnChart)
b ) Your team is working on a super exciting

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!