Cafe Management System
Cafe Management System
Project Report
On
Cafe Management System
(PYTHON AND MYSQL)
Registration No:
1|Page
CERTIFICATE
candidate.
_______________________
Date: ____________ Sign of
External
2|Page
ACKNOWLEDGEMENT
I undertook this Project work, as the part of my XII-
Informatics Practices course. I had tried to apply my best of
knowledge and experience, gained during the study and class
work experience. 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.
3|Page
CONTENTS
SR NO. CONTENTS PAGE NO.
1 Introduction 5
2 Objective and Scope of the 6
Project
3 Theoretical Background 9
3.1 What is Database? 9
3.2 What is MYSQL? 12
3.3 What is Python IDLE? 14
4 Problem Definition and Analysis 17
5 System Implementation 19
6 System Design and Development 20
6.1 Database Design 20
6.2 Table Design And Code 21
7 User Manuals 42
7.1 How to install software 42
7.2 Database installation 43
8 References 45
4|Page
1. INTRODUCTION
This software project is developed to automate the functionalities of
program is tied with the database for easy access and interface to
This software, being simple in design and working, does not require
automating a Cafe
MANAGEMENT SYSTEM.
5|Page
per requirement of the CBSE curriculum of Informatics Practices
Course.
activities.
6|Page
• To provide graphical and user-friendly interface to interact
architecture.
MySQL . This software does not require much training time of the
7|Page
3. THEORETICAL BACKGROUND
SQL Server, MySQL, Oracle, Sybase etc, you can manage all your
Within the file, divide your data into separate storage containers
called tables. You may and retrieve the data using queries.
8|Page
A table is a collection of data about a specific topic, such as products
table.
To find and retrieve just the data that meets conditions you specify,
9|Page
A computer database works as an electronic filing system, which has
System (DBMS).
and direction.
10 | P a g e
• Mathematical functions can be performed and the data stored in
11 | P a g e
data stored in a computer database, you need a database
putting all the data in one big storeroom. This adds speed and
ANSI/ISO SQL Standard. The SQL standard has been evolving since 1986
in 1999, and “SQL: 2003” refers to the current version of the standard.
12 | P a g e
• Uses a very fast thread-based memory allocation system.
• Executes very fast joins using an optimized nested-loop join.
• Implements SQL functions using a highly optimized class
13 | P a g e
In the last few years, its popularity has increased immensely.
Python Features:
14 | P a g e
Python Advantages
platforms.
15 | P a g e
• A standard DB-API for database connectivity has been
work, and success in this endeavour has eluded many of us. Yet,
16 | P a g e
creates it. Problem definition is one of the most crucial steps in
and there is no way to validate that the built system satisfies the
requirement.
of customer and users, trying to find out who the user really is,
• Evolution of needs.
17 | P a g e
After the analysis of the functioning of a Event Management
5. SYSTEM IMPLEMENTATION
Device ID 5252FE6E-EE40-476E-99B6-49A63EB5321D
Product ID 00356-24523-42395-AAOEM
18 | P a g e
The Software’s used:
19 | P a g e
A logical data often represented as a records are kept in different
data base design lies in the table structure and its relationship.
6.2Table Design:
are designed to store master records. The tables and their structure
20 | P a g e
21 | P a g e
Table Name: Items
22 | P a g e
6.2 Program code:
import numpy as np
import mysql.connector
import pandas as pd
mycursor=mycon.cursor()
print()
print()
print('''----------------------------------------------------------------------------------
''')
print('𝟰 - 𝗠𝗲𝗻𝘂/𝗢𝗿𝗱𝗲𝗿/𝗕𝗶𝗹𝗹')
print('𝟱 - 𝗚𝗿𝗮𝗽𝗵𝘀')
print('𝟲 - 𝗘𝘅𝗶𝘁')
print()
print('''----------------------------------------------------------------------------------
''')
print()
23 | P a g e
print('''----------------------------------------------------------------------------------
''')
if ch==1:
print('𝗖𝗨𝗦𝗧𝗢𝗠𝗘𝗥 𝗗𝗘𝗧𝗔𝗜𝗟𝗦')
print()
print()
print('''----------------------------------------------------------------------------------
''')
print()
print('''----------------------------------------------------------------------------------
''')
if cd=='A':
add="insert into customer values ('"+ cid +"','"+ cname +"','"+ cphone +"','"+ payment +"','"+ pstatus +"','"+ email
+"','"+ orderid +"')"
24 | P a g e
mycursor.execute(add)
mycon.commit()
print()
print()
print('''==================================================================================
''')
elif cd=='B':
print('1-𝗖𝘂𝘀𝘁𝗼𝗺𝗲𝗿 𝗜𝗗')
print('2-𝗘𝗺𝗮𝗶𝗹 𝗜𝗗')
print()
print()
print('''----------------------------------------------------------------------------------
''')
if d==1:
mycursor.execute(dl)
mycon.commit()
print()
print()
print('''==================================================================================
''')
elif d==2:
25 | P a g e
dl="delete from customer where email='" +ce+ "'"
mycursor.execute(dl)
mycon.commit()
print()
print()
print('''==================================================================================
''')
else:
print('𝑰𝒏𝒗𝒂𝒍𝒊𝒅 𝒄𝒉𝒐𝒊𝒄𝒆. 𝑷𝒍𝒆𝒂𝒔𝒆 𝒄𝒉𝒐𝒐𝒔𝒆 𝒇𝒓𝒐𝒎 𝒕𝒉𝒆 𝒈𝒊𝒗𝒆𝒏 𝒏𝒖𝒎𝒃𝒆𝒓𝒔 𝒐𝒏𝒍𝒚 !')
print()
print('''==================================================================================
''')
elif cd=='C':
print()
mycursor.execute(s)
row=mycursor.fetchall()
df=pd.DataFrame(row,columns=['CID','CName','CPhone','Payment_Mode','PStatus','Email','OrderID'])
print(df)
print()
print('𝗧𝗼 𝘂𝗽𝗱𝗮𝘁𝗲')
print("1-𝗖𝘂𝘀𝘁𝗼𝗺𝗲𝗿'𝘀 𝗡𝗮𝗺𝗲")
26 | P a g e
print('3-𝗣𝗮𝘆𝗺𝗲𝗻𝘁 𝗦𝘁𝗮𝘁𝘂𝘀(𝗣𝗮𝗶𝗱/𝗨𝗻𝗽𝗮𝗶𝗱)')
print("4-𝗣𝗮𝘆𝗺𝗲𝗻𝘁 𝗺𝗼𝗱𝗲(𝗖𝗮𝘀𝗵/𝗖𝗮𝗿𝗱/𝗢𝗻𝗹𝗶𝗻𝗲)")
print('𝟱-𝗘𝗺𝗮𝗶𝗹 𝗜𝗗')
print()
print()
print('''----------------------------------------------------------------------------------
''')
if u==1:
mycursor.execute(up)
mycon.commit()
print()
print()
print('''==================================================================================
''')
elif u==2:
mycursor.execute(up)
mycon.commit()
print()
print()
print('''==================================================================================
''')
elif u==3:
27 | P a g e
ps=input('𝙴𝚗𝚝𝚎𝚛 𝚞𝚙𝚍𝚊𝚝𝚎𝚍 𝚙𝚊𝚢𝚖𝚎𝚗𝚝 𝚜𝚝𝚊𝚝𝚞𝚜(𝙿𝚊𝚒𝚍/𝚄𝚗𝚙𝚊𝚒𝚍) :')
mycursor.execute(up)
mycon.commit()
print()
print()
print('''==================================================================================
''')
elif u==4:
mycursor.execute(up)
mycon.commit()
print()
print()
print('''==================================================================================
''')
elif u==5:
mycursor.execute(up)
mycon.commit()
print()
28 | P a g e
print()
print('''==================================================================================
''')
else:
print('𝑰𝒏𝒗𝒂𝒍𝒊𝒅 𝒄𝒉𝒐𝒊𝒄𝒆. 𝑷𝒍𝒆𝒂𝒔𝒆 𝒄𝒉𝒐𝒐𝒔𝒆 𝒇𝒓𝒐𝒎 𝒕𝒉𝒆 𝒈𝒊𝒗𝒆𝒏 𝒏𝒖𝒎𝒃𝒆𝒓𝒔 𝒐𝒏𝒍𝒚 !')
print()
print('''==================================================================================
''')
elif cd=='D':
mycursor.execute(s)
row=mycursor.fetchall()
df=pd.DataFrame(row,columns=['CID','CName','CPhone','Payment','PStatus','Email','OrderID'])
print(df)
print()
print('''==================================================================================
''')
else:
print('❗❗-----🇮🇳🇻🇦🇱🇮🇩🇨🇭🇴🇮🇨🇪-----❗❗')
print()
print('''==================================================================================
''')
elif ch==2:
print('𝗘𝗠𝗣𝗟𝗢𝗬𝗘𝗘 𝗗𝗘𝗧𝗔𝗜𝗟𝗦')
print()
29 | P a g e
print('A - 𝗘𝗻𝘁𝗲𝗿 𝗲𝗺𝗽𝗹𝗼𝘆𝗲𝗲 𝗱𝗲𝘁𝗮𝗶𝗹𝘀')
print()
print('''----------------------------------------------------------------------------------
''')
print()
print('''----------------------------------------------------------------------------------
''')
if ed=='A':
add="insert into employee values ('"+ eid +"','"+ en +"','"+ eg +"','"+ ea +"','"+ ep +"','"+ ei +"')"
mycursor.execute(add)
mycon.commit()
print()
print()
print('''==================================================================================
''')
30 | P a g e
elif ed=='B':
print('1-𝗘𝗺𝗽𝗹𝗼𝘆𝗲𝗲 𝗜𝗗')
print('2-𝗘𝗺𝗮𝗶𝗹 𝗜𝗗')
print()
print()
print('''----------------------------------------------------------------------------------
''')
if d==1:
mycursor.execute(dl)
mycon.commit()
print()
elif d==2:
mycursor.execute(dl)
mycon.commit()
print()
else:
print('𝑰𝒏𝒗𝒂𝒍𝒊𝒅 𝒄𝒉𝒐𝒊𝒄𝒆. 𝑷𝒍𝒆𝒂𝒔𝒆 𝒄𝒉𝒐𝒐𝒔𝒆 𝒇𝒓𝒐𝒎 𝒕𝒉𝒆 𝒈𝒊𝒗𝒆𝒏 𝒏𝒖𝒎𝒃𝒆𝒓𝒔 𝒐𝒏𝒍𝒚 !')
print()
print('''==================================================================================
''')
31 | P a g e
elif ed=='C':
print()
mycursor.execute(s)
row=mycursor.fetchall()
df=pd.DataFrame(row,columns=['EID','EName','EGender','EAge','EPhone','Email'])
print(df)
print()
print('𝗧𝗼 𝘂𝗽𝗱𝗮𝘁𝗲')
print("1-𝗘𝗺𝗽𝗹𝗼𝘆𝗲𝗲'𝘀 𝗡𝗮𝗺𝗲")
print("3-𝗘𝗺𝗽𝗹𝗼𝘆𝗲𝗲'𝘀 𝗔𝗴𝗲")
print('4-𝗘𝗺𝗮𝗶𝗹 𝗜𝗗')
print()
print()
print('''----------------------------------------------------------------------------------
''')
if u==1:
mycursor.execute(up)
mycon.commit()
print()
32 | P a g e
print()
print('''==================================================================================
''')
elif u==2:
mycursor.execute(up)
mycon.commit()
print()
print()
print('''==================================================================================
''')
elif u==3:
mycursor.execute(up)
mycon.commit()
print()
print()
print('''==================================================================================
''')
elif u==4:
mycursor.execute(up)
mycon.commit()
print()
33 | P a g e
print('𝙏𝙝𝙚 𝙧𝙚𝙘𝙤𝙧𝙙 𝙝𝙖𝙨 𝙗𝙚𝙚𝙣 𝙨𝙪𝙘𝙘𝙚𝙨𝙨𝙛𝙪𝙡𝙡𝙮 𝙪𝙥𝙙𝙖𝙩𝙚𝙙 !')
print()
print('''==================================================================================
''')
else:
print('𝑰𝒏𝒗𝒂𝒍𝒊𝒅 𝒄𝒉𝒐𝒊𝒄𝒆. 𝑷𝒍𝒆𝒂𝒔𝒆 𝒄𝒉𝒐𝒐𝒔𝒆 𝒇𝒓𝒐𝒎 𝒕𝒉𝒆 𝒈𝒊𝒗𝒆𝒏 𝒏𝒖𝒎𝒃𝒆𝒓𝒔 𝒐𝒏𝒍𝒚 !')
print()
print('''==================================================================================
''')
elif ed=='D':
mycursor.execute(s)
row=mycursor.fetchall()
df=pd.DataFrame(row,columns=['EID','EName','EGender','EAge','EPhone','Email'])
print(df)
print()
print('''==================================================================================
''')
else:
print('❗❗-----🇮🇳🇻🇦🇱🇮🇩🇨🇭🇴🇮🇨🇪-----❗❗')
print()
print('''==================================================================================
''')
elif ch==3:
print('𝗙𝗢𝗢𝗗 𝗗𝗘𝗧𝗔𝗜𝗟𝗦')
34 | P a g e
print()
print()
print()
print('''----------------------------------------------------------------------------------
''')
if fch == 'A':
mycursor.execute(ins)
mycon.commit()
print()
print('''----------------------------------------------------------------------------------
''')
print()
print('''==================================================================================
''')
35 | P a g e
print()
mycursor.execute(s)
row=mycursor.fetchall()
df=pd.DataFrame(row,columns=['Code No.','Items','Price','Item_Type'])
print(df)
print()
print('''----------------------------------------------------------------------------------
''')
print()
print()
print('''----------------------------------------------------------------------------------
''')
if uf==1:
mycursor.execute(fn)
mycon.commit()
print()
print('''----------------------------------------------------------------------------------
''')
print()
36 | P a g e
print('''==================================================================================
''')
elif uf==2:
mycursor.execute(up)
mycon.commit()
print()
print('''----------------------------------------------------------------------------------
''')
print()
print('''==================================================================================
''')
elif uf==3:
mycursor.execute(ft)
mycon.commit()
print()
print('''----------------------------------------------------------------------------------
''')
print()
print('''==================================================================================
''')
else:
37 | P a g e
print('𝑰𝒏𝒗𝒂𝒍𝒊𝒅 𝒄𝒉𝒐𝒊𝒄𝒆. 𝑷𝒍𝒆𝒂𝒔𝒆 𝒄𝒉𝒐𝒐𝒔𝒆 𝒇𝒓𝒐𝒎 𝒕𝒉𝒆 𝒈𝒊𝒗𝒆𝒏 𝒏𝒖𝒎𝒃𝒆𝒓𝒔 𝒐𝒏𝒍𝒚 !')
print()
print('''==================================================================================
''')
mycursor.execute(delete_query)
mycon.commit()
print()
print('''----------------------------------------------------------------------------------
''')
print()
print('''==================================================================================
''')
else:
print('❗❗-----🇮🇳🇻🇦🇱🇮🇩🇨🇭🇴🇮🇨🇪-----❗❗')
print()
print('''==================================================================================
''')
if ch == 4:
print()
print('''+--------+
38 | P a g e
| 𝓢𝓗𝓐𝓚𝓔𝓢 |
+--------+''')
print()
mycursor.execute(s)
row1 = mycursor.fetchall()
print(df)
print()
print('''+---------+
| 𝓦𝓐𝓕𝓕𝓛𝓔𝓢 |
+---------+''')
print()
mycursor.execute(t)
row2 = mycursor.fetchall()
print(du)
print()
print('''+-----------+
| 𝓘𝓒𝓔-𝓒𝓡𝓔𝓐𝓜 |
+-----------+''')
print()
mycursor.execute(u)
row3 = mycursor.fetchall()
39 | P a g e
dc = pd.DataFrame(row3, columns=['𝗖𝗢𝗗𝗘 𝗡𝗢.','𝗜𝗖𝗘-𝗖𝗥𝗘𝗔𝗠', ' 𝗣𝗥𝗜𝗖𝗘'])
print(dc)
print()
print('''+-----------+
| 𝓢𝓐𝓝𝓓𝓦𝓘𝓒𝓗 |
+-----------+''')
print()
mycursor.execute(v)
row4 = mycursor.fetchall()
print(dk)
print()
print('''==================================================================================
''')
print()
print()
if o == 'YES':
ol = []
40 | P a g e
for i in range(ct):
ol.append(of)
print()
ino = len(ol)
print('''----------------------------------------------------------------------------------
''')
print()
mycursor.execute(ds, ol)
row = mycursor.fetchall()
if row:
df = pd.DataFrame(row, columns=mycursor.column_names)
print(df)
print()
print('''----------------------------------------------------------------------------------
''')
print()
if sm=='YES':
for i in range(ct):
ol.append(og)
41 | P a g e
print()
ino = len(ol)
print('''----------------------------------------------------------------------------------
''')
print()
print('''==================================================================================
''')
else:
print('''==================================================================================
''')
print()
bill_no = str(np.random.randint(1,1000))
print('𝙉𝘼𝙈𝙀 :',cnm)
print()
bill_items = []
total_price = 0
mycursor.execute(s, (item_code,))
item = mycursor.fetchone()
42 | P a g e
if item:
item_name = item[1]
price = item[2]
item_found = False
bill_items[idx]['Quantity'] += 1
bill_items[idx]['Price'] += price
item_found = True
break
if not item_found:
bill_items.append({
'Quantity': 1,
'Price': price,
'Date':date.today()
})
print(bill_df)
print()
print()
print('''==================================================================================
43 | P a g e
''')
tp = str(bill_df["Price"].sum())
dt = bill_df.iloc[0]['Date']
sql = "INSERT INTO bill (bill_no, Amount, Date) VALUES (%s, %s, %s)"
mycursor.execute(sql, val)
mycon.commit()
else:
print('''----------------------------------------------------------------------------------
''')
print()
print('''==================================================================================
''')
elif o == 'NO':
print('''----------------------------------------------------------------------------------
''')
print("𝑶𝒌𝒂𝒚. 𝑳𝒆𝒕 𝒖𝒔 𝒌𝒏𝒐𝒘 𝒊𝒇 𝒕𝒉𝒆𝒓𝒆'𝒔 𝒂𝒏𝒚𝒕𝒉𝒊𝒏𝒈 𝒆𝒍𝒔𝒆 𝒘𝒆 𝒄𝒂𝒏 𝒉𝒆𝒍𝒑 𝒚𝒐𝒖 𝒘𝒊𝒕𝒉 !")
print()
print('''==================================================================================
''')
else:
print('''----------------------------------------------------------------------------------
''')
44 | P a g e
print('𝑰𝒏𝒗𝒂𝒍𝒊𝒅 𝒊𝒏𝒑𝒖𝒕. 𝑷𝒍𝒆𝒂𝒔𝒆 𝒆𝒏𝒕𝒆𝒓 𝒆𝒊𝒕𝒉𝒆𝒓 𝒀𝒆𝒔 𝒐𝒓 𝑵𝒐.')
print()
print('''==================================================================================
''')
elif ch == 5:
print('𝗚𝗥𝗔𝗣𝗛𝗦')
print()
print("B - 𝗜𝗻𝗰𝗼𝗺𝗲")
print()
print()
print('''----------------------------------------------------------------------------------
''')
if g == 'A':
mycursor.execute(i)
row=mycursor.fetchall()
df=pd.DataFrame(row)
l=df.values.tolist()
ia=np.array(l)
ra=ia.flatten()
l1=list(ra)
l2=['Shakes','Waffles','Icecreams','Sandwiches']
plt.bar(l2,l1,color=['rosybrown','coral','cyan','cornflowerblue'])
plt.title('𝕋𝕪𝕡𝕖𝕤 𝕠𝕗 𝕚𝕥𝕖𝕞𝕤')
45 | P a g e
plt.xlabel('ITEMS')
plt.ylabel('TYPE OF ITEMS')
plt.show()
elif g == 'B':
print("𝟭 - 𝗗𝗮𝗶𝗹𝘆")
print("𝟮 - 𝗪𝗲𝗲𝗸𝗹𝘆")
print("𝟯 - 𝗠𝗼𝗻𝘁𝗵𝗹𝘆")
print()
print()
print('''----------------------------------------------------------------------------------
''')
if ic=='1':
query = "SELECT DATE_FORMAT(Date, '%d') AS Day, SUM(Amount) AS Total_Amount FROM bill GROUP BY Day
ORDER BY Day"
mycursor.execute(query)
rows = mycursor.fetchall()
plt.title('𝔻𝕒𝕚𝕝𝕪 𝕀𝕟𝕔𝕠𝕞𝕖')
plt.xlabel('DAY OF MONTH')
plt.ylabel('INCOME')
plt.show()
elif ic=='2':
46 | P a g e
query = "SELECT YEARWEEK(Date) AS Week, SUM(Amount) AS Total_Amount FROM bill GROUP BY Week ORDER BY
Week"
mycursor.execute(query)
rows = mycursor.fetchall()
plt.title('𝕎𝕖𝕖𝕜𝕝𝕪 𝕀𝕟𝕔𝕠𝕞𝕖')
plt.xlabel('WEEK NUMBER')
plt.ylabel('INCOME')
plt.show()
elif ic=='3':
query = "SELECT DATE_FORMAT(Date, '%Y-%m') AS Month, SUM(Amount) AS Total_Amount FROM bill GROUP BY
Month ORDER BY Month"
mycursor.execute(query)
rows = mycursor.fetchall()
plt.title('𝕄𝕠𝕟𝕥𝕙𝕝𝕪 𝕀𝕟𝕔𝕠𝕞𝕖')
plt.xlabel('MONTH')
plt.ylabel('INCOME')
plt.xticks(rotation=45)
plt.tight_layout()
plt.show()
else:
47 | P a g e
print('𝑰𝒏𝒗𝒂𝒍𝒊𝒅 𝒄𝒉𝒐𝒊𝒄𝒆. 𝑷𝒍𝒆𝒂𝒔𝒆 𝒄𝒉𝒐𝒐𝒔𝒆 𝒇𝒓𝒐𝒎 𝒕𝒉𝒆 𝒈𝒊𝒗𝒆𝒏 𝒏𝒖𝒎𝒃𝒆𝒓𝒔 𝒐𝒏𝒍𝒚 !')
print()
print('''==================================================================================
''')
else:
print('❗❗-----🇮🇳🇻🇦🇱🇮🇩🇨🇭🇴🇮🇨🇪-----❗❗')
print()
print('''==================================================================================
''')
elif ch==6:
pass
48 | P a g e
.
49 | P a g e
50 | P a g e
51 | P a g e
52 | P a g e
7. USER MANUAL
53 | P a g e
7.2 Database Installation
named food with required tables. Some dummy records are present
5.1\Bin folder.
DOS.
54 | P a g e
C:\Program files\Mysql\MySql server 5.1\Bin>
55 | P a g e
9. REFERENCES
✓ Teachers Guidance
✓ www.geeksforgeeks.com
56 | P a g e