0% found this document useful (0 votes)
20 views24 pages

Institute Database Module Python Connectivity

Uploaded by

kainatmalhotra
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)
20 views24 pages

Institute Database Module Python Connectivity

Uploaded by

kainatmalhotra
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/ 24

INSTITUTE MANAGEMENT SYSTEM

A PROJECT ON

INSTITUTE
DATABASE
MANAGEMENT
SYSTEM
2023-2024
SACHDEVA PUBLIC SCHOOL

SUBMITTED BY :
KAINAT MALHOTRA
ROLL NO. :
UNDER THE GUIDANCE OF Ms. Meena Gunasekaran

1
INSTITUTE MANAGEMENT SYSTEM

CERTIFICATE
This is to certify that the Project entitled INSTITUTE DATABASE
MANAGEMENT SYSTEM is a bonafide work done by KAINAT
MALHOTRA of class XII-B Session 2023-24 in partial fulfillment of
CBSE Examination 2024 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 part of any other course undergone by the
candidate.

Signature of Principal Signature of Teacher

2
INSTITUTE MANAGEMENT SYSTEM

ACKNOWLEDGEMENT
I undertook this Project work, as the part of my XII-Computer Science
course(083). I had tried to apply my best of knowledge and experience ,
gained during the study and class work. However, developing software
system is generally a quite complex and time-consuming process. It
requires a systematic study, insight vision and professional approach
during the design and development. Moreover, the developer always
feels the need, the help and good wishes of the people near you, who
have considerable experience and idea. I would like to extend my sincere
thanks and gratitude to my teacher Mrs. Meena Gunasekaran , for giving
valuable time and moral support to develop this software. I also feel
indebted to my friends for the valuable suggestions during the project
work.

3
INSTITUTE MANAGEMENT SYSTEM

CONTENTS
Objective of this project

Modules

About PYTHON

Hardware and software requirements

MySql Queries

Project Coding

Output

Bibliography

4
INSTITUTE MANAGEMENT SYSTEM

OBJECTIVE OF THIS PROJECT


The objective of the software project is to develop a computerized MIS and to
automate the functions of a INSTITUTE MANAGEMENT SYSTEM.

This software project is also aimed to enhance the current record keeping system,
which will help managers to retrieve the up-to- date information at right time in
right shape. The proposed software system is expected to do the following
functionality-

✔ To provide a user friendly, Graphical User Interface (GUI) based integrated and
centralized environment.

✔ The proposed system should maintain all the records and transactions, and
should generate the required reports and information when required.

✔ To provide graphical and user-friendly interface to interact with a centralized


database based on client-server architecture.

5
INSTITUTE MANAGEMENT SYSTEM

ABOUT PYTHON
Python is a widely used general-purpose, high-level programming language.
It was initially designed by Guido van Rossum in 1991 and developed by
Python Software Foundation. It was mainly developed for emphasis on code
readability, and its syntax allows programmers to express concepts in fewer
lines of code.

1. What is Python ?
Python is an open source , object oriented high level programming language
developed by Guido Van Rossum in 1991 at the National Research Institute for
Mathematics,Netherlands.
Features of Python:
∙ It is an interactive ,interpreted language.
∙ It is a loosely typed object –oriented language.
∙ It is a free open –source and portable language,
∙ It takes less time to develop programs.
∙ It is extensible / extendable and highly efficient .
∙ It supports GUI.
∙ It can be easily compatible with other languages like C , C++ etc.
∙ It is used for both scientific and non-scientific programming

6
INSTITUTE MANAGEMENT SYSTEM

SYSTEM IMPLEMENTATION

1. THE HARDWARES USED:


While developing the system, the used hardware are: PC with Intel Core HD Graphics
520 processor having 4.00 GB RAM, 64-bit Operating System , SVGA and other
required devices.

2. THE SOFTWARES USED:


Microsoft Windows® 10 Pro as Operating System.
Python 3.11.3 as Front-end Development environment.
MySQL as Back-end Sever with Database for Testing.
Mysql.connector to connect Python module with database.

7
INSTITUTE MANAGEMENT SYSTEM

MODULES

✓ Import mysql.connector

INTERACTING WITH PYTHON


Python can be used in two ways:

1.Using Command line window 2. Using IDLE window

PIP COMMANDS

pip install mysql.connector

8
INSTITUTE MANAGEMENT SYSTEM

SQL QUERIES
+-----+------+-------+------------+---------------+-------+-------+-------+--------+
| ID | Name | class | Subjects | Addr | batch | fees |
+-----+------+-------+------------+---------------+-------+-------+-------+--------+
| 111 | A | 12 | PCM | PITAMPURA |Q | 12299 |
| 112 | J | 10 | SCIENCE | KOHAT |C | 3999 |
| 113 | K | 12 | PSYCHOLOGY | PITAMPURA |S | 12299 |
| 114 | L | 12 | PSYCHOLOGY | KOHAT |S | 4999 |
| 115 | M | 11 | ACCOUNTS | SHALIMAR |X | 5999 |
| 116 | N | 11 | ACCOUNTS | PITAMPURA |X | 5999 |
| 121 | B | 12 | ACCOUNTS | PITAMPURA |Q | 4999 |
| 131 | C | 11 | CHEM | ASHOK VIHAR |T | 5999 |
| 141 | D | 11 | MATHS | ASHOK VIHAR |M | 5999 |
| 151 | E | 11 | MATHS | PITAMPURA |M | 5999 |
| 161 | F | 12 | PCM | SHALIMAR BAGH | Q | 12299 |
| 171 | G | 12 | CHEM | PITAMPURA |Y | 5999 |
| 181 | H | 11 | PHYSICS | KOHAT |U | 6999 |
| 191 | I | 11 | PHYSICS | PITAMPURA |U | 6999 |
+-----+------+-------+------------+---------------+-------+-------+------+------+-------+
14 rows in set (0.00 sec)

9
INSTITUTE MANAGEMENT SYSTEM

CODING
PYTHON CODE:
import mysql.connector as my_sql
# Function to create database and table
def Create():
mydb= my_sql.connect(host="localhost",user="root",password="admin")
cur = mydb.cursor()
cur.execute("create database project")
cur.execute("use project")

cur.execute("create table institute(ID int primary key, Name Varchar(20),class varchar(2), Subjects
varchar(20), Addr varchar(20), batch varchar(1),fees int(6))")
mydb.close()

# Function to add row information


def Insert():
mydb =my_sql.connect(host="localhost",user="root",password="admin",database="project")
cur = mydb.cursor()
n= int(input("Enter total number of students"))
for i in range(n):
ID=int(input("Enter ID "))
name = input("Enter Name:")
Class=int(input("enter class"))
sub = input("Enter Subjects: ")
addr=input("enter address")
batch = input("Enter BATCH:")
Fees=int(input("enter fees"))
ins = "insert into institute values(%s,'%s',%s,'%s','%s','%s',%s)"%(ID,name,Class,sub,addr,batch,Fees)
cur.execute(ins)
mydb.commit()

10
INSTITUTE MANAGEMENT SYSTEM

mydb.close()

# Functions to display data values


def Display():
mydb =my_sql.connect(host="localhost",user="root",password="admin",database="project")
cur = mydb.cursor()
cur.execute("select * from institute")
print("____________________")
print("\nID\tName\tclass\tSubjects\taddr\tbatch\tFees\n")
print("____________________")
for row in cur:
print(row[0],"\t",row[1],"\t",row[2],"\t",row[3],"\t",row[4],"\t",row[5],"\t",row[6])
mydb.close()
def displaysub():
mydb =my_sql.connect(host="localhost",user="root",password="admin",database="project")
cur = mydb.cursor()
sub=input("enter any subject")
cur.execute("select * from institute where sub='%s'"%(sub))
print("____________________")

print("\nID\tName\tclass\tSubjects\taddr\tbatch\tFees\n")
print("____________________")
for row in cur:
print(row[0],"\t",row[1],"\t",row[2],"\t",row[3],"\t",row[4],"\t",row[5],"\t",row[6])
mydb.close()
def displayname():
mydb =my_sql.connect(host="localhost",user="root",password="admin",database="project")
cur = mydb.cursor()
name=input("enter any name")
cur.execute("select * from institute where name='%s'"%(name))
print("____________________")
print("\nID\tName\tclass\tSubjects\taddr\tbatch\tFees\n")
print("____________________")
11
INSTITUTE MANAGEMENT SYSTEM

for row in cur:


print(row[0],"\t",row[1],"\t",row[2],"\t",row[3],"\t",row[4],"\t",row[5],"\t",row[6])
mydb.close()
def displaybatch():
mydb =my_sql.connect(host="localhost",user="root",password="admin",database="project")
cur = mydb.cursor()
g=input("enter any batch")
cur.execute("select * from institute where batch='%s'"%(g))
print("____________________")
print("\nID\tName\tclass\tSubjects\taddr\tbatch\tFees\n")
print("____________________")
for row in cur:
print(row[0],"\t",row[1],"\t",row[2],"\t",row[3],"\t",row[4],"\t",row[5],"\t",row[6])
mydb.close()

# Function to modify data values


def updatename():
mydb =my_sql.connect(host="localhost",user="root",password="admin",database="project")
cur = mydb.cursor()
n=input("Enter any name")
m=int(input("Enter any ID"))

ins = "update institute set name='%s' where ID=%s"%(n,m)


cur.execute(ins)
mydb.commit()
mydb.close()
def updatesubject():
mydb =my_sql.connect(host="localhost",user="root",password="admin",database="project")
cur = mydb.cursor()
s=input("Enter any subject")
m=int(input("Enter any ID"))
ins = "update institute set sub='%s' where ID=%s"%(s,m)
12
INSTITUTE MANAGEMENT SYSTEM

cur.execute(ins)
mydb.commit()
mydb.close()
def updatefees():
mydb =my_sql.connect(host="localhost",user="root",password="admin",database="project")
cur = mydb.cursor()
n=float(input("Enter any fees "))
m=int(input("Enter any ID"))
ins = "update institute set fees=%s where ID=%s"%(n,m)
cur.execute(ins)
mydb.commit()
mydb.close()
def updatebatch():
mydb =my_sql.connect(host="localhost",user="root",password="admin",database="project")
cur = mydb.cursor()
b=input("Enter any batch")
m=int(input("Enter any ID"))
ins = "update institute set batch='%s' where ID=%s"%(b,m)
cur.execute(ins)
mydb.commit()
mydb.close()

# Functions to remove row information


def deletename():
mydb =my_sql.connect(host="localhost",user="root",password="admin",database="project")
cur = mydb.cursor()
n=input("Enter any name")
ins ="delete from institute where name='%s'"%(n)
cur.execute(ins)
mydb.commit()
mydb.close()

13
INSTITUTE MANAGEMENT SYSTEM

#Main Program
ch="y"
while ch=="y" or ch=="Y":
print("1: Create\n\n2:Insert\n\n3: Display\n\n4:Update\n\n5.Delete\n\n6.Exit")
c=int(input("Enter your Choice"))
if c==1:
Create()
elif c==2:
Insert()
elif c==3:
print("1: full table info\n\n2:Display based upon subject\n\n3. Display based upon name\n\n4. Display
based upon batch")
ch=int(input("Enter your Choice"))
if ch==1:
Display()
elif ch==2:
displaysub()
elif ch==3:
displayname()
elif ch==4:
displaybatch()
else:
print("Wrong Input")
elif c==4:
print("1:update name\n\n 2:update subject\n\n 3.update fees\n\n 4.update batch ")
ch=int(input("Enter your Choice"))
if ch==1:
updatename()
elif ch==2:
updatesubject()
elif ch==3:
updatefees()
elif ch==4:
14
INSTITUTE MANAGEMENT SYSTEM

updatebatch()
elif c==5:
deletename()
else:
break
ch=input("Do you want to continue or not [Y/N]")

15
INSTITUTE MANAGEMENT SYSTEM

OUTPUTS

16
INSTITUTE MANAGEMENT SYSTEM

17
INSTITUTE MANAGEMENT SYSTEM

18
INSTITUTE MANAGEMENT SYSTEM

19
INSTITUTE MANAGEMENT SYSTEM

20
INSTITUTE MANAGEMENT SYSTEM

21
INSTITUTE MANAGEMENT SYSTEM

22
INSTITUTE MANAGEMENT SYSTEM

SQL SHEET

23
INSTITUTE MANAGEMENT SYSTEM

BIBLIOGRAPHY
COMPUTER SCIENCE WITH PYTHON –class 11->by Sumita Arora
COMPUTER SCIENCE WITH PYTHON–class 12->by Sumita Arora
http://www.mysql.org/
http://www.python.org/

24

You might also like