0% found this document useful (0 votes)
15 views15 pages

Mudil Mathur CS Project

Uploaded by

Mudil Mathur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views15 pages

Mudil Mathur CS Project

Uploaded by

Mudil Mathur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

GREENFIELDS PUBLIC SCHOOL

COMPUTER SCIENCE PROJECT


ON
“ MUSIC LIBRARY SYSTEM”

Submitted in partial fulfillment of the requirements


For
Class XII

Submitted to:
Department Of Computer Science
Submitted By:
NAME- MUDIL MATHUR
CLASS- XII-C3
CBSE ROLL NO-14111418
SUBJECT-Computer Science
SESSION-2024-25
ACKNOWLEDGEMENT
I wish to express my deep gratitude and sincere thanks to our school
management for their encouragement and for all the facilities they provided
for this project work. I sincerely appreciate this magnanimity.

I extend my hearty thanks to Mrs Suman Gupta, my computer science teacher,


who guided me to the successful completion of this project. I take this
opportunity to express my deep sense of gratitude for her invaluable guidance,
constant encouragement, constructive comments, sympathetic attitude and
immense motivation, which has sustained my efforts at all stages of this project
work.

I can’t forget to offer my sincere thanks to my classmates who helped me to


carry out this work successfully and for their valuable advice and support,
which I received from them time to time.

Student Name: Mudil Mathur


CERTIFICATE

This is to certify that this project report “Music Library System” is the

bonafide work of “Mudil Mathur” CBSE Board Roll No. ________ of class

XII for the year 2024-25. He has carried out the project work under my

supervision.

Mrs. Suman Gupta


P.G.T. (Computer Science)
Internal Examiner External Examiner
INDEX

● INTRODUCTION

● FUNCTIONS USED

● TABLES IN DATABASE

● SOURCE CODE

● OUTPUT SCREENSHOTS

● BIBLIOGRAPHY
● INTRODUCTION

● The Music Library Management System is a


project designed to help users manage their
music collections efficiently. This system
allows users to store information about
songs, artists, and albums in a structured
manner using a relational database. Users
can add, update, delete, and search for songs
in their collection. The system aims to
simplify the management of large music
libraries by providing an easy-to-use
interface with powerful search and filter
functionalities.
FUNCTIONS USED

The project utilizes a variety of functions to interact


with the music library database. These include
functions for connecting to the database, adding new
records, updating existing records, deleting records, and
retrieving information based on user queries.
Key Functions:
 connect_to_database(): Establishes a connection to
the database.
 add_song(title, artist, album, genre,

release_year): Adds a new song to the database.


 update_song(song_id, title, artist, album, genre,

release_year): Updates details of an existing song.


 delete_song(song_id): Deletes a song from the

database.
 search_songs(query): Searches for songs based on

a user-provided query.
 display_all_songs(): Displays all songs in the
library.
Tables in Database
The music library system uses a relational database
with the following tables:
Table: Songs
Column
Data Type Description
Name
Primary key, unique
song_id INT
identifier for each song
title VARCHAR(100) Title of the song
artist VARCHAR(100) Name of the artist
album VARCHAR(100) Name of the album
genre VARCHAR(50) Genre of the song
Year the song was
release_year YEAR
released
SOURCE CODE

import sqlite3

# Function to connect to the database


def connect_to_database():
connection = sqlite3.connect('music_library.db')
cursor = connection.cursor()
cursor.execute('''CREATE TABLE IF NOT
EXISTS Songs (
song_id INTEGER PRIMARY KEY
AUTOINCREMENT,
title TEXT NOT NULL,
artist TEXT NOT NULL,
album TEXT NOT NULL,
genre TEXT NOT NULL,
release_year INTEGER
)''')
connection.commit()
return connection

# Function to add a new song


def add_song(title, artist, album, genre,
release_year):
connection = connect_to_database()
cursor = connection.cursor()
cursor.execute('INSERT INTO Songs (title,
artist, album, genre, release_year) VALUES (?, ?, ?,
?, ?)',
(title, artist, album, genre, release_year))
connection.commit()
connection.close()

# Function to display all songs


def display_all_songs():
connection = connect_to_database()
cursor = connection.cursor()
cursor.execute('SELECT * FROM Songs')
songs = cursor.fetchall()
for song in songs:
print(song)
connection.close()

# Main Program
if __name__ == "__main__":
connect_to_database()
print("Welcome to the Music Library
Management System!")
add_song("Shape of You", "Ed Sheeran",
"Divide", "Pop", 2017)
display_all_songs()
OUTPUT SCREENSHOTS

1.Database Table Creation:


 Screenshot of the Songs table created in the database.

2. Adding Songs:
Screenshot showing the successful addition of a song.

3.Displaying Songs:
 Screenshot showing the list of songs in the library.
l

BIBLIOGRAPHY

● Computer science with python by Sumita Arora

● Computer science with python book (PREETI ARORA)

● www.geeksforgeeks.org

You might also like