Question: Hi I need help with SQL, can you please help me with the following, Thank you.... 1.Write a SQL statement that returns the artist id
Hi I need help with SQL, can you please help me with the following, Thank you....
1.Write a SQL statement that returns the artist id and artist name that is associated with the tack having the identifier (i.e. TrackId) of 1601. Consider using aliasing to avoid possible column ambiguity
2.As musicStore administrator, you wish to identify the number of tracks for each genre. Write a SQL statement that will return a result-set containing the genre (name) and the total number of tracks for each genre. Sort the results in an ascending order of genre (name).
3.As a musicStore administrator, you are trying to identify the bestselling albums. That is, you would like to determine the total sales for each album. Hence, write a SQL statement that will compute the total sales for each album. As part of the result-set, include the identifier of the album, the title of the album and the name of the artist. Sort the results by a descending order of the sale values from highest to lowest. Hint: Consider using GROUP BY (see Oracle documentation for details). Use a proper column aliasing for cumulative total (e.g. Total Sales).
4.Tracks table contains a column called Milliseconds which indicates the duration of a song in each track. We would like to perform a quick analysis by identifying the average duration for all tracks, the lowest and highest duration among all tracks in the TRACKS table. Use the names "Average Duration", "Longest Duration" and "Shortest Duration", as the column names of the result-set, respectively. The average must be rounded to 2 decimal points. To round results of aggregate functions, you can use the ROUND function. Hint: Oracle uses the double quotes for the renaming of column names. Consider using the AS clause for aliasing column names
5.Retrieve the total number of items purchased (i.e. items that are part of an invoice) for the invoice with InvocieId of 157. Name the returned column in the result-set as "Total Items (InvoiceId 157)". Hint: Oracle uses the double quotes for the renaming of column names. Consider using the AS clause for aliasing column names
6.Retrieve the names of artists which contain the sequence of characters 'ce'. Sort the result-set by a descending order of Artistid.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
