Professional Documents
Culture Documents
SUBMITTED BY:
HIRUTHIK . S
Reg.no:
Class: XII - ZINNIA
DEPARTMENT OF PHYSICS
SRRI SPK PUBLIC SENIOR SECONDARY SCHOOL
(AFFILIATED TO CBSE, DELHI)
KADACHANALLUR – 638008
2022-2023
1
CERTIFICATE
This is to certify that HIRUTHIK.S(Registration no: )
Student of class XII – Zinnia has successfully completed the research on the
below mentioned project under the guidance of Mr. KALAYARASAN .T,
(Subject teacher) during the year 2022-2023 in complete fullfilment of
Physics practical examination conducted by AISSCE, New Delhi
SIGNATURE OF SIGNATURE OF
EXTERNAL EXAMINER INTERNAL EXAMINER
DATE: PRINCIPAL
2
ACKNOWLEDGEMENT
Primarily I would thank God for being able to complete this project
with success. Then I would like to thank my Principal and English
teacher whose valuable guidance has been the one that helped me
patching this project and make it full proof success his suggestions
and his instructions has served as the major contributor towards
completion of the project.
Then I would like to thank my Parents and friends who have helped
me with their valuable suggestions and guidance has been helpful in
various phases of the completion of the project.
3
Contents
TABLE OF CONTENTS [ T O C ]
0 INTRODUCTION 05
03 SOURCE CODE 09
04 OUTPUT 34
05 BIBLIOGRAPHY 50
4
Introduction of the Project
5
We are so glad that this work have been assigned to us,yet we haven’t done
this work before Mr.Kalayarasan our subject teacher have also helped us
a lot to complete this project. We feel so blessed that we have learnt all
this work with the help of our sir,we are also thankful to our respected
principal for providing us various facilities to complete this project.
As we are the students of CLASS XII and we haven’t done this type of
project before, we have performed all that which we have learnt from our
CBSE PROGRAMMING .Hence, we know that this programming would
be further done on a big platform. Since we have started this
programming from SEPTEMBER month ,we believe that this
programming would further help us a lot in our future .
We are also thankful to our group mates for cooperating with each other
while performing this task we have also polished the skills of group activity.
6
PROCESS
THEN, we started our coding, coding took around 2 and half months
for completion.
7
System Requirements of the Project
import mysql.connector
myConnnection =""
cursor=""
userName=""
password =""
pcode=""
global myConnection
global userName
global password
9
myConnection=mysql.connector.connect(host="localhost",user=userN
ame,passwd=password , auth_plugin='mysql_native_password' )
if myConnection:
print("\n CONGRATULATIONS ! YOUR MYSQL CONNECTION
HAS BEEN ESTABLISHED !")
cursor=myConnection.cursor()
10
cursor.execute("CREATE DATABASE IF NOT EXISTS
EMIRATESI")
cursor.execute("COMMIT")
cursor.close()
return myConnection
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION CHECK
USERNAME AND PASSWORD !")
global userName
global password
global myConnection
global cid
global pcode
myConnection=mysql.connector.connect(host="localhost",user=userN
ame,passwd=password , database="EMIRATESI" ,
auth_plugin='mysql_native_password' )
if myConnection:
return myConnection
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION !")
myConnection.close()
11
#MODULE FOR MEN'S SECTION
def menSection():
global pcode
if myConnection:
cursor=myConnection.cursor()
print("ITEMS UNDER THE MENS SECTION ARE : ")
sql="SELECT * FROM PRODUCT WHERE
PRODUCT_CATEGORY=%s"
cursor.execute(sql,("Men",))
data=cursor.fetchall()
if data:
print(data)
12
while True:
print("""
ENTER 1 TO BUY
ENTER 0 TO RETURN TO MAIN MENU
""")
choice = int(input("Please Enter Your Choice : "))
if choice == 1 :
item = searchItem()
if item:
cursor=myConnection.cursor()
createTable ="""
CREATE TABLE IF NOT EXISTS
BILL(BILL_CODE VARCHAR(10) PRIMARY KEY ,PRODUCT_CODE
VARCHAR(10),CID VARCHAR(10),
CNAME VARCHAR(30), PRICE INT
,QUANTITY INT , DISCOUNT INT ,TOTAL INT );
"""
cursor.execute(createTable)
bnumber=input("\n Enter BILL Number : ")
cid=input("\n Enter Customer Identification No. : ")
cname=input("\n Enter Customer Name : ")
price=int(input("\n Enter Price : "))
quantity=int(input("\n Enter Quantity : "))
discount=int(input("\n Enter Discount Amount, If
any) : "))
total = (price * quantity) - discount
sql= "INSERT INTO BILL
VALUES(%s,%s,%s,%s,%s,%s,%s,%s)"
13
values=
(bnumber,cid,pcode,cname,price,quantity,discount,total)
cursor.execute(sql,values)
cursor.execute("COMMIT")
print("\n ITEM ADDEDD SUCCESSSFULLY IN
YOUR CART !")
cursor.close()
elif choice == 0:
break;
else:
14
print("Sorry ,May Be You Are Giving Me Wrong Input,
Please Try Again !!! ")
else:
print("\nSomthing Went Wrong ,Please Try Again !")
16
discount=int(input("\n Enter Discount Amount, If
any) : "))
total = (price * quantity) - discount
sql= "INSERT INTO BILL
VALUES(%s,%s,%s,%s,%s,%s,%s,%s)"
values=
(bnumber,cid,pcode,cname,price,quantity,discount,total)
cursor.execute(sql,values)
cursor.execute("COMMIT")
print("\n ITEM ADDEDD SUCCESSSFULLY IN
YOUR CART !")
cursor.close()
elif choice == 0:
break;
else:
print("Sorry ,May Be You Are Giving Me Wrong Input,
Please Try Again !!! ")
else:
print("\nSomthing Went Wrong ,Please Try Again !")
17
cursor=myConnection.cursor()
print("ITEMS UNDER THE KIDS SECTION ARE : ")
sql="SELECT * FROM PRODUCT WHERE
PRODUCT_CATEGORY=%s"
cursor.execute(sql,("Kids",))
data=cursor.fetchall()
if data:
print(data)
while True:
print("""
ENTER 1 TO BUY
ENTER 0 TO RETURN TO MAIN MENU
18
""")
choice = int(input("Please Enter Your Choice : "))
if choice == 1 :
item = searchItem()
if item:
cursor=myConnection.cursor()
createTable ="""
CREATE TABLE IF NOT EXISTS
BILL(BILL_CODE VARCHAR(10) PRIMARY KEY ,PRODUCT_CODE
VARCHAR(10),CID VARCHAR(10),
CNAME VARCHAR(30), PRICE INT
,QUANTITY INT , DISCOUNT INT ,TOTAL INT );
"""
cursor.execute(createTable)
bnumber=input("\n Enter BILL Number : ")
cid=input("\n Enter Customer Identification No. : ")
cname=input("\n Enter Customer Name : ")
price=int(input("\n Enter Price : "))
quantity=int(input("\n Enter Quantity : "))
discount=int(input("\n Enter Discount Amount, If
any) : "))
total = (price * quantity) - discount
sql= "INSERT INTO BILL
VALUES(%s,%s,%s,%s,%s,%s,%s,%s)"
values=
(bnumber,cid,pcode,cname,price,quantity,discount,total)
cursor.execute(sql,values)
cursor.execute("COMMIT")
19
print("\n ITEM ADDEDD SUCCESSSFULLY IN
YOUR CART !")
cursor.close()
elif choice == 0:
break;
else:
print("Sorry ,May Be You Are Giving Me Wrong Input,
Please Try Again !!! ")
else:
20
print("\nSomthing Went Wrong ,Please Try Again !")
cursor.execute(createTable)
pcode=input("\nEnter Product Code : ")
pcategory=input("\nEnter Product Category [
MEN/WOMEN/KIDS ] : ")
pbrand=input("\nEnter Brand Name : ")
pname=input("\nEnter Product Name : ")
else:
21
print("\nERROR ESTABLISHING MYSQL CONNECTION !")
22
if data:
print(data)
return True
else:
return False
cursor.close()
else:
print("\nSomthing Went Wrong ,Please Try Again !")
23
print("PRODUCT NAME UPDATED SUCCESSFULLY ")
elif choice == 2:
category=input("ENTER NEW CATEGORY :")
sql="UPDATE PRODUCT SET PRODUCT_CATEGORY= %s
WHERE PRODUCT_CODE= %s"
cursor.execute(sql,(category,pcode))
cursor.execute("COMMIT")
print("PRODUCT CATEGORY UPDATED SUCCESSFULLY ")
elif choice==3:
brand=input("ENTER NEW BRAND NAME :")
24
sql="UPDATE PRODUCT SET PRODUCT_BRAND= %s
WHERE PRODUCT_CODE = %s"
cursor.execute(sql,(brand,pcode))
cursor.execute("COMMIT")
print("BARND UPDATED SUCCESSFULLY ")
else:
print("Sorry ,May Be You Are Giving Me Wrong Input,
Please Try Again !!! ")
else:
print("\nSomthing Went Wrong ,Please Try Again !")
else:
print("Item Record Not Found , Please Try Again !")
if myConnection:
cursor=myConnection.cursor()
sql="SELECT * FROM PRODUCT GROUP BY
PRODUCT_CATEGORY"
cursor.execute(sql)
data=cursor.fetchall()
if data:
print(data)
return True
else:
return False
25
cursor.close()
else:
print("\nSomthing Went Wrong ,Please Try Again !")
26
cursor=myConnection.cursor()
sql="SELECT * FROM PRODUCT WHERE PRODUCT_CODE=
%s"
cursor.execute(sql,(pcode,))
data=cursor.fetchall()
if data:
print("\n**** Item Removed Successfully !!! *****")
sql="DELETE FROM PRODUCT WHERE PRODUCT_CODE=%s"
cursor.execute(sql,(pcode,))
cursor.execute("COMMIT")
cursor.close()
else:
print("\nSomthing Went Wrong ,Please Try Again !")
else:
print("Record Not Found , Please Try Again !")
if myConnection:
cursor=myConnection.cursor()
sql="SELECT * FROM BILL GROUP BY CID"
cursor.execute(sql)
data=cursor.fetchall()
if data:
for bill in data:
print(bill)
27
return True
else:
return False
cursor.close()
else:
print("\nSomthing Went Wrong ,Please Try Again !")
28
cursor=myConnection.cursor()
cid=input("\nEnter Customer Identification No. : ")
sql="SELECT CNAME , SUM(TOTAL) AS 'TOTAL AMOUNT' FROM
BILL GROUP BY %s"
cursor.execute(sql,(cid,))
data=cursor.fetchall()
if data:
print("###################################")
print("NAME AMOUNT")
print(data)
return True
else:
print("\nCustomer Not Found !")
cursor.close()
else:
print("\nSomthing Went Wrong ,Please Try Again !")
30
2---->FOR WOMEN SECTION
3---->FOR MEN SECTION
4---->FOR KID SECTION
5---->FOR MODIFY ITEM
6---->FOR SEARCH ITEM
7---->FOR SHOW ALL INVENTORY ITEM WISE
8---->FOR REMOVE ITEM
9---->LIST ALL BILLS
10--->GENERATE CUSTOMER BILL
11--->EXIT
""")
32
print("Thanks for visitng THE MALL OF EMIRATESI \n
****We are eagerly waititng for your next visit !!! ***")
break;
else:
print("Sorry ,May Be You Are Giving Me Wrong Input, Please
Try Again !!! ")
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION !")
# END OF THE PROJECT
33
Output of the Project
Finally, we conclude our work and present the output of the Project.
34
USER AUTHENTICATION SCREEN
35
NEW ITEM IN WOMEN’S SECTION
36
NEW ITEM IN MEN’S SECTION
37
NEW ITEM IN KIDS SECTION
38
WOMEN’S SECTION
39
MEN’S SECTION
40
KIDS SECTION
41
MODIFY ITEM
42
SEARCH ANY ITEM
43
SHOW ALL ITEMS AND TO DELETE ITEM
44
MAKING LIST OF ALL THE BILLS AND TO
GENERATE CUSTOMER BILL
45
EXIT SCREEN
46
MYSQL DATABASE AND TABLES USED IN THIS PROJECTS
47
TABLE STRUCTURE
48
BACKEND DATA GENERATED THROUGH
SOFTWARE
49
References
1. python.org
2. Code Academy
3. tutorialsPoint.com
4. PythonChallenge.com
6. LearnPython.org
7. layak.in
50