Question: USE classdb; 1. Write a select statement that uses a subquery that is equivalent to this Join query: -- SELECT t.name, t.unitprice -- FROM track

USE classdb;

1.  Write a select statement that uses a subquery that is equivalent to this Join query:
-- SELECT t.name, t.unitprice
-- FROM track t JOIN playlisttrack pl using(trackId)
-- WHERE playlistId = 16;

2.  Write a select statement that uses a subquery to display the track name and composer for all tracks that are on an album with the artistID = 22;

3. Write a select statement that uses a subquery to display the name from the track table of any tracks that do not have any sales (i.e. are not in the invoiceline table)

 4. Write a select statement that uses a subquery to display the name and unitprice of all tracks that have a unitprice greater than the average track unitprice.

5. Write a select statement that uses a subquery to display the name of any track that is longer (milliseconds) than the average milliseconds for tracks with albumId=59

6. Write a select statement that uses a subquery to display the name and unitprice of all tracks that have a unitprice higher than any track in genreid 4

7. Use the EXISTS operator to display the name and unitprice of all tracks that have a row in the invoiceline table.

Step by Step Solution

3.40 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

answer 1 SELECT tname tunitprice FROM track t WHERE ttrackId IN SELECT tr... View full answer

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 Databases Questions!