Please answer to question number 2. This lab assignment has five (5) problems wo
ID: 3662556 • Letter: P
Question
Please answer to question number 2.
This lab assignment has five (5) problems worth 100 points total. For each problem, write an SQL query against the Chinook Database v1.4 Each query must run successfully using DB Browser for SQLite v3.4.0 (SQLite v3.8.7). A description of the correct result set for each problem is provided your query must reproduce this result exactly (including attribute names/order and row de /contents RRe sult set should have a single column titled album title ould be sorted alphabetically Your query must not haracode any numelic i artist id SELECT alb Title AS album ti um alb IN st art ON (alb Artistic-art Artistld ami ORDER BYalb. Title ASC WHERE art. Name Problem 2 20 points Produce a track list for the two-disc album Live' by the band The Black Crowes. The result set should have a the following columns: album title, title of the album, track id (numeric track identifier), track name name of the track), minutes (full minutes in the song) and seconds number of seconds, rounded) The rows should be sorted first by the album title (such that all of the disc 1 tracks appear before disc 2), and then by the track id (smallest first). The minutes/ should be computed from the milliseconds field: the ROUND function ISee secon https:// corefunc.html for reference will be useful. SELECT alb Title AS album title, t.Trackld AS trac t.Name AS track name, (t.Milliseconds 60000) AS k.id, minutes, ROUND (t.Milliseconds 60000 1000.0) AS seconds FROM (artist art INNER JOIN album alb ON art Artistld-albuArtistld) INNER JOIN track t ON alb Albumld-tAlbumld WHERE art,Name The Black Crowes' AND a Title LIKE Live%' ORDER BY album title ASC, track id ASCExplanation / Answer
These questions can be answered in various ways, for me is the way for this type of query:
SELECT album.Title, track.Track_Id, track.Track_Name, ROUND(track.Milliseconds / 60000) AS Minutes, ROUND(track.Milliseconds / 6000) AS Seconds
FROM (album INNER JOIN track ON album.Artist_ID = track.Artist_ID INNER JOIN artist ON artist.Artist_ID = track.Artist_ID)
WHERE artist.Name='The Black Crowes' AND album.Title LIKE '%live%'
ORDER BY album.Title ASC, track.Track_ID ASC