Answer to Question #86259 in Databases | SQL | Oracle | MS Access for Zee Kay

Question #86259
3. Find audio tracks which have a length longer than the average length of all
the audio tracks;
4. Which playlists do not contain any tracks for the artists “Black Sabbath" nor
“Chico Buarque"?

~~ Tracks is a table
~~ Playlist is a table
1
Expert's answer
2019-03-14T11:36:55-0400

Problem.

3. Find audio tracks which have a length longer than the average length of all

the audio tracks;

4. Which playlists do not contain any tracks for the artists “Black Sabbath" nor

“Chico Buarque"?


Solution:


3.

SELECT * FROM Track
WHERE Milliseconds > 
           (SELECT AVG(Milliseconds) FROM Track);





4.

SELECT * FROM Playlist
WHERE PlaylistId NOT IN  
           (SELECT DISTINCT PlaylistId FROM PlaylistTrack, Track, Album, Artist
           WHERE PlaylistTrack.TrackId = Track.TrackId 
           AND Track.AlbumId = Album.AlbumId 
           AND Album.ArtistId = Artist.ArtistId
           AND Artist.Name = 'Black Sabbath' OR Artist.Name = 'Chico Buarque');

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS