Igl
Igl
SCHOOL
BAHADURGARH
PRACTICAL FILE
ON
COMPUTER SCIENCE
(CODE-083)
SESSION: 2024-2025
SUBMITTED BY SUBMITTED TO
NAME : Pawan TEACHER’S NAME
ROLL NO.
Ms. Renu Ma’am
CLASS : XII-SCIENCE
………………………………………………………
Signature of teacher
Name: Mrs. ……
Designation: PGT (COMPUTER SCIENCE)
Place: …………………
Date:
2
ACKNOWLEDGEMENT
……………………………………..
Signature of Student
Name: Pawan
Class: 12th SCIENCE
Place : …………..
Date:
3
CONTENTS
1
Table Structure
5
Table Having Records
6
Source Code
import mysql.connector as sql
def insert():
mydb=sql.connect(host="localhost",user="root",passwd="1234",database="mproject")
mycur=mydb.cursor()
ch='y';
ca_no=int(input("Enter CA no"))
query=(str.format(cno,name,mobile,address,amount,refrence_no,ca_no))
mycur.execute(query)
mydb.commit()
ch=input("Want to add more records?\n type 'Y' for yes or 'N' for no:")
def edit():
mydb=sql.connect(host="localhost",user="root",passwd="1234",database="mproject")
mycur=mydb.cursor()
print("==================================================\n")
7
print("Before updation\n")
myrec=mycur.fetchall()
for i in myrec:
cno=i[0]
name=i[1]
mobile=i[2]
address=i[3]
amount=i[4]
refrence_no=i[5]
ca_no=i[6]
ca_no=int(input("Enter CA no"))
query=str.format(name,mobile,address,amount,refrence_no,ca_no,cno)
mycur.execute(query)
mydb.commit()
print("========================================\n")
myrec=mycur.fetchall()
for i in myrec:
8
cno=i[0]
name=i[1]
mobile=i[2]
address=i[3]
amount=i[4]
refrence_no=i[5]
ca_no=i[6]
def delete():
mydb=sql.connect(host="localhost",user="root",passwd="1234",database="mproject")
mycur=mydb.cursor()
print("======================================\n")
print("Before deletion\n")
myrec=mycur.fetchall()
for i in myrec:
cno=i[0]
name=i[1]
mobile=i[2]
address=i[3]
amount=i[4]
refrence_no=i[5]
ca_no=i[6]
9
cno=int(input("Enter the customer number that you want to delete: "))
query=str.format(cno)
mycur.execute(query)
mydb.commit()
print("==========================================\n")
myrec=mycur.fetchall()
for i in myrec:
cno=i[0]
name=i[1]
mobile=i[2]
address=i[3]
amount=i[4]
refrence_no=i[5]
ca_no=i[6]
def display():
mydb=sql.connect(host="localhost",user="root",passwd="1234",database="mproject")
mycur=mydb.cursor()
print("==========================================\n")
myrec=mycur.fetchall()
for i in myrec:
10
cno=i[0]
name=i[1]
mobile=i[2]
address=i[3]
amount=i[4]
refrence_no=i[5]
ca_no=i[6]
def search():
mydb=sql.connect(host="localhost",user="root",passwd="1234",database="mproject")
mycur=mydb.cursor()
query=str.format(cno)
mycur.execute(query)
print("===========================================\n")
myrec=mycur.fetchall()
for i in myrec:
cno=i[0]
name=i[1]
mobile=i[2]
address=i[3]
amount=i[4]
refrence_no=i[5]
ca_no=i[6]
11
def generate():
mydb=sql.connect(host="localhost",user="root",passwd="1234",database="mproject")
mycur=mydb.cursor()
query=str.format(cno)
mycur.execute(query)
myrec=mycur.fetchall()
for i in myrec:
cno=i[0]
name=i[1]
mobile=i[2]
address=i[3]
amount=i[4]
refrence_no=i[5]
ca_no=i[6]
print(" DELHI-110009\n")
print(" Date:30/08/2020\n")
print("======================================================\n")
print("CUSTOMER INFO:")
12
print("Address: ",address," tMobile: ",mobile,"\n")
print("=======================================================\n")
print("CHARGES: ")
print("GST: (18%)")
ch='y'
print("MAIN MENU")
print("Press 7 to quit")
if ch==1:
insert()
elif ch==2:
edit()
elif ch==3:
delete()
elif ch==4:
display()
elif ch==5:
search()
13
elif ch==6:
generate()
elif ch==7:
break
print("====================================\n")
14
Output
Insert
15
Edit
16
17
Delete
18
Display
19
Search
20
Generate
21
22
To Quit
23
LIMITATION OF THE PROJECT
• It does not have a proper GUI ( graphical user interface is a form of user
interface that allows users to interact with electronic devices through
graphical icons and audio indicator such as primary notation, instead of
text-based user interfaces, typed command labels or text navigation.)
24
CONCLUSIONS
“IGL Bill generation” has been made to reduce the annual work and
with the help of the project every work is being processed in
accurate manner. Bill generation of a customer is being calculated itself by
the computer.
25