Computer (CD Management)
Computer (CD Management)
A Project Report
on
CD Management System
for
CERTIFICATE
This is to certify that the Dissertation entitled, CD Management System is a bonafide work done
by Mr. Harshit Prasad of class XII Science during the academic session 2024-2025 in partial fulfillment of
CBSE's SSCE Examination 2025 and has been carried out under my direct supervision and guidance. This
report or a similar report on the topic has not been submitted for any other examination and does not form a
______________ ________________
______________
Signature of Principal Seal of the School
DECLARATION
I hereby declare that this project entitled “CD Management System” undertaken at Emerald International
School is a comprehensive record of the project work submitted by me for the partial fulfillment of the
This project has been carried out under the guidance of Mr. Shankar Hakke (PGT-Computer Science /
Informatics Practices), whose constant support has been invaluable throughout the course of its development.
I affirm that the contents of this project are a product of my own original work and research and that it is not a
reproduction of any project work that has been previously done or submitted by any individual.
At the completion of this project, I would like to cordially extend my sincerest gratitude to Emerald
International School, which provided me with the necessary opportunities to fulfill my wishes and achieve my
goals.
I would like to express a deep debt to Mr. Shankar Hakke (PGT-Computer Science / Informatics Practices),
my project guide, for his vital suggestions, meticulous guidance and constant motivation, which went a long
I cannot move on without thanking my respected Principal for creating the required academic environment
On a more personal note, my deepest appreciation and gratitude go to my beloved parents, who have been an
3. Source Code……………………...……………….………………..8-13
4. Outputs………………………….………………………..…….…14-19
5. Bibliography…………………………..…………………...…………20
Introduction to Python :
Python is a high-level, interpreted, and general-purpose programming language that was created by
Guido van Rossum and first released in 1991. Python has become one of the most popular
programming languages in the world due to its simplicity, readability, and versatility. It emphasizes
code readability with its use of indentation, making it an ideal language for beginners and
experienced developers alike. Python's syntax is clean, and its language constructs and object-
oriented approach aim to help developers write clear, logical code. Its dynamic typing and garbage
collection features make it an excellent choice for rapid development, prototyping, and a variety of
applications.
Applications of Python :
Python is a versatile programming language and is used in a wide range of fields and industries.
Below are some of the key areas where Python is commonly used
1. Web Development: Python is extensively used in web development. Frameworks like
Django, Flask, and Fast API make it easier to build scalable, secure, and efficient web
applications. Python also integrates well with front-end technologies and can be used to create
REST ful APIs and dynamic websites.
2. Automation and Scripting: Python is often used for automating repetitive tasks. You can
write scripts to automate file handling, email sending, web scraping, and data entry, saving
time and effort in tasks that would otherwise be manual.
3. Networking: Python is used to build networking applications, including chat servers, data
transfer tools, and remote communication software. Libraries such as socket and Twisted are
widely used for network programming.
4. Finance and Trading: Python is extensively used in the financial industry for quantitative
analysis, risk management, and algorithmic trading. Libraries like QuantLib, Pandas, and
PyAlgoTrade provide tools for working with financial data and creating trading strategies.
Introduction MySQL :
Introduction to SQL (Structured Query Language)
SQL (Structured Query Language) is a standard programming language used to manage and
manipulate relational databases. It is the backbone of most relational database management systems
(RDBMS), such as MySQL, PostgreSQL, Oracle, SQL Server, and SQLite. SQL allows users to
query, insert, update, delete, and manage data in a structured format within a database.
SQL is a declarative language, which means that users specify what data they want to work with, not
how to retrieve it. This makes it very user-friendly and highly effective for interacting with large
datasets.
SQL was initially developed in the early 1970s by Donald D. Chamberlin and Ray Boyce at IBM,
and it has since become the industry standard for relational databases.
Key Features :
1) Standardized: SQL is an ANSI and ISO standard language, which means that its core syntax and
functionality are consistent across most RDBMS.
2) Data Manipulation: SQL is designed to interact with structured data stored in relational tables.
It provides powerful commands for performing operations like:
Insert , Update , Delete , Select
3) Data Definition: SQL allows users to define and modify database structures (schemas, tables,
indexes, etc.). This is done using Data Definition Language (DDL) commands like CREATE,
ALTER, and DROP.
4) Data Integrity: SQL provides features like primary keys, foreign keys, and constraints to ensure
that data remains consistent and valid.
Source Code
import mysql.connector
print("""
*********************************************************
_______________________________________________________
| ========================================= |
| * DiscTracker * |
| ========================================= |
| Track Every Track, Relive Every Moment |
|_______________________________________________________|
*********************************************************
CD Management System
*********************************************************
""")
try:
db = mysql.connector.connect(
host="localhost", user="root", passwd=passwd)
except:
print("Connection failed. Try again.")
exit()
cursor = db.cursor()
tables = {
"hits_90s": """
CREATE TABLE IF NOT EXISTS hits_90s (
id INT PRIMARY KEY,
title VARCHAR(100) NOT NULL,
artist VARCHAR(100) NOT NULL,
year INT NOT NULL
)
""",
"hits_2000s": """
CREATE TABLE IF NOT EXISTS hits_2000s (
id INT PRIMARY KEY,
title VARCHAR(100) NOT NULL,
artist VARCHAR(100) NOT NULL,
year INT NOT NULL
)
""",
"hits_2010s": """
CREATE TABLE IF NOT EXISTS hits_2010s (
id INT PRIMARY KEY,
title VARCHAR(100) NOT NULL,
artist VARCHAR(100) NOT NULL,
year INT NOT NULL
)
"""
}
db.commit()
if records:
print(f"\n{'ID':<5} {'Title':<30} {'Artist':<30} {'Year':<10}")
print("-" * 75)
for row in records:
print(f"{row[0]:<5} {row[1]:<30} {row[2]:<30} {row[3]:<10}")
else:
print("No records found.\n")
return 0
def edit_record(cursor, db):
print("\n--- Edit Record ---")
print("1. Edit 90's Hits")
print("2. Edit 2000's Hits")
print("3. Edit 2010's Hits")
table_mapping = {
'1': 'hits_90s',
'2': 'hits_2000s',
'3': 'hits_2010s'
}
table_name = table_mapping[choice]
c = view_table(cursor, table_name)
if c == 0:
print("Nothing can be edited.")
return
record_id = input(f"\ncmgcmgEnter the ID of the record to edit from {table_name.replace('_', ' ').title()}:
").strip()
if not record_id.isdigit():
print("Invalid ID. Please enter a numeric value.\n")
return
if record:
print(f"\nCurrent details: Title: {record[1]}, Artist: {record[2]}, Year: {record[3]}")
table_mapping = {
'1': 'hits_90s',
'2': 'hits_2000s',
'3': 'hits_2010s'
}
table_name = table_mapping[choice]
c = view_table(cursor, table_name)
if c == 0:
print("Nothing can be deleted.")
return
record_id = input(f"\nEnter the ID of the record to delete from {table_name.replace('_', ' ').title()}: ").strip()
if not record_id.isdigit():
print("Invalid ID. Please enter a numeric value.\n")
return
if record:
cursor.execute(f"DELETE FROM {table_name} WHERE id = %s", (record_id,))
db.commit()
print(f"Record ID {record_id} deleted successfully from {table_name.replace('_', ' ').title()}.\n")
else:
print(f"Record ID {record_id} not found in {table_name.replace('_', ' ').title()}.\n")
# Menu System
def menu(cursor, db):
while True:
print("\n====== DiscTracker ======")
print("1. Add Entry to 90's Hits")
print("2. Add Entry to 2000's Hits")
print("3. Add Entry to 2010's Hits")
print("4. View 90's Hits")
print("5. View 2000's Hits")
print("6. View 2010's Hits")
print("7. Edit a Record")
print("8. Delete a CD Record")
print("9. Exit")
print("10. Reset the Database")
print("=" * 40)
if choice == '1':
add_entry(cursor, db, 'hits_90s')
elif choice == '2':
add_entry(cursor, db, 'hits_2000s')
elif choice == '3':
add_entry(cursor, db, 'hits_2010s')
elif choice == '4':
view_table(cursor, 'hits_90s')
elif choice == '5':
view_table(cursor, 'hits_2000s')
elif choice == '6':
view_table(cursor, 'hits_2010s')
elif choice == '7':
edit_record(cursor, db)
elif choice == '8':
delete_record(cursor, db)
elif choice == '9':
print("Exiting Program... Goodbye!")
db.close()
break
elif choice == '10':
print("Database has been reset.")
cursor.execute("Drop database cd_management\n")
db.commit()
db.close()
break
else:
print("Invalid Choice. Please try again.\n")
menu(cursor, db)
Outputs
Output Screen – 1:
Greeting Screen
Output Screen – 2:
Main Interface
Output Screen-– 3:
Adding Record
Output Screen – 4:
Viewing the record
Output Screen – 5:
Adding another record
Output Screen – 6:
Viewing the record
Output Screen – 7:
Deleting a record
Output Screen – 8:
Updating a record
Output Screen – 9:
Viewing the updated record
Books:
1. ‘Computer Science with Python’ by NCERT
2. ‘Computer Science with Python’ by Sumita Arora
3. ‘My SQL for Python’ by Darryl E. Baily
4. ‘Learning Python’ by Mark Lutz
Websites/Videos:
1. www.google.com
2. www.geeksforgeeks.org/python-programming-language/
3. www.geeksforgeeks.org/python-mysql/
4. www.w3schools.com/python/
5. www.w3schools.com/mysql/
6. https://stackoverflow.com/