Symphony

Music Streaming Platform based on full implementation of DBSM

List of Commands

  1. Insert User (INSERT)

Function to implement input in USER

  1. Get all Albums by a Artist (QUERY : PROJECTION)

Function to display all the albums by a particular artist

  1. Query Song by Genre (QUERY : PROJECTION)

Get all song names with a input genre say “Pop”

  1. Get Artist with max followers (QUERY : AGGREGATE)

Get the name of the artist with maximum followers

  1. Remove User By Email (DELETE)

Remove a user from the USER table who has a given email

  1. Update User Contact (UPDATE)

Update a given user’s contact

  1. Insert Song (INSERT)

Insert a new song into the SONG relation

  1. Get Podcasts of greater than 1 hour duration (QUERY : SELECTION)

Get all podcasts that have a duration greater than 1 hour

  1. Get Playlist with max saves (QUERY : AGGREGATE)

Get playlist with maximum saves

  1. Get Podcast with minimum duration (QUERY : AGGREGATE)

Get the podcast with the shortest duration

  1. Get artist with over 1 lakh followers (QUERY : SELECTION)

Get all artists that have more than 1 lakh followers

  1. Query Podcast Language (QUERY : SEARCH)

Get all podcasts available in a given language

  1. Get all songs in album (QUERY : SELECTION)

Get all songs in a given album

  1. Get premium users with specific plan (QUERY : SEARCH)

Get names of all permium users with a particular pl

  1. Add an episode in a existing podcast (INSERT)

Adds a new episode in an existing podcast

  1. Analysis of popular album (QUERY : ANALYSIS)

List of popular albums based on average likes on all songs in the album

  1. User Likes Song (UPDATE + INSERT)

Increments song’s likes when user likes it

  1. User Follows Artist (UPDATE + INSERT)

When a user follows a artist, update artist_followers and insert a record in FOLLOWS

  1. User Saves Playlist (UPDATE + INSERT)

When a user saves a new playlist, update playlist_saves in PLAYLIST and insert a record in SAVES

  1. Top Genres for a User (ANALYSIS)

List of top genres for a user based on song likes

  1. Exit

EXIT

Requirements

  • Python3

$ sudo apt-get update
$ sudo apt-get install python3.8
  • MySQL
  • PyMySQL

$ sudo apt-get install python3-pip
$ pip3 install pymysql

Installation

You will need to replicate the SYMPHONY databse on your local machine, for which the dump.sql file is provided herewith.

Open your MySQL server and run the following command to import the database:

$ docker exec -i mysql sh -c 'exec mysql -uroot -ppassword' < dump.sql

You might need to enter your password in the next step.

To run the CLI, change your directory to the cloned folder and run the following command:

$ python3 symphony.py

If you are using Docker to run MySQL, you might need to first change your port to 5005 (or the port you use) by replacing the following lines for connecting the database in the symphony.py file: 

con = pymysql.connect(host='localhost',
                              user=username,
                              password=password,
                              db='SYMPHONY',
                              port='5005',
                              cursorclass=pymysql.cursors.DictCursor)

near lines 674-675.

HAPPY LISTENING !!!

GitHub

View Github