Question: Note : I've created the database and made the script to create the table and insert the records into the tables but I am unable

Note: I've created the database and made the script to create the table and insert the records into the tables but I am unable to add it here. The only favor I want from you to write the SQL query for the following questions? I am using the MS SQL Server.

Please answer within 24 hours.

Note: I've created the database and made the script to create the

table and insert the records into the tables but I am unable

In this problem, you have to write SQL and RA queries for an online music app database, similar to Spotify. Here are the tables: User (uid, uname, profiletext) Artist (artistid, artistName, nationality) Album (albumld, albumName, release Time) Song (sid, sname, artistld, language, style, duration, release Time) Playlist (playlistld, playlistName, uid, create Time, description) SongInAlbum (sid, albumld) SongInPlaylist (sid, playistld, addTime) PlayHistory (uid, sid, startTime, endTime) The music streaming app provides various songs in the system, and users can listen to songs using the app. They can also create their own playlists with name and description. After a playlist is created, one or more songs can be added to it. When a user listens to one song at some time, the system will keep a record of the play history, including the user, the song, start time, and end time (since the user may stop listening early). Every song has a unique id, a name, a creator, language, style, duration, and release date. One song is released one time, but can be added to multiple albums. Those albums may have different names and may be released at different dates. So the release time for the song and the album can be different. Also a song may not belong to any album. But an album must contain at least one song. Note that there could be many different songs with the same title (sname) but different sids. These could be different recordings of the same song by the same artist, or other artists recording the same song, or completely different songs that have the same title -- we do not keep track of which case it is. Also, each record in song has only one style, e.g., "Classic", Pop, Rock, Jazz, etc. (c) Write the following SQL queries and execute them on your database. Show the queries and the results: (i) List the id and name of any song that does not belong to an album. (ii) List the id and name of every song that is saved in a playlists where the playlist contains the word sleep (only output each song once). (iii) List the id and name of any user who has played at least one song created by a French artist. (iv) List any multi-language album with album name and release time. (v) For each song, list the sid, sname, artist name, and the number of times it was played during 2020. The result should be sorted in descending order based on how often a song has been played (startTime should be in the year 2020). (vi) Output the id, name, and nationality of the artist who released the largest number of songs of style Jazz during 2020. (vii) Output the id and name of any user who has played every song by Justin Bieber at least once. (viii) List the id, name, and description of any album that contains at least ten songs of style Folk. (d) Write expressions in Relational Algebra for queries (iv) to (viii). (e) Write SQL statements to perform the following updates to the database: (i) The user with id 3 adds the song named Hold On" from playlist Motivation to playlist Rock (assume there is only one such song). (ii) The user with id 5 deletes all his(/her) play story within the last 30 days. (iii) The user with id 10 creates a playlist named Reading with the description Soft piano music to accompany reading

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!