SRI CHAITANYA TECHNO SCHOOL ,IYYAPPANTHANGAL
ACADEMIC YEAR: 2024-25
PROJECT REPORT ON
(ENTER THE NAME OF THE PROJECT)
ROLL NO :
NAME :
CLASS : XII
SUBJECT : Computer Science
SUB CODE : 083
PROJECT GUIDE : Mrs. M. Sashi Kala
PGT (Computer Science)
SRI CHAITANYA TECHNO SCHOOL
IYYAPPANTHANGAL, CHENNAI
1
SRI CHAITANYA TECHNO SCHOOL IYYAPPANTHANGAL
CERTIFICATE
This is to certify that Cadet ___________________Roll No:_____________
has successfully completed the project Work entitled (ENTER THE NAME OF THE
PROJECT) in the subject COMPUTER SCIENCE (083) laid down in the regulations
of CBSE for the purpose of Practical Examination in Class XII to be held in
Sri Chaitanya Techno School IYYAPPANTHANGAL on______________.
DATE:
PRINCIPAL
INTERNAL EXAMINER EXTERNAL EXAMINER
2
ACKNOWLEDGEMENT
Apart from the efforts of me, the success of any project depends largely on
the encouragement and guidelines of many others. I take this opportunity to express
my gratitude to the people who have been instrumental in the successful completion
of this project.
I express deep sense of gratitude to almighty God for giving me strength for
the successful completion of the project.
I express my heartfelt gratitude to my parents for constant encouragement
while carrying out this project.
I gratefully acknowledge the contribution of the individuals who contributed in
bringing this project up to this level, who continues to look after me despite my flaws,
I express my deep sense of gratitude to the luminary The Principal, who has
been continuously motivating and extending their helping hand to us.
My sincere thanks to Mrs. M. Sashi Kala Master In-charge, A guide, Mentor
all the above a friend, who critically reviewed my project and helped in solving each
and every problem, occurred during implementation of the project
The guidance and support received from all the members who contributed
and who are contributing to this project, was vital for the success of the project. I am
grateful for their constant support and help.
3
Table of Contents
S.No Topic Page No.
1 Certificate 2
2 Acknowledgement 3
3 Hardwares and Softwares Required 5
4 Introduction 6
5 Python Source Code 9
6 MySQL Database 12
7 Outputs 15
8 References 23
4
1. Certificate (Page 2)
A project certificate must include the following components:
Project Title: Music Playlist Manager Using Python and SQL.
Submitted by: Your full name.
Class: 12th
Roll Number: Your roll number (if applicable).
Submitted to: Your subject teacher’s name.
School Name: Include the school name and school logo.
Date: Date of submission.
Teacher’s Signature: Space for the teacher’s signature and remarks.
5
3. Hardwares and Softwares Required (Page 5)
This section specifies the requirements for the successful execution of the project.
Hardware Requirements:
1. A computer/laptop with at least 4GB RAM.
2. Intel or AMD Processor (minimum dual-core processor).
3. Hard disk space: 100 MB minimum for Python and MySQL setup.
4. Internet connection (optional for downloading resources).
Software Requirements:
1. Operating System: Windows 10/11, Linux, or macOS.
2. Python Version: Python 3.8 or higher.
3. Database: MySQL Server 8.0.
4. Python Libraries:
o mysql-connector-python (for database connectivity)
o os (for file management tasks)
5. Code Editor: Visual Studio Code, PyCharm, or IDLE (any preferred editor).
6. MySQL Workbench: For managing the database visually.
Installation Steps:
1. Install Python: Download from https://www.python.org and verify installation using
python --version.
2. Install MySQL Server and set up the root user.
3. Install MySQL Connector for Python:
pip install mysql-connector-python
4. Set up MySQL Workbench (optional) for managing the database.
6
4. Introduction (Page 6)
The Music Playlist Manager project aims to provide users with a system to organize and
manage music playlists using Python and SQL.
What is a Music Playlist Manager?
A music playlist manager allows users to store, view, delete, and search for songs in their
playlists. Songs are categorized based on title, artist, genre, and duration. This system uses:
Python for building the interface and logic.
SQL for storing and managing the song data in a relational database.
Purpose of the Project:
To demonstrate how Python can interact with SQL databases.
To enable students to design a real-world application that includes both front-end
logic and back-end storage.
To provide a user-friendly interface for managing music collections.
Objectives:
1. Develop a menu-driven program to:
o Add a song to the playlist.
o View all songs.
o Delete a song from the playlist.
o Search for a specific song based on title or artist.
2. Use MySQL to create and manage the database.
3. Establish database connectivity with Python using mysql-connector-python.
Technologies Used:
1. Python for programming logic.
2. MySQL for data storage.
3. MySQL Connector for database connectivity.
7
5. Python Source Code (Page 9)
Here is the full Python Source Code for the project:
import mysql.connector
# Database connection
conn = mysql.connector.connect(
host="localhost",
user="root",
password="password",
database="playlist_db"
)
cursor = conn.cursor()
# Create songs table if not exists
cursor.execute('''CREATE TABLE IF NOT EXISTS songs (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(100),
artist VARCHAR(100),
genre VARCHAR(50),
duration TIME
)''')
def add_song():
title = input("Enter song title: ")
artist = input("Enter artist name: ")
genre = input("Enter genre: ")
duration = input("Enter duration (HH:MM:SS): ")
cursor.execute("INSERT INTO songs (title, artist, genre, duration)
VALUES (%s, %s, %s, %s)",
(title, artist, genre, duration))
conn.commit()
print("Song added successfully!")
def view_songs():
cursor.execute("SELECT * FROM songs")
for song in cursor.fetchall():
print(song)
def delete_song():
song_id = input("Enter the Song ID to delete: ")
cursor.execute("DELETE FROM songs WHERE id = %s", (song_id,))
conn.commit()
print("Song deleted successfully!")
def menu():
while True:
print("\n1. Add Song\n2. View Songs\n3. Delete Song\n4. Exit")
choice = int(input("Enter your choice: "))
if choice == 1:
add_song()
elif choice == 2:
view_songs()
elif choice == 3:
delete_song()
elif choice == 4:
break
else:
print("Invalid Choice!"
8
# Run the menu
menu()
# Close database connection
conn.close()
9
6. MySQL Database (Page 12)
Database Name: playlist_db
Table Structure:
Column Name Data Type Description
id INT PRIMARY KEY Auto-incremented Song ID.
title VARCHAR(100) Song Title.
artist VARCHAR(100) Artist Name.
genre VARCHAR(50) Genre of the song.
duration TIME Duration of the song.
SQL Query to Create Table:
CREATE TABLE songs (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(100),
artist VARCHAR(100),
genre VARCHAR(50),
duration TIME
);
10
7. Outputs (Page 15)
Screenshots to Include:
1. Python code in your editor.
2. MySQL table structure.
3. Running the program with:
o Adding a song.
o Viewing all songs.
o Deleting a song.
11
8. References (Page 17)
1. Python Documentation: https://docs.python.org
2. MySQL Documentation: https://dev.mysql.com
3. Tutorials and guides: W3Schools, Geeksfor
12