[DBMS] Analyzing the Database of YouTube Music - With ERD
![[DBMS] Analyzing the Database of YouTube Music - With ERD](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1684083193335%2F8929b932-092a-4286-be86-62760a170a6e.jpeg&w=3840&q=75)
Computer Science Enthusiast with a Drive for Excellence | Data Science | Web Development | Passionate About Tech & Innovation
Introduction
In this article, I will talk about my analysis of YouTube Music's database. I am doing this just for practice to get a better idea of the DBMS.
I am a freshman at university, not a professional software engineer, so there could be a misinterpretation. It is my pleasure if you can leave some comments on how you would alter what I have done or which part I can make improvements.
I only created the database for major features, such as a playlist, user account, song, singer, etc because it is too many if I do all.
Structure



There would be much more entities and attributes in their actual database system, but I added the attributes that I could identify by looking at the app.
Entity Relationship Diagram

I am sorry for the watermark (I am not using a pro, so)
This is a photo without the watermark, but it is less clear.

Challenges
The most challenging part was identifying the attributes. For example, I was unsure because I thought the TopArtists entity should have ARTIST_ID to identify other attributes, such as COUNTRY_ID, FOLLOWER_ID, ARTIST_FNAME and ARTIST_FNAME. Accordingly, I am not sure if it is correct to leave the TopArtists entity like that. I decided to leave it like that because it has a 1-to-many relationship with the Artist entity. The foreign key must be on the "many" side, which is the Artist entity.
Another challenge was identifying the data type for the ALBUM_COVER attribute under the Albums entity. The album cover will be the image, so I thought about it for minutes. I was able to find two options.
VARBINARY(n) and VARBINARY(max)
VARCHAR()
VARBINARY() is similar to the VARCHAR type, but stores binary byte strings rather than non-binary character strings.
VARCHAR() can be used when we want to store an URL (or path) of the image.
In my ERD, I chose to use VARCHAR().
Conclusion
My ERD and database structure could be wrong, so please give me some feedback, so I can learn from you guys. Thank you for reading :)
![[CS fundamentals] Linked List Creation & Insertion explained in C.](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fuploads%2Fcovers%2F644c253f17f6efe1e02ade41%2F6a74e5c0-44ca-4110-9ee7-e8e67767a9dc.png&w=3840&q=75)
![[CS Fundamentals] Pointers in C](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fuploads%2Fcovers%2F644c253f17f6efe1e02ade41%2F6f81f5a6-d87c-4382-883f-fa4d0a8b5968.png&w=3840&q=75)
![[SQL] Writing Efficient SQL Queries](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1751292603168%2Fb0b43c7d-8e08-47b2-a64c-b600e3511831.jpeg&w=3840&q=75)
![[CS Fundamentals] Binary Search](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1747041878054%2Fc8d8adb9-097d-484b-9562-f43e4bce9a46.png&w=3840&q=75)
![[CS Fundamentals] Sorting Algorithms](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1746973590876%2Ffab37371-1496-42ef-950b-432e7637c89e.png&w=3840&q=75)