𝔾𝕠𝕧𝕥.
𝔾𝕚𝕣𝕝𝕤 𝕤𝕖𝕟𝕚𝕠𝕣 𝕤𝕖𝕔𝕠𝕟𝕕𝕒𝕣𝕪 𝕤𝕔𝕙𝕠𝕠𝕝
𝔹ℍ𝕆ℝ𝔾𝔸ℝℍ
COMPUTER SCIENCE
PROJECT REPORT ON
“ Computer Institute
Management System”
(PYTHON INTERFACE WITH MYSQL)
ACADEMIC YEAR 2024-25
Name - Shalini & Dipika
Class - XII ‘C’ & ‘A’
Student id. - 20180254730
Submitted to - Mrs.Ritu Chhikara
CERTIFICATE
This is to certify that Shalini & Dipika of Class XII has prepared
the report on the Project entitled “Computer Institute
Management System”. The report is found worthy of acceptance
as final project report for the subject Computer Science of Class
XII. They have prepared the report under my guidance.
TEACHER'S SIGN
____________________
ACKNOWLEDGEMENT
We would like to express a deep sense of thanks &
gratitude to my project guide for guiding us immensely
through the course of the project.
Our sincere thanks goes to RITU CHHIKARA
MAM, our COMPUTER SCIENCE TEACHER for his
co-ordination in extending every possible support for
the completion of this project.
We also thank to our parents for their motivation &
support. We must thank to our classmates for their timely
help & support for compilation of this project.
Last but not the least, we would like to thank all those
who had help directly or indirectly towards the completion of
this project.
TEACHER'S SIGN.
_______________
TABLE OF CONTENTS
01 INTRODUCTION
02 OBJECTIVES OF THE PROJECT
03 PROPOSED SYSTEM
04 PYTHON INTRODUCTION
05 MYSQL INTRODUCTION
06 INTERFACE PYTHON WITH MySQL
HARDWARE AND SOFTWARE REQUIREMENTS
07
INSTALLING PROCESS
08
SOURCE CODE
09
OUTPUTS
10
BIBLIOGRAPHY
11
PROJECT ON
COMPUTER INSTITUTE
MANAGEMENTSYSTEM
1) INTRODUCTION
The Computer Institute Management System is a software used to
register oneself for a course in our Computer Institute.
Note:
• Allow the user to input their number, name, desired course,
DOB, Phone number and address.
• Allow the administrator to delete an enrollment, edit the
name, course,address, DOB and phone number of a candidate.
• Allows the user to see the details.
2) OBJECTIVES OF THE PROJECT
The objective of this project is to let the students apply the
programming knowledge into a real- world situation/problem and
exposed the students how programming skills helps in developing a good
software.
• Write programs utilizing modern software tools.
• Apply object oriented programming principles effectively when
developing small to medium sized projects.
• Write effective procedural code to solve small to medium sized
problems.
• Students will demonstrate a breadth of knowledge in computer
science, as exemplified in the areas of systems, theory and software
development.
• Students will demonstrate ability to conduct a research or applied
Computer Science project, requiring writing and presentation skills
which exemplify scholarly style in computer science.
3)PROPOSED SYSTEM
Today one cannot afford to rely on the fallible human beings of be really
wants to stand against today’s merciless competition where not to wise
saying “to err is human” no longer valid, it’s outdated to rationalize
your mistake. So, to keep pace with time, to bring about the best result
without malfunctioning and greater efficiency so to replace the unending
heaps of flies with a much sophisticated hard disk of the computer.
One has to use the data management software. Software has been an
ascent in atomization various organizations. Many software products
working are now in markets, which have helped in making the
organizations work easier and efficiently. Data management initially had
to maintain a lot of ledgers and a lot of paper work has to be done but
now software product on this organization has made their work faster and
easier. Now only this software has to be loaded on the computer and
work can be done.
This prevents a lot of time and money. The work becomes fully
automated and any information regarding the organization can be
obtained by clicking the button. Moreover, now it’s an age of computers
of and automating such an organization gives the better look.
4) PYTHON INTRODUCTION
MySQL is a fast, easy-to-use RDBMS being used for many small and
big businesses. MySQL is developed, marketed and supported by
MySQL AB, which is a Swedish company. MySQL is becoming so
popular because of many good reasons −
• MySQL is released under an open-source license. So you have
nothing to pay to use it.
• MySQL is a very powerful program in its own right. It handles a
large subset of the functionality of the most expensive and
powerful database packages.
• MySQL uses a standard form of the well-known SQL data language.
• MySQL works on many operating systems and with many
languages including PHP, PERL, C, C++, JAVA, etc.
• MySQL works very quickly and works well even with large data sets.
• MySQL is very friendly to PHP, the most appreciated language for
web development.
• MySQL supports large databases, up to 50 million rows or more in
a table. The default file size limit for a table is 4GB, but you can
increase this (if your operating system can handle it) to a
theoretical limit of 8 million terabytes (TB).
MySQL is customizable. The open-source GPL license allows
programmersto modify the MySQL software to fit their own specific
environments.
5) MYSQL INTROUCTION
1.CREATE TABLE command is used to create tables in database.
2.INSERT INTO command is used to insert data in the table.
3.Nulls are inserted in the table by typing NULL without quotes.
4.To insert data from other tables, subquery can be used inside INSERT INTO
command.
5.Existing data in tables can be changed with UPDATE command.
6.To update a table with values coming from another table, UPDATE command
can be subqueries.
7.Tuples in a table can be deleted using DELETE command.
8.ALTER TABLE command is used to alter the definition of already created tables.
9.With ALTER TABLE, new columns can be added, existing columns can be
redefined.
10. DROP TABLE command drops a table from a database.
6) INTERFACE PYTHON WITH MySQL
To connect to a database from within a programming application, you
need a framework that facilitates communication between two different
generes of software (programming application and DBMS).
To connect from python to MySQL,you need a library called
mysql connector.
You must import mysql.connector in the python program/script before
writing code for connectivity.
Steps to create a database connectivity Python application are:
1.Start Python
2.Import the packages required for database programming.
3.Open a connection
4.Create a cursor instance.
5.Execute a query.
6.Extract data from result set.
7.Clean up the environment.
A database connection object controls the connection to a database.
It represents a unique session with a database connected from
within a program.
A database cursor is a special control structure that facilitates the
row by row processing records in the result set, i.e., the set of
records retrieved as per query.
The result set refers to a logical set of records that are fetched from
the database by executing an SQL query and made available to the
application program.
You can use connect( ) method for establishing database
connection, cursor() to create a cursor and execute( ) to execute an
SQL query.
To fetch records from a result set, you can use fetch one( ),
fetch many( ) and fetch all( ) methods.
For INSERT, UPDATE and DELETE queries, you must run
commit( ) with the connection object.
COMMON CURSOR METHODS :
• execute(operation[, prams]) - Execute an SQL statement.
• fetch one( ) - fetches the next row as a sequence; returns None no more
data
• fetch all( ) – fetches all remaining rows, current pointer
position onwards
• fetch many([size = cursor.arraysize]) – fetches the next set of
rows as a sequence of sequences(default is set using
cursor.arraysize);returns an empty sequence when no more rows to
fetch.
DATABASE DESIGN
7)HARDWARE AND SOFTWARE REQUIREMENT
Hardware requirements
• computer, for coding and typing the required documents of the project.
• printer, to print the required documents of the project.
• compact drive
th
• processor:i5 7 Generation
• ram: 6Gb
• hard disk: 1 TB
Software requirements
• Operating System: windows 10
• Python 3: for execution of program
• Mysql: for storing data in the database
• Python – Mysql connector for database connectivity
• Microsoft word, for presentation of output.
8) INSTALLATION PROCESS
1.Install “python-3.9.0” in your device (if you do not
have Python).
2.Install “My SQL” in your device (if you do not
have My SQL).
3.Run the file “CIMS.py” in your PC to create
a database
4.Run the file “CIMS.py” in your PC to create a table.
5.Run the file “CIMS.py” in your PC to work on
our management system.
9)SOURCE CODE
Create a Python project of a Computer Institute Management System to
register yourself into Computer Institute.
Note:
• Allow the user to input their number, name, desired course, DOB, Phone
number and address.
• Allow the administrator to delete an enrollment, edit the name , course, address
, DOB and phone number of a candidate.
• Allows the user to see the details.
import mysql.connector as sql
db=input("enter name of your
database:")
conn=sql.connect(host='localhost',user='root',passwd='12345',c
h a rset="utf8")
mycursor=conn.cursor()
sql="create database if not exists %s"%
(db,) mycursor.execute(sql) print("database
create successfully..")
mycursor=conn.cursor()
mycursor.execute("use "+db) tablename=input("name of table to
be created :") query='create table if not exists
cand_details(admno int primary key,candidate_name varchar(30)
not null,gender varchar(1),DOB date,course_select
varchar(40),charges int,address varchar(60),phoneno
varchar(11));' print("table "+tablename+"created successfully
... ") mycursor.execute(query)
#To check database connection established.
if conn.is_connected():
print("Successfully
Connected") else:
print('not connected')
c1=conn.cursor()
print(" Computer Institute
Management System") print(" ")
print("1. Enrolling For A Course")
print("2. Edit Enrollments (as admin)")
print("3. Display Details") print("4.
Exit") choice=int(input("Enter the
Choice - ")) #To enroll details for
course
if choice==1:
v_admno=int(input("Enter the Admission Number: "))
v_candidatename=input("Enter your name : ")
v_gender=input('enter gender(M/F):') v_DOB=input("enter
DOB:") v_address=input('enter your address:')
v_phoneno=input('enter phone no.:') print('enter the
following computer course:') print('1.JAVA')
print('2.Python') print('3.C') print('4.BASIC')
print('5.HTML') print('6.Javascript')
v_course=input("Enter the Course out of the following:
") if v_course=='JAVA': v_course='JAVA' fees=7000; elif
v_course=='Python':
v_course='Python
' fees=10000 elif
v_course=='C':
v_course='C'
fees=8000
elif v_course=='BASIC':
v_course='BASIC'
fees=10000 elif
v_course=='HTML':
v_course='HTML'
fees=4000 elif
v_course=='Javascript':
v_course='Javascript'
fees=9000
V_SQL_Insert = "insert into cand_details values
({},'{}','{}','{}','{}',{},'{}','{}')".format(v_admno,v_candida
t ename,v_gender,v_DOB,v_course,fees,v_address,v_phoneno)
c1.execute(V_SQL_Insert) print(" ")
print(" You are
Enrolled Mr.",v_candidatename,". Congrats!!!")
conn.commit() print(" ")
print (" Your enrollment
for", v_course ,"course is
successful!")
print(" Your
fees
for",v_course,"is",fees)
#To edit enrollment(as admin):
if choice==2:
uname=input("Enter Username:")
passwd=input("Enter Password:")
u_name='root' pass_wd='12345' if
(uname==u_name) and (passwd==pass_wd):
print("
Password Accepted") print("1. Delete An Enrollment")
print("2. Edit Name") print("3. Edit Course") print('4. Edit
address') print("5. Edit phone number") print("6. Edit Date
Of Birth")
print(" ") option=int(input("Which of the above options would
you like to choose ?:"))
#TO Delete an enrollment of candidate:
if option==1:
change_adm_no=int(input("Enter the admission number
of the candidate to be removed:"))
V_SQL_Insert = "delete from cand_details where admno
={}".format(change_adm_no)
c1.execute(V_SQL_Insert
) print("") print("
Successfully removed")
conn.commit()
# To change the name of candidate :
if option==2:
change_adm_no=int(input("Enter the admission
number of the candidate whose name is to be changed:"))
change_name=input("Enter the desired name:")
V_SQL_Insert = "update cand_details set
candidate_name = '{}' where admno
={}".format(change_name,change_adm_no)
c1.execute(V_SQL_Insert) print("")
print("
Successfully edited")
conn.commit()
#To change course of the candidate:
if option==3:
change_adm_no=int(input("Enter the admission
number
of the candidate whose course is to be changed:"))
change_course=input("Enter the Course: ")
if change_course=='JAVA':
change_course='JAVA' elif
change_course=='Python':
change_course='Python' elif
change_course=='C':
change_course='C' elif
change_course=='BASIC':
change_course='BASIC'
elif change_course=='HTML':
change_course='HTML'
V_SQL_Insert = "update cand_details set
course_select = '{}' where admno
={}".format(change_course,change_adm_no)
c1.execute(V_SQL_Insert
) print("") print("
Successfully modified")
conn.commit()
#To change the address of the candidate:
if option==4:
print('change address') a=int(input('enter
no.1 to change address:')) if a==1:
change_adm_no=int(input("Enter the admission
number of the candidate whose address is to be changed :"))
change_address=input("enter new address:")
V_SQL_Insert = "update cand_details set address
= '{}' where admno ={}".format(change_address,change_adm_no)
c1.execute(V_SQL_Insert
) print(' ') print("
Successfully edited")
#To change phone number of the candidate:
if option==5:
change_adm_no=int(input("Enter the admission number
of the candidate whose phone number is to be changed :"))
change_phoneno=input("enter new phone number:")
V_SQL_Insert = "update cand_details set phoneno
='{}' where admno ={}".format(change_phoneno,change_adm_no)
c1.execute(V_SQL_Insert
) print(' ') print("
Successfully edited")
# To change Date O f Birth of the candidate:
if option==6:
change_adm_no=int(input("Enter the admission number
of the candidate whose DOB is to be changed :"))
change_DOB=input("enter new Date Of Bith:")
V_SQL_Insert = "update cand_details set DOB ='{}'
where admno ={}".format(change_DOB,change_adm_no)
c1.execute(V_SQL_Insert
) print(' ') print("
Successfully edited")
else:
print(" Wrong
Username or Password")
# display the table candidate_details:
if choice==3:
c1.execute("Select * from cand_details
") data=c1.fetchall() for row in data:
print("
Candidates Details ")
print("
Admission Number : ",
row[0])
print("
Candidate Name : ", row[1])
print(
" Gender : ",
row[2])
print("
Date Of Birth : ", row[3])
print("
Course Selected : ", row[4])
print("
Fees : ", row[5]) print("
Address : ", row[6])
print("
Phone Number : ",
row[7]) print(" ")
print(" ") #
Exit from program
if choice==4:
print('
Thank
You')
10)OUTPUT SCREEN
(After enrolling 4 candidates)
BIBLIOGRAPHY
● Computer science with Python - Class XI &
XII By PREETI ARORA
● Website: https://www.w3resource.com
● https://en.wikipedia.org/