Online Music Management Project-1

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 15

BIRLA VISHWAKARMA MAHAVIDHYALAYA

SUBJECT : DATABASE MANAGEMENT SYSTEM


SUBJECT CODE : 2CP01
BATCH : C
TOPIC : ONLINE MUSIC LABEL MANAGEMENT SYSTEM

GROUP MEMBER :
 19CP052 – PRANATI TIKKU
 19CP056 – KHUSHI BHABHOR

ONLINE MUSIC LABEL MANAGEMENT SYSTEM IS DIVIDED INTO TWO PARTS.


1. AT ADMIN LEVEL
2. AT USER LEVEL
 FUNCTIONAL REQUIREMENTS

The different tables required for functional requirements and their functions are:
ADMIN TABLE:

 Table Name : administrator


Primary key : a_id

Sr No. Field Name Field Type Field Size Constraint


1 a_id int Primary Key
2 admin_name varchar 50
3 pwd varchar 10

Administrator registers artist.

 Table Name : artist


Primary Key : artist_name

Sr No. Field Name Field Type Field Size Constraint


1 artist_name varchar 50 Primary Key
2 image blob

Administrator add/remove artist. Hence artist_detail table


 Table Name : artist_detail
Primary Key : artist_id

Sr No. Field Name Field Type Field Size Constraint


1 artist_id Int Primary Key
2 artist_name varchar 50
3 artist_detail varchar 60
4 a_rating int
5 song_name varchar 50
6 song_detail varchar 60

Administrator add songs. Hence table of add_song


 Table Name : add_song
Primary Key : song_id

Sr No. Field Name Field Type Field Size Constraint


1 artist varchar 50
2 song_name varchar 50
3 s_rating int
4 song_id int Primary Key
5 movie_name varchar 50
6 release_date date 50

USER TABLE:
 Table 1
Table name: User
Primary key: u_id
This is the user table.
Sr No. Field name Field type Field size Constraint
1 u_id int 10 Primary key
2 Phn_num number 50 -
3 email varchar 10 -
4 password varchar 10 -
5 f_name varchar 20 -
6 lname varchar 20 -

 Table 2
Table name: user_otp
Primary key:u_id
Sr No. Field name Field type Field size Constraint
1 u_id int Primary key
2 email varchar 50 -
3 otp varchar 50 -
User before download the song receives otp.

 Table 3

Table name: playlist


Primary key: u_id
Sr no. Field name Field type Field size constraint
1 u_id Int - Primary key
2 Song varchar max -
3 Artist varchar 50 -
4 username varchar max -
5 movie varchar 50 -
User add songs to playlist
 Table 4

Table name: song details


Primary key: song_id

Sr no. Field name Field type Field size constraint


1 song_id Int Primary key
2 song_name varchar 50 -
3 artist_name varchar 50 -
4 genres varchar 50 -
5 rating int -
User can view song details.

 Table 5

Table name: Ratings


Primary key: r_id
Sr no. Field name Field type Field size constraint
1 r_id Int Primary key
2 email varchar 50
3 ratings Int
4 id int
User can give the ratings to the song or the artist.
 E-R Diagram
 ADMIN E-R DIAGRAM :
 USER E-R DIAGRAM :
 Convert into Relational Model
 ADMIN LEVEL RELATIONAL MODEL :

 USER LEVEL RELATIONAL MODEL :


 FD’s and max Normalization form
Functional Dependency :-

1. Administrator :
a_id  admin_name, pwd
2. Artist :
artist_name  image
3. Artist_detail :
artist_id  artist_name, artist_detail, a_rating, song_name, song_detail
4. Add_songs :
song_id  artist, song_name, s_rating, movie_name, release_date
5. User_detail :
u_id  phn_num, email, password, fname, lname
6. User otp:
u_id  email, otp
7. Playlist:
u_id  song, artist, username, movie
8. Song details:
Song_id  song_name, artist_name, genres, rating
9. Ratings:
r_id email, ratings, id

Normalization :-

1. 1st NORMALIZED FORM :


As per the functional dependency, here all tables have atomic values. Hence, we
can say that it is in 1NF.

2. 2nd NORMALIZED FORM :


As there is no partial dependencies, it is already in 2nd NF.

3. 3rd NORMALIZED FORM :


As there is not any tranitive dependencies, it is in 3rd NF.

4. BOYCE-CODE NORMALIZED FORM :


Here on left side all attributes is Primary Key, so it is already in BCNF.

Hence, as all tables are already normalized upto BCNF, there is no need of normalization.

 Schema in Database
 ADMIN DATABASE :

1. Administrator :
create table administrator (a_id varchar2(30), admin_name
varchar2(50), pwd varchar2(10),primary key (a_id))

2. Artist :
create table artist (artist_name varchar2(50), image
varchar2(50), primary key (artist_name))

3. Artist_detail :
create table artist_detail (artist_id varchar2(30), artist_name
varchar2(50), artist_detail varchar2(60), a_ratings varchar2(30),
song_name varchar2(50), song_detail varchar2(60), primary
key(artist_id))
4. Add_songs :
create table add_songs (song_id varchar2(30),song_name
varchar2(50),artist varchar2(50),movie_name
varchar2(50),release_date date,s_rating varchar2(30), Primary key
(song_id))

 USER DATABASE :

5. User_detail :
create table user_detail (u_id int primary key, phn_num
number(10),email varchar(50),password varchar(10),fname
varchar(20),lname varchar(20))

6. User_otp :
create table user_otp(u_id int primary key,email
varchar(50),otp varchar(50))
7. Playlist :
create table playlist(u_id int PRIMARY KEY,song
varchar(60),artist varchar(50),username varchar(60),movie
varchar(50))

8. Song_details :
create table song_details(song_id int PRIMARY KEY,song_name
varchar(50),artist_name varchar(50),genres varchar(50),ratings
int)
9. Ratings :
create table ratings (r_id number(10)primary key, email
varchar2(40), ratings int, id int)

 Write 10 queries to fetch data from database with output


1) Display the song detail of song name “Wolves”

select song_name,song_detail from artist_detail inner join


artist on artist_detail.artist_name = artist.artist_name where
song_name='Wolves'
2) How many artist have ratings “A”

select count(*) from artist_detail inner join add_songs on


artist_name=artist where a_ratings='A'

3) Retrieve the song name and image number of song from movie
name as song detail “Judwaa 2”

select song_name,song_detail,image from artist_detail inner


join artist on artist_detail.artist_name = artist.artist_name
where song_detail='Judwaa 2'

4) Retrieve the movie name ,song name and artist name of song
that is rated “5 star”

select movie_name,song_name,artist from add_songs where


s_rating='5star'

5)Retrieve song name, image number artist id, artist rating and
artist detail where song detail is “NULL”

Select song_name,song_detail,image,artist_id,a_ratings,artist_detail
from artist_detail inner join artist on artist_detail.artist_name =
artist.artist_name where song_detail='-'
6) Retrieve the user first name and song name where last name is
“Sharma”.

select user_detail.fname,playlist.song from user_detail join


playlist on user_detail.u_id=playlist.u_id where
user_detail.lname='sharma'

7) Retrieve the number of songs in the playlist where first


name=“Neha”.

select count(song)"count" from user_detail join playlist on


user_detail.u_id=playlist.u_id where fname='neha'

8) Retrieve the first name, last name of user as well as song


name whose user id lies between 001 and 011.

select user_detail.fname,user_detail.lname,playlist.song from


user_detail join playlist on user_detail.u_id=playlist.u_id
where user_detail.u_id between 001 and 011
9) Retrieve the otp of user whose playlist contain song name
=“courage”

select otp from user_otp join playlist on


user_otp.u_id=playlist.u_id where song='Courage'

10) Retrieve ratings of songs where movie name is “NULL”

select ratings from song_details join playlist on


playlist.artist=song_details.artist_name where movie='-'

You might also like