0% found this document useful (0 votes)
63 views40 pages

Ip Project

This document contains code for a project on managing the Mall of Emirates using Python and MySQL. The code includes functions to connect to a MySQL database, display and purchase items from different sections (men's, women's, kids') of the mall, and add purchased items to a bill table in the database. Global variables are declared to share the database connection and item codes between functions. Sections show products from the relevant category and allow the user to add selected items to a cart by entering customer and purchase details into the bills table.

Uploaded by

ramji m
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views40 pages

Ip Project

This document contains code for a project on managing the Mall of Emirates using Python and MySQL. The code includes functions to connect to a MySQL database, display and purchase items from different sections (men's, women's, kids') of the mall, and add purchased items to a bill table in the database. Global variables are declared to share the database connection and item codes between functions. Sections show products from the relevant category and allow the user to add selected items to a cart by entering customer and purchase details into the bills table.

Uploaded by

ramji m
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 40

P. S.

Chidambara Nadar Senior English School

Virudhunagar

A PROJECT REPORT
ON

The Mall of Emirates

SUBMITTED TO SUBMITTED BY
Mrs. R.Saravana Priya M.C.A.,B.Ed. S.Bharani
PGT(Computer Science)
CERTIFICATE

This is to certify that S.Bharani of class XII C of P. S. Chidambara Nadar Senior English

School, Virudhunagar has done her project on THE MALL OF EMIRATES under my

supervision. She has taken interest and has shown at most sincerity in completion of this

project.

I certify this Project up to my expectation and as per guidelines issued by CBSE, NEW

DELHI.

Internal Examiner External Examiner

Principal
TABLE OF CONTENTS

PAGE
CONTENTS
S. NO NO

1. Acknowledgement 1

2. Introduction 2

3. Requirements 3

4. Coding 4

5. Output 23

6. Conclusion 35

7. Bibliography 36
ACKNOWLEDGEMENT

It is with pleasure that I acknowledge my sincere gratitude to our teacher Mrs.R.Saravana


Priya M.C.A.,B.Ed., who taught and undertook the responsibility of teaching the subject
Computer Science. I have been greatly benefitted from her classes.

I would like to express my special thanks to our mentor Mrs.G.Vengata Priya


M.C.A.,M.Phil.,B.Ed., for her time and efforts she provided throughout the year. Your useful
advice and suggestions were really helpful to me during the project's completion.

I am especially indebted to our Principal Mrs.P. Shanthi M.Sc., M.Ed., who has been a source
of encouragement and support and without whose inspiration this project would not have been
a successful one . I would like to place on record heartfelt thanks to her.

Finally, I would like to express my sincere appreciation for all the other students of my
class ,for their co-operation and the fine times that we all shared together.

INTRODUCTION

The Mall of Emirates Python MySQL project aims to create a comprehensive system
for managing various aspects of mall operations. Leveraging Python for backend
functionality and MySQL for database management, this project encompasses features
such as inventory management, customer tracking, and sales analytics.

Synopsis:
The integration of Python allows for efficient data processing and business logic
implementation, while MySQL ensures robust and organized data storage. Whether it's
monitoring product stocks, analyzing customer trends, or facilitating seamless
transactions, this project combines the power of Python and MySQL to optimize the
functioning of the Mall of Emirates.

Usage:
It helps to store the database of the shop including item name, item price, item
quantity, item category, item discount. So we can easily find out if we need any data
about the shop. It’s a very interesting project in python programming.

HARDWARE AND SOFTWARE REQUIREMENTS

HARDWARE USED

PC with Pentium IV processor or PC with Celeron(1.7 GHz) processor having 256MB,


RAM, SVGA

SOFTWARE USED
 Microsoft Windows 9 as Operating System

 Python 3.10 as Front-end Development Environment

 MySQL as Back-end Server

 MS-Word for documentation purposes

CODING
#******WELCOME TO THE MALL OF EMIRATES****** ################## THE
MALL OF EMIRATESI #####################

import mysql.connector
# GLOBAL VARIABLES DECLARATION

myConnnection ="" cursor="" userName="" password ="" pcode=""

#MODULE TO CHECK MYSQL CONNECTIVITY

def MYSQLconnectionCheck ():

global myConnection

global userName

global password

userName = input("\n ENTER MYSQL SERVER'S USERNAME : ")

password = input("\n ENTER MYSQL SERVER'S 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()

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 !")

#MODULE TO ESTABLISHED MYSQL CONNECTION

def MYSQLconnection ():

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()

#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)

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:

print("Sorry ,May Be You Are Giving Me Wrong Input, Please Try Again
!!! ")

else:

print("\nSomthing Went Wrong ,Please Try Again !")


#MODULE FOR WOMEN'S SECTION

def womenSection():

global pcode

if myConnection:

cursor=myConnection.cursor()

print("ITEMS UNDER THE WOMEN SECTION ARE : ")

sql="SELECT * FROM PRODUCT WHERE PRODUCT_CATEGORY=%s"

cursor.execute(sql,("Women",))

data=cursor.fetchall()

if data:

print(data)

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:

print("Sorry ,May Be You Are Giving Me Wrong Input,


Please Try Again !!! ")

else:

print("\nSomthing Went Wrong ,Please Try Again !")

#MODULE FOR KIDS'S SECTION

def kidsSection():

global pcode

if myConnection:

cursor=myConnection.cursor()

print("ITEMS UNDER THE KIDS SECTION ARE : ")

sql="SELECT * FROM PRODUCT WHERE PRODUCT_CATEGORY=%s"

cursor.execute(sql,("Kids",))

10

data=cursor.fetchall()

if data:

print(data)

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 : "))

11

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:

print("\nSomthing Went Wrong ,Please Try Again !")

#MODULE FOR ADDING NEW ITEM

def addItem():

global pcode

if myConnection:

cursor=myConnection.cursor()

createTable ="""

CREATE TABLE IF NOT EXISTS PRODUCT(PRODUCT_CODE VARCHAR(10)


PRIMARY KEY,PRODUCT_CATEGORY VARCHAR(20),

12

PRODUCT_BRANDVARCHAR(30) ,PRODUCT_NAME VARCHAR(30))"""

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 : ")


sql= "INSERT INTO PRODUCT VALUES(%s,%s,%s,%s)"

values= (pcode,pcategory,pbrand,pname)

cursor.execute(sql,values)

cursor.execute("COMMIT")

print("\nNEW ITEM ADDEDD SUCCESSSFULLY !")

cursor.close()

else:

print("\nERROR ESTABLISHING MYSQL CONNECTION !")

#MODULE FOR SEARCH AN ITEM

def searchItem():

global pcode

if myConnection:

cursor=myConnection.cursor()

pcode=input("PLEASE ENTER PRODUCT CODE : ")

13

sql="SELECT * FROM PRODUCT WHERE PRODUCT_CODE=

%s"

cursor.execute(sql,(pcode,))

data=cursor.fetchall()

if data:

print(data)

return True
else:

return False

cursor.close()

else:

print("\nSomthing Went Wrong ,Please Try Again !")

#MODULE FOR MODIFY AN ITEM

def modifyItem():

global pcode

item = searchItem()

if item:

if myConnection:

cursor=myConnection.cursor()

print("PRESS 1 FOR PRODUCT NAME : ")

print("PRESS 2 FOR PRODUCT CATEGORY : ")

print("PRESS 3 FOR PRODUCT BRAND : ")

14

choice=int(input("Enter Your Choice : "))

if choice==1:

name=input("ENTER NEW PRODUCT NAME : ")

sql="UPDATE PRODUCT SET PRODUCT_NAME= %s WHERE PRODUCT_CODE


= %s"

cursor.execute(sql,(name,pcode))

cursor.execute("COMMIT")

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 :")

sql="UPDATE PRODUCT SET PRODUCT_BRAND= %s WHERE


PRODUCT_CODE = %s"

15

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 !")

#MODULE FOR DISPLAY INVENTORY

def showInventory():

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

16

cursor.close()

else:

print("\nSomthing Went Wrong ,Please Try Again !")

#MODULE TO REMOVE AN ITEM

def removeItem () :

global pcode

item = searchItem()

if item :
if myConnection:

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 !")

17

else:

print("Record Not Found , Please Try Again !")

#MODULE TO LIST ALL BILLS

def allBills():

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 !")

#MODULE TO GENERATE PARTICULAR CUSTOMER'S BILL

def generateBill():

global pcode

if myConnection:

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 !")

print("#******WELCOME TO THE MALL OF EMIRATES*") print("##################


THE MALL OF EMIRATESI ##########")

# MYSQL CONNECTION CHECK

myConnection = MYSQLconnectionCheck () if myConnection:

MYSQLconnection ()

while(True):

print("""

19

1---->FOR NEW ITEM

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

""")

choice = int(input("Please Enter Your Choice : "))

if choice == 1:

addItem()

elif choice ==2:

womenSection()

elif choice ==3:

menSection()

elif choice ==4:

20

kidsSection()

elif choice ==5:

modifyItem()

elif choice ==6:

item=searchItem()

if item:

print("**Record Found !!!**")

else:

print("Record Not Found , Please Try Again !")


elif choice ==7:

showInventory()

elif choice ==8:

removeItem()

elif choice ==9:

allBills()

elif choice == 10:

generateBill()

elif choice == 11:

print("Thanks for visitng THE MALL OF EMIRATESI \n

*We are eagerly waititng for your next visit !!! **")

break

else:

21

print("Sorry ,May Be You Are Giving Me Wrong Input, Please Try Again !!! ")

else:

print("\nERROR ESTABLISHING MYSQL CONNECTION !")

# END OF THE PROJECT


22

OUTPUT
23
24
25
26
27
28
29
30
31
32
33

MYSQL TABLES
34

CONCLUSION

The "mall of the emirates management system" project represents a significant leap
in the realm of retail and business operations, demonstrating the potential of python and
mysql in creating a cohesive, efficient, and data-driven management solution. As we
conclude this exploration, it's evident that the integration of technology not only
enhances the operational aspects of a mall but also contributes to a more personalized
and engaging experience for both customers and businesses.
35

BIBLIOGRAPHY

 INFORMATICS PRACTICES GUIDE WRITTEN BY SUMITA ARORA


 SIPO INFORMATICS PRACTICES BOOK
 HTTPS://DOWNLOAD.CODE-PROJECTS.ORG/
 HTTPS://WWW.GOOGLE.CO.IN/
 HTTPS://WWW.GEEKSFORGEEKS.ORG/
 HTTPS://COLAB.RESEARCH.GOOGLE.COM/
 HTTPS://WWW.W3SCHOOLS.COM/PYTHON/PYTHON_COMPILER.ASP
 HTTPS://XIIPYTHON.BLOGSPOT.COM/P/PYTHON-PROJECTS.HTML
 HTTPS://DRIVE.GOOGLE.COM/DRIVE/FOLDERS/
12QYFCOSFOBP4LSWZECGCLLJCOUC549FR?USP=SHARING

36

You might also like