Professional Documents
Culture Documents
Features of Python:
• Free from technical errors
• Time saving
• Reduces manual work
• Visualized data e.g.-Bar chart, Histogram etc.
• User-Friendly interface
Features of MySQL:
• Ease of use
• Reliability
• Scalability
• Performance
• High availability
1. Identification of a project: The project idea may come through any real
life situation. For example, one could think of doing a project for organizing a
seminar. One needs to understand the usefulness of the project and its impact.
Students must be encouraged to undertake interdisciplinary projects.
2. Defining a plan: Normally for any kind of project, there are several project
members involved in it. One project leader has to be identified. The roles of project
leader and each project member have to be clearly defined. Students who are
performing a project must be assigned with specific activities. The various tools for
executing these activities must be known. To obtain a better solution, one should
always think of the extreme situations.
#Internal Files
def emp_list():
mydb=mysql.connector.connect(host="localhost", user="root",
password="*******",database="ddb")
mycursor=mydb.cursor()
mycursor.execute("Select Sno,Name from employees;")
x=mycursor.fetchall()
for i in x:
print(i)
mycursor.close()
mydb.close()
def emp_list1():
mydb=mysql.connector.connect(host="localhost", user="root", password="*******",
database="ddb")
mycursor=mydb.cursor()
mycursor.execute("Select * from employees;")
x=mycursor.fetchall()
for i in x:
print(i)
mycursor.close()
mydb.close()
def monthly_sales():
mydb= mysql.connector.connect(host="localhost", user="root", password="*******",
database="ddb")
mycursor=mydb.cursor()
mycursor.execute("Select * from monthly_sales;")
x=mycursor.fetchall()
for i in x:
print(i)
mycursor.close()
mydb.close()
def emp_profile():
mydb=mysql.connector.connect(host="localhost", user="root", password="*******",
database="ddb")
mycursor=mydb.cursor()
n=int(input("Enter your Id:"))
mycursor.execute("Select * from emp_profile where Id=%s",(n,))
rows=mycursor.fetchall()
for i in rows:
print(i)
mydb.commit
mydb.close()
def emp_profile1():
mydb=mysql.connector.connect(host="localhost", user="root", password="*******",
database="ddb")
mycursor=mydb.cursor()
mycursor.execute("Select * from emp_profile; ")
rows=mycursor.fetchall()
for i in rows:
print(i)
mydb.commit
mydb.close()
def add_emp():
mydb=mysql.connector.connect(host="localhost", user="root", password="*******",
database="ddb")
mycursor=mydb.cursor()
n=int(input("Enter the number of Records:"))
for i in range(n):
a=int(input("Enter Employee ID:"))
b=input("Enter Employee's Name:")
c=int(input("Enter Employee's Salary:"))
d=input("Enter Employee's Bonus:")
e=input("Enter Employee's Remark:")
mycursor.execute("insert into emp_profile values(%s,%s,%s,%s,%s)",(a,b,c,d,e))
mydb.commit()
mydb.close()
def delete_emp():
mydb=mysql.connector.connect(host="localhost", user="root", password="*******",
database="ddb")
mycursor=mydb.cursor()
n=int(input("Enter the Employee's ID to delete:"))
mycursor.execute("delete from emp_profile where id=%s",(n,))
rows=mycursor.fetchall()
for i in rows:
print(i)
mydb.commit
mydb.close()
def search_emp():
mydb=mysql.connector.connect(host="localhost", user="root", password="*******",
database="ddb")
mycursor=mydb.cursor()
n=int(input("Enter the Employee ID to search:"))
mycursor.execute("Select * from emp_profile where ID=%s",(n,))
rows=mycursor.fetchall()
for i in rows:
print(i)
mydb.commit
mydb.close()
#Customer File
def customer():
n=input("Enter your Name:")
m=int(input("Enter your Mobile No.:"))
mydb=mysql.connector.connect(host="localhost", user="root", password="*******",
database="ddb")
mycursor=mydb.cursor()
mycursor.execute("Select * from menu;")
x=mycursor.fetchall()
for i in x:
print(i)
mycursor.close()
mydb.close()
while True:
b=int(input("Enter your choice:"))
l=(b)
c=input("Do you want to add more?(y/n)")
if c=="n" or c=="N":
break
r=input("Do you want to have something to eat?(y/n)")
if r=="Y" or "y":
mydb=mysql.connector.connect(host="localhost", user="root", password="*******",
database="ddb")
mycursor=mydb.cursor()
mycursor.execute("Select * from extra;")
x=mycursor.fetchall()
for i in x:
print(i)
mycursor.close()
mydb.close()
while True:
s=int(input("Enter your choice:"))
l=(s)
e=input("Do you want to add more?(y/n)")
if e=="n" or e=="N":
break
#Employee File
def employee():
x=input("Enter password:")
if x=="DailyDripBistro@2772":
print("1. List of Employees")
print("2. Show Monthly Sales")
print("3. Employee Profile")
a=int(input("Enter your choice:"))
if a==1:
emp_list()
elif a==2:
monthly_sales()
elif a==3:
emp_profile()
else:
print("Invalid choice")
else:
print("Wrong password")
#Admin File
def admin():
x=input("Enter the password:")
if x=="admin@ddb_2772":
print("1. List of Employees")
print("2. Show Monthly Sales")
print("3. Employee Profile")
print("4. Add an Employee Profile")
print("5. Delete an Employee Profile")
print("6. Search an Employee Profile")
print("7. No. of Customers per day")
a=int(input("Enter your choice:"))
if a==1:
emp_list1()
elif a==2:
monthly_sales()
elif a==3:
emp_profile1()
elif a==4:
add_emp()
elif a==5:
delete_emp()
elif a==6:
search_emp()
elif a==7:
cust_day()
else:
print("Invalid choice")
else:
print("Wrong Password")
if a==1:
customer()
elif a==2:
employee()
elif a==3:
admin()
else:
print("Invalid choice")
b=input("Do you want to enter more?(y/n)")
if b=="N" or b=="n":
break
print("\n")
print("*"*20,"DAILY DRIP BISTRO - DAILY DOSE OF HAPPINESS","*"*20)
print("THANK YOU! VISIT AGAIN!!!")
Python
• If you are a Customer:
• If you are the Employee:
• If you are the Admin
MYSQL
Database Tables:
• NCERT CLASS XII (COMPUTER SCIENCE)
• www.wikipedia.org
• www.geeksforgeeks.org