Professional Documents
Culture Documents
In
COMPUTER SCIENCE (083)
By:
1. AANCHAL –XII A – ROLL NO: 4
2. ARSI – XII A – ROLL NO: 5
3. RITIKA – XIIA – ROLL NO: 18
4. SHAMBHVI – XII A – ROLL NO: 21
We declare that the work presented in this project titled “THE MALL OF
Kendriya Vidyalaya Holta Camp Palampur for the award of the CBSE - AISSE
class XII certificate. We have not plagiarized or submitted the same work for the
January, 2020
Place : Kendriya Vidyalaya Palampur
1.AANCHAL
2.ARSI
3.RITIKA
4.SHAMBHVI
2
CERTIFICATE
Mentor:
(LALIT KUMAR)
PRINCIPAL
KENDRIYA VIDYALAYA PALAMPUR
Project Guide:
Sanjeev Sharma
PGT-Computer Science
Kendriya Vidyalaya Palampur
3
Acknowledgements
We would like to thank Sh. Lalit Kumar, Principal Kendriya Vidyalaya
Palampur.
Finally, we would like to wind up by paying our heartfelt thanks to all our near
and dear ones.
1.AANCHAL
2.ARSI
3.RITIKA
4.SHAMBHVI
4
Contents
1. Introduction of the Project.
3. Python Coding.
5. References.
5
Introduction of the Project
AANCHAL and SHAMBHVI has been assigned the work of coding and
programming RITIKA and ARSI have been assigned the work of
analyzing the overall mistakes and have done the conclusion work.
We are so glad that this work have been assigned to us,yet we haven’t
done this work before .SH. SANJEEV SHARMA 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 SH.LALIT KUMAR GUPTA for
providing us various facilities to complete this project.
As we are the students of CLASS XIIA 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
6
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 groupmates for cooperating with each
other while performing this task we have also polished the skills of
group activity.
PROCESS
THEN, we started our coding, coding took around 2 and half months
for completion.
7
System Requirements of the Project
8
Python Coding
#***************KENDRIYA VIDYALAYA PALAMPUR ******************
#***************WELCOME TO THE MALL OF EMIRATES***************
################## THE MALL OF EMIRATESI
#####################
import mysql.connector
myConnnection =""
cursor=""
userName=""
password =""
pcode=""
global myConnection
global userName
global password
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()
9
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()
10
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)"
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:
11
print("Sorry ,May Be You Are Giving Me Wrong Input,
Please Try Again !!! ")
else:
print("\nSomthing Went Wrong ,Please Try Again !")
12
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 !")
13
""")
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")
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:
14
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:
print("\nERROR ESTABLISHING MYSQL CONNECTION !")
15
if data:
print(data)
return True
else:
return False
cursor.close()
else:
print("\nSomthing Went Wrong ,Please Try Again !")
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 :")
16
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
cursor.close()
else:
print("\nSomthing Went Wrong ,Please Try Again !")
17
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)
return True
else:
return False
cursor.close()
else:
print("\nSomthing Went Wrong ,Please Try Again !")
18
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 !")
19
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
""")
20
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 !")
21
Output of the Project
Finally, we conclude our work and present the output of the Project.
22
USER AUTHENTICATION SCREEN
23
NEW ITEM IN WOMEN’S SECTION
24
NEW ITEM IN MEN’S SECTION
25
NEW ITEM IN KIDS SECTION
26
WOMEN’S SECTION
27
MEN’S SECTION
28
KIDS SECTION
29
MODIFY ITEM
30
SEARCH ANY ITEM
31
SHOW ALL ITEMS AND TO DELETE ITEM
32
MAKING LIST OF ALL THE BILLS AND TO
GENERATE CUSTOMER BILL
33
EXIT SCREEN
34
MYSQL DATABASE AND TABLES USED IN THIS PROJECTS
35
TABLE STRUCTURE
36
BACKEND DATA GENERATED THROUGH
SOFTWARE
37
References
1. python.org
2. Code Academy
3. tutorialsPoint.com
4. PythonChallenge.com
6. LearnPython.org
7. layak.in
38