LOYOLA ACADEMY CBSE SENIOR SECONDARY SCHOOL
ACADEMIC YEAR 2024-25
PROJECT REPORT ON
“CABLE CONNECTION MANAGEMENT SYSTEM”
ROLLNO :
NAME : P.PRADEEP
CLASS : XII - B
SUBJECT : COMPUTER SCIENCE
SUBJECT CODE : 083
PROJECT GUIDE : MRS. A. LEENA MCA., M.Ed.
SCHOOL : LOYOLA ACADEMY CBSE SCHOOL
VADAMELPAKKAM
CERTIFICATE
This is to certify that P.PRADEEP of class
XII-B of Roll no. of LOYOLA
ACADEMY CBSE SENIOR SECONDARY
SCHOOL has successfully completed
and submitted investigatory project
entitled “CABLE CONNECTION MANAGEMENT
SYSTEM” to the department of
Computer science for Terminal
practical examination 2024-2025 as
set by Central Board of Secondary
Education.
Internal Examiner External
Examiner
Principal’s signature
Acknowledgement
I would like to express my sincere
gratitude to Mrs.A. Leena MCA.,M.Ed., Mam
for their invaluable guidance and support
throughout the completion of this project.
Their expertise and encouragement have
been instrumental in shaping my
understanding of the subject matter.
I am also thankful to Rev.Fr.Arulraj SJ for
providing the necessary resources and
environment conducive to learning, which
enabled me to undertake this project.
Additionally, I extend my appreciation to my
classmates and friends for their assistance
and cooperation during the course of this
project. Their insights and feedback have
greatly contributed to its overall quality.
Finally, I would like to acknowledge the
support of my family for their patience and
understanding during this endeavor.
Thank you all for your support, guidance and
contributions to this project.
INTRODUCTION
Database Interaction: The code involves interacting
with a MySQL database named cable. It connects to the
database and performs operations like creating tables,
inserting data, and querying information from tables
related to customer profiles, maintenance, and
suggestions.
User Interface: The code provides a command-line
interface (CLI) for users to perform actions like:
Adding customer details
Adding maintenance records
Adding suggestions
Fetching records from the database (for customer
profiles, maintenance, and suggestions)
Signing up, signing in, or deleting accounts (login-
related operations)
Tables Created:
customer_profile:
Stores details like code, name, phone
number, year, and address of the customers.
maintainance: Stores maintenance details like code,
name, fees, and rating.
suggestion: Stores customer suggestions with the code,
name, and suggestion text.
Login and Account Management:
Users can create an account, log in, or delete their
account.
The login system checks the username and password
against the user_accounts table and allows users to
either log in or create a new account.
Expected Behavior:
If the script runs successfully, the following will occur:
1. Initial Setup (for creating tables):
o If the cable database does not have the required tables
(customer_profile, maintainance, suggestion), they will be created.
o If the tables already exist, it will print "DATABASE ALREADY
EXISTS" and move to the menu for further operations.
2. Menu Choices: Depending on the user's choice:
o Choice 1 will allow the user to add customer details to the
customer_profile table.
o Choice 2 will allow the user to add maintenance details to the
maintainance table.
o Choice 3 will allow the user to add suggestions to the suggestion
table.
o Choice 4 will exit the program.
3. Login and Account Management:
o Users can sign in, sign up, or delete their accounts from the
user_accounts table.
o If the user chooses to delete an account, the system verifies the
username and password before deletion.
4. Querying Information:
o Users can query the database to get information from the tables
(customer_profile, maintainance, suggestion).
Issues or Considerations:
Error Handling: The code does not have robust error handling for
situations like database connection failures or invalid inputs. While
there's a general try-except for database actions, more specific
exceptions (like mysql.connector.Error) can be caught to provide clearer
error messages.
Security: The password handling is not encrypted. Storing passwords
as plain text in a database is risky. It’s important to hash passwords
before storing them.
SQL Injection Risk: The code is vulnerable to SQL injection as it
constructs SQL queries using string concatenation. Using
parameterized queries (prepared statements) would be safer.
Code Execution:
If you run the CREATE CODE part first (for setting up the tables) and
then the USE CODE part (for adding and querying data), here's what
happens step by step:
1. Connect to MySQL Database: The script connects to the
MySQL database using credentials (host="localhost",
user="Pradeep", password="whio8306", database="cable" ).
2. Create Tables: If the tables don’t already exist, it will
create customer_profile, maintainance, and suggestion tables.
3. Main Menu Interaction: The user will be presented with
options to:
o Add customer details
o Add maintenance records
o Add suggestions
o Exit
4. Account Management Menu: After a user logs in, they can
perform tasks like adding details or querying information
from the database.
5. Login/Signup/Delete:
o If the user selects the option to sign up or log in, the
program will interact with the user_accounts table to verify
credentials.
CREATE CODE
import mysql.connector as sql
conn=sql.connect(host="localhost",user="Pradeep",password="whio8306",database="cable")
try:
if conn.is_connected():
print("connected successfully")
c1=conn.cursor()
c1.execute('create table customer_profile(code int PRIMARY KEY ,name VARCHAR(30),phone_no
int,year int,address VARCHAR(100))')
print("table created")
c1=conn.cursor()
c1.execute('create table maintainance(code int PRIMARY KEY,name VARCHAR(30),fees int,rating
int)')
print("table created")
c1.execute('create table suggestion(code int PRIMARY KEY,name VARCHAR(30),suggestion
VARCHAR(100))')
print("table created")
except:
print("DATABASE ALREADY EXISTS")
print("ROYAL CABLE CONNECTION CENTER")
print("1.ADD DETAILS")
print("2.MAINTAINANCE")
print("3.SUGGESTION")
print("4.EXIT")
choice=int(input("ENTER UR CHOICE:"))
if choice==1:
v_code=int(input("ENTER UR CODE_NO:"))
v_name=input("ENTER UR NAME:")
v_phone_no=int(input("ENTER UR PHONE_NO:"))
v_year=int(input("ENTER THE YEAR U STARTED USING OUR CENTER:"))
v_address=input("ENTER UR ADDRESS(CITY OR VILLAGE NAME):")
v_SQL_insert="insert into customer_profile values("+str(v_code)+",'"+v_name+"',"+str(v_phone_no)
+","+str(v_year)+",'"+v_address+"')"
c1.execute(v_SQL_insert)
print("DETAILS ADDED")
conn.commit()
if choice==2:
v_code=int(input("ENTER UR CODE_NO:"))
v_name=input("ENTER UR NAME:")
v_fees=int(input("ENTER CHARGES:"))
v_rating=float(input("ENTER RATING(out of 10):"))
v_SQL2_insert="insert into maintainance values("+str(v_code)+",'"+v_name+"',"+str(v_fees)
+","+str(v_rating)+")"
c1.execute(v_SQL2_insert)
print("DETAILS ADDED")
conn.commit()
if choice==3:
v_code=int(input("ENTER CODE_NO:"))
v_name=input("ENTER UR NAME:")
v_suggestion=input("ENTER UR SUGGESTION FOR US:")
v_SQL3_insert="insert into suggestion values("+str(v_code)+",'"+v_name+"','"+v_suggestion+"')"
c1.execute(v_SQL3_insert)
print("DETAILS ADDED")
conn.commit()
if choice==4:
quit()
USE CODE
import mysql.connector as sql
conn=sql.connect(host="localhost",user="Pradeep",passwd="whio8306",database="cable")
if conn.is_connected():
print("connected successfully")
c1=conn.cursor()
c1.execute('use cable')
print("ROYAL CABLE CONNECTION CENTER")
print("1.ADD DETAILS")
print("2.MAINTAINANCE")
print("3.SUGGESTIONS")
print("4.GET INFO( customer_profile)")
print("5.GET INFO(maintainance)")
print("6.GET INFO(suggestion)")
print("7.EXIT")
choice=int(input("ENTER UR CHOICE:"))
if choice==1:
v_code=int(input("ENTER UR CODE_NO:"))
v_name=input("ENTER UR NAME:")
v_phone_no=int(input("ENTER UR PHONE_NO:"))
v_year=int(input("ENTER THE YEAR U STARTED USING OUR CENTER:"))
v_address=input("ENTER UR ADDRESS:")
v_SQL_insert="insert into customer_profile values("+str(v_code)+",'"+v_name+"',"+str(v_phone_no)
+","+str(v_year)+",'"+v_address+"')"
c1.execute(v_SQL_insert)
print("DETAILS ADDED")
print("THANK U FOR OUR SUCCESS DEAR CUSTOMERS")
conn.commit()
if choice==2:
v_code=int(input("ENTER UR CODE_NO:"))
v_name=input("ENTER UR NAME:")
v_fees=int(input("ENTER CHARGES:"))
v_rating=float(input("ENTER RATING(out of 10):"))
v_SQL2_insert="insert into maintainance values("+str(v_code)+",'"+v_name+"',"+str(v_fees)
+","+str(v_rating)+")"
c1.execute(v_SQL2_insert)
print("DETAILS ADDED")
print("THANK U FOR OUR SUCCESS DEAR CUSTOMERS")
conn.commit()
if choice==3:
v_code=int(input("ENTER CODE_NO:"))
v_name=input("ENTER UR NAME:")
v_suggestion=input("ENTER UR SUGGESTION FOR US:")
v_SQL3_insert="insert into suggestion values("+str(v_code)+",'"+v_name+"','"+v_suggestion+"')"
c1.execute(v_SQL3_insert)
print("DETAILS ADDED")
print("THANK U FOR OUR SUCCESS DEAR CUSTOMERS")
conn.commit()
if choice==4:
sql_1="select * from customer_profile"
c1.execute(sql_1)
a=c1.fetchall()
for i in a:
print(i)
if choice==5:
sql_1="select * from maintainance"
c1.execute(sql_1)
a=c1.fetchall()
for i in a:
print(i)
if choice==6:
sql_1="select * from suggestion"
c1.execute(sql_1)
a=c1.fetchall()
for i in a:
print(i)
if choice==7:
quit()
CREATE LOGIN
def menu():
print('1.YES')
print('2.NO')
ch=int(input('DO YOU WANT TO CONTINUE OR NOT:'))
while ch==1:
print('WELECOME TO ROYAL CABLE CONNECTION CENTER')
print('1.SIGN IN')
print('2.SIGN UP')
print('3.DELETE ACCOUNT')
print('4.EXIT')
ch1=int(input('ENTER YOUR CHOICE:'))
if ch1==1:
a=checking()
if a==True:
print('WELCOME')
akhil()
else:
continue
elif ch1==2:
a=checking_1()
if a==True:
print('WELCOME')
akhil()
else:
print('PASSWORD ALREADY EXISTS')
continue
elif ch1==3:
c=checking_2()
if c==True:
print('ACCOUNT DELETED')
continue
else:
print('YOUR PASSWAORD OR USER_NAME IS INCORRECT')
continue
elif ch==4:
print('THANK YOU')
break
else:
print('ERROR 404:PAGE NOT FOUND')
break
def akhil():
import mysql.connector as sql
conn=sql.connect(host="localhost",user="root",passwd="whio8306",database="cable")
if conn.is_connected():
print("connected successfully")
c1=conn.cursor()
c1.execute('create table customer_profile(code int PRIMARY KEY ,name VARCHAR(30),phone_no int,year
int,address VARCHAR(100))')
print("table created")
c1=conn.cursor()
c1.execute('create table maintainance(code int PRIMARY KEY,name VARCHAR(30),fees int,rating int)')
print("table created")
c1.execute('create table suggestion(code int PRIMARY KEY,name VARCHAR(30),suggestion
VARCHAR(100))')
print("table created")
print("ROYAL CABLE CONNECTION CENTER")
print("1.ADD DETAILS")
print("2.MAINTAINANCE")
print("3.SUGGESTION")
print("4.EXIT")
choice=int(input("ENTER UR CHOICE:"))
if choice==1:
v_code=int(input("ENTER UR CODE_NO:"))
v_name=input("ENTER UR NAME:")
v_phone_no=int(input("ENTER UR PHONE_NO:"))
v_year=int(input("ENTER THE YEAR U STARTED USING OUR CENTER:"))
v_address=input("ENTER UR ADDRESS(CITY OR VILLAGE NAME):")
v_SQL_insert="insert into customer_profile values("+str(v_code)+",'"+v_name+"',"+str(v_phone_no)
+","+str(v_year)+",'"+v_address+"')"
c1.execute(v_SQL_insert)
print("DETAILS ADDED")
conn.commit()
if choice==2:
v_code=int(input("ENTER UR CODE_NO:"))
v_name=input("ENTER UR NAME:")
v_fees=int(input("ENTER CHARGES:"))
v_rating=float(input("ENTER RATING(out of 10):"))
v_SQL2_insert="insert into maintainance values("+str(v_code)+",'"+v_name+"',"+str(v_fees)+","+str(v_rating)
+")"
c1.execute(v_SQL2_insert)
print("DETAILS ADDED")
conn.commit()
if choice==3:
v_code=int(input("ENTER CODE_NO:"))
v_name=input("ENTER UR NAME:")
v_suggestion=input("ENTER UR SUGGESTION FOR US:")
v_SQL3_insert="insert into suggestion values("+str(v_code)+",'"+v_name+"','"+v_suggestion+"')"
c1.execute(v_SQL3_insert)
print("DETAILS ADDED")
conn.commit()
if choice==4:
quit()
def checking_2():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='whio8306',database='cable')
cursor=mycon.cursor()
mycon.autocommit=True
a=input('USER NAME:')
b=input('PASS WORD:')
try:
s1="select user_name from user_accounts where password='{}'".format(b)
cursor.execute(s1)
data=cursor.fetchall()[0]
data=list(data)
if data[0]==a:
b1="delete from user_accounts where password = '{}'".format(b)
cursor.execute(b1)
return True
else:
return False
except:
print('ACCOUNT DOES NOT EXIST')
def checking_1():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='whio8306',database='cable')
cursor=mycon.cursor()
mycon.autocommit=True
a=input('USER NAME:')
b=input('PASS WORD:')
c=input('RE-ENTER YOUR PASS WORD:')
if b==c:
try:
c1="insert into user_accounts values('{}','{}')".format(a,b)
cursor.execute(c1)
print('WELCOME')
return True
except:
return False
else:
print('BOTH PASSWORDS ARE NOT MATCHING')
def checking():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='whio8306',database='cable')
cursor=mycon.cursor()
mycon.autocommit=True
a=input('USER NAME:')
b=input('PASS WORD:')
try:
s1="select user_name from user_accounts where password='{}'".format(b)
cursor.execute(s1)
data=cursor.fetchall()[0]
data=list(data)
if data[0]==a:
return True
else:
return False
except:
print('ACCOUNT DOES NOT EXIST')
menu()
USE LOGIN
def menu():
print('1.YES')
print('2.NO')
ch=int(input('DO YOU WANT TO CONTINUE OR NOT:'))
while ch==1:
print(' WELECOME TO JP CABLE CONNECTION CENTER ')
print('1.SIGN IN')
print('2.CREATE NEW ACCOUNT')
print('3.DELETE ACCOUNT')
print('4.GET INFO FROM CUSTOMER PROFILE')
print('5.EXIT')
ch1=int(input('ENTER YOUR CHOICE:'))
if ch1==1:
a=checking()
if a==True:
print('WELCOME')
akhil()
else:
continue
elif ch1==2:
a=checking_1()
if a==True:
print('WELCOME')
akhil()
else:
print('PASSWORD ALREADY EXISTS')
continue
elif ch1==3:
c=checking_2()
if c==True:
print('ACCOUNT DELETED')
continue
else:
print('YOUR PASSWAORD OR USER_NAME IS INCORRECT')
continue
elif ch==5:
print('THANK YOU')
break
else:
print('ERROR 404:PAGE NOT FOUND')
break
def akhil():
import mysql.connector as sql
conn=sql.connect(host="localhost",user="root",passwd="whio8306",database="cable")
if conn.is_connected():
print("connected successfully")
c1=conn.cursor()
c1.execute('use cable')
print("1.ADD DETAILS")
print("2.MAINTAINANCE")
print("3.SUGGESTION")
print("5.GET INFO OF ACCOUNTS")
print("4.EXIT")
choice=int(input("ENTER UR CHOICE:"))
if choice==1:
v_code=int(input("ENTER UR CODE_NO:"))
v_name=input("ENTER UR NAME:")
v_phone_no=int(input("ENTER UR PHONE_NO:"))
v_year=int(input("ENTER THE YEAR U STARTED USING OUR CENTER:"))
v_address=input("ENTER UR ADDRESS(CITY OR VILLAGE NAME):")
v_SQL_insert="insert into customer_profile values("+str(v_code)+",'"+v_name+"',"+str(v_phone_no)
+","+str(v_year)+",'"+v_address+"')"
c1.execute(v_SQL_insert)
print("DETAILS ADDED")
conn.commit()
if choice==2:
v_code=int(input("ENTER UR CODE_NO:"))
v_name=input("ENTER UR NAME:")
v_fees=int(input("ENTER CHARGES:"))
v_rating=float(input("ENTER RATING(out of 10):"))
v_SQL2_insert="insert into maintainance values("+str(v_code)+",'"+v_name+"',"+str(v_fees)
+","+str(v_rating)+")"
c1.execute(v_SQL2_insert)
print("DETAILS ADDED")
conn.commit()
if choice==3:
v_code=int(input("ENTER CODE_NO:"))
v_name=input("ENTER UR NAME:")
v_suggestion=input("ENTER UR SUGGESTION FOR US:")
v_SQL3_insert="insert into suggestion values("+str(v_code)+",'"+v_name+"','"+v_suggestion+"')"
c1.execute(v_SQL3_insert)
print("DETAILS ADDED")
conn.commit()
if choice==4:
sql_1="select * from customer_profile"
c1.execute(sql_1)
a=c1.fetchall()
for i in a:
print(i)
if choice==5:
quit()
def checking_2():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='manager',database='cable')
cursor=mycon.cursor()
mycon.autocommit=True
a=input('USER NAME:')
b=input('PASS WORD:')
try:
s1="select user_name from user_accounts where password='{}'".format(b)
cursor.execute(s1)
data=cursor.fetchall()[0]
data=list(data)
if data[0]==a:
b1="delete from user_accounts where password = '{}'".format(b)
cursor.execute(b1)
return True
else:
return False
except:
print('ACCOUNT DOES NOT EXIST')
def checking_1():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='manager',database='cable')
cursor=mycon.cursor()
mycon.autocommit=True
a=input('USER NAME:')
b=input('PASS WORD:')
c=input('RE-ENTER YOUR PASS WORD:')
if b==c:
try:
c1="insert into user_accounts values('{}','{}')".format(a,b)
cursor.execute(c1)
print('WELCOME')
return True
except:
return False
else:
print('BOTH PASSWORDS ARE NOT MATCHING')
def checking():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='manager',database='cable')
cursor=mycon.cursor()
mycon.autocommit=True
a=input('USER NAME:')
b=input('PASS WORD:')
try:
s1="select user_name from user_accounts where password='{}'".format(b)
cursor.execute(s1)
data=cursor.fetchall()[0]
data=list(data)
if data[0]==a:
return True
else:
return False
except:
print('ACCOUNT DOES NOT EXIST')
menu()
OUTPUT
CREATE
when tables are created:
If the tables already exist:
Choice 1: Add Customer Details (Adding a customer profile):
Choice 2: Add Maintenance Details:
Choice 3: Add Suggestion:
Choice 4: Exit:
customer profiles (Choice 4 in USE CODE part):
maintenance records (Choice 5 in USE CODE part):
suggestions (Choice 6 in USE CODE part):
LOGIN
Sign Up (Choice 2 in Login):
Sign In (Choice 1 in Login):
Delete Account (Choice 3 in Login):
Full Run Output: