Question: Queries ( 5 0 points ) Every query must be written in a single SQL statement, meaning that if you were to write it in
Queries pointsEvery query must be written in asingleSQL statement, meaning that if you were to write it in a MySQL client session on a terminal, there would be a single terminating semicolon. So for example, you can have nested or multiple SQLs for a query, provided you can write it all up with a single terminating semicolon in a MySQL client session. No Python code!For any of the queries: If the result might require breaking ties, thenunless otherwise specified in the query, let the MySQL engine deal with it you need not do anything explicit If the result has fewer than the required number of entities, report all of them. For all queries that ask for 'top n or 'most', the result must appear from highest ranked to lowest ranked.Type the SQL queries in the document you will submit, and make sure to write the query number against each query. If you want to play it extra safe, copy the query statement from this list, then write your answer SQL query.Write queries for the following Which genres are most represented in terms of number of songs in that genre?The result must have two columns, namedgenreandnumberofsongs Find names of artists who have songs that are in albums as well as outside of albums singlesThe result must have one column, namedartistname What were the top most highly rated albums highest average user rating in the period Break ties using alphabetical order of album names. Period refers to the rating date, NOT the date of releaseThe result must have two columns, namedalbumnameandaverageuserrating Which were the top most rated genres this is the number of ratings of songs in genres, not the actual rating scores in the years Years refers to the rating date, NOT the date of releaseThe result must have two columns, namedgenrenameandnumberofsongratings Which users have a playlist that has an average song rating of or more? This is the average of the average song rating for each song in the playlist. A user may appear multiple times in the result if more than one of their playlists make the cut.The result must columns namedusernameplaylisttitle,averagesongrating Who are the top most engaged users in terms of number of ratings that they have given to songs or albums? In other words, they have given the most number of ratings to songs or albums combined.The result must have columns, namedusernameandnumberofratings Find the top most prolific artists most number of songs in the years Count each song in an album individually.The result must have columns, namedartistnameandnumberofsongs Find the top songs that are in most number of playlists. Break ties in alphabetical order of song titles.The result must have a columns, namedsongtitleandnumberofplaylists Find the top most rated singles songs that are not part of an album Most rated meaning number of ratings, not actual rating scores. The result must have columns, namedsongtitle,artistname,numberofratings Find all artists who discontinued making music after The result should be a single column namedartisttitle
Queries points can write it all up with a single terminating semicolon in a MySQL client session. No Python code!
For any of the queries:
If the result might require breaking ties, then unless otherwise specified in the query, let the MySQL engine deal with it you need not do anything explicit
If the result has fewer than the required number of entities, report all of them.
For all queries that ask for 'top or 'most', the result must appear from highest ranked to lowest ranked.
Type the SQL queries in the document you will submit, and make sure to write the query number against each query. If you want to play it extra safe, copy the query statement from this list, then write your answer SQL query.
Write queries for the following.
Which genres are most represented in terms of number of songs in that genre?
The result must have two columns, named genre and numberofsongs.
Find names of artists who have songs that are in albums as well as outside of albums singles
The result must have one column, named artistname
What were the top most highly rated albums highest average user rating in the period Break ties using alphabetical order of album names. Period refers to the rating date, NOT the date of release
The result must have two columns, named albumname and averageuserrating.
Which were the top most rated genres this is the number of ratings of songs in genres, not the actual rating scores in the years Years refers to the rating date, NOT the date of release
The result must have two columns, named genrename and numberofsongratings.
The result must columns named username, playlisttitle, averagesongrating
Who are the top most engaged users in terms of number of ra
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
