Question

label O cd track bltitle VARCHAR(15) cdid INT(11) trkid INT(11) lblstreet VARCHAR(25) cdlblid VARCHAR(10) trknum INT(11) Iblc5. Write the SQL to list the Total Tracks and Music Label for all CDs with less than 10 tracks.
6. Write the SQL to add the following CD information to this database.

a. CD Title is Marvin Gaye’s Hits

b. From the year is 1988

c. The Music Label is Motown

d. The CD serialized code is WD72645

e. The Tracks and Track Lengths are: i

. Grapevine 3.12

ii. Let’s Get It On 3.55

iii. Too Busy Thinking 2.55

iv. How Sweet It Is 2.48

f. Now write the query to display these new tracks only

0 0
Add a comment Improve this question Transcribed image text
Answer #1

5.

SELECT cd.lbltitle, COUNT(track.trkid) AS Total_Tracks
FROM cd INNER JOIN track
ON cd.cdid = track.cdid
GROUP BY track.cdid
HAVING COUNT(track.cdid) < 10;

6.
i)
INSERT INTO label (lbtitle)
VALUES ('Motown');

INSERT INTO cd (cdlblid,cdtitle,cdyear,lbltitle)
VALUES ('WD72645', 'Marvin Gaye’s Hits', '1988', 'Motown');

INSERT INTO track (trktitle,trklength,cdid)
VALUES ('Grapevine',3.12,(SELECT cdid FROM cd WHERE cdtitle = 'Marvin Gaye’s Hits'));

INSERT INTO track (trktitle,trklength,cdid)
VALUES ('Let’s Get It On',3.55,(SELECT cdid FROM cd WHERE cdtitle = 'Marvin Gaye’s Hits'));

INSERT INTO track (trktitle,trklength,cdid)
VALUES ('Too Busy Thinking',2.55,(SELECT cdid FROM cd WHERE cdtitle = 'Marvin Gaye’s Hits'));

INSERT INTO track (trktitle,trklength,cdid)
VALUES ('How Sweet It Is',2.48,(SELECT cdid FROM cd WHERE cdtitle = 'Marvin Gaye’s Hits'));

Add a comment
Know the answer?
Add Answer to:
5. Write the SQL to list the Total Tracks and Music Label for all CDs with...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT