parth it file
parth it file
PRACTICES
Variant 2:
Question 3:- Display all emp info who join industry in 2020
Select * from emp where year(Doj) = 2020;
Question 5:- Display emp name and doj and sal except
manager post
Select Ename,Doj,Sal from emp where Desig!=’Manager’;
Question 15:- Display name and dpt name who join in march
2024
Select Ename,Dnm from emp.dpt where month(Doj) = 3 and
year(Doj) = 2024;
Question 23:- Display all emp info whose surname start with
‘s’
Select * from emp where right(Ename) = ‘s’ or right(Ename) = ‘S%’;
## room table ##
cur.execute("create table if not
exists room (roomid int (50)
primary key , roomtype varchar
(10), vacancy int(1), cost
float(10,2), facilities varchar
(30))")
## customer table ##
## employee table ##
## service table ##
def roomadd():
roomid=int(input("enter room id "))
roomtype=input("enter the
room type")
roomvacancy=int(input("enter
the vacancy of the room"))
roomcost=float(input("enter
the cost of the room"))
roomfacalities=input("enter the
facalities of the room available")
cur.execute(f"insert into room
values({roomid},'{roomtype}',0,
{roomcost},'{roomfacalities}')")
con.commit()
print("record saved")
f=int(input("enter any number
too continue"))
def roomremove():
ri=int(input("enter the room id
which is to be deleted "))
cur.execute("delete from
room where room id =ri")
##customer add def ##
def customeradd():
cid=int(input("enter the
customer id of the customer "))
cnm=input("enter the name of
the customer ")
cad=input("enter the address of
the customer ")
cgen=input("enter the gender of
the customer ")
cdob=input("enter the date of
birth of customer ")
cidproof=int(input("enter the id
proof number of the customer "))
ccid=input("enter the check in
date of the customer ")
ccod=input("enter the check out
date of the customer ")
crtype =input("enter the type of
the room of customer ")
crcost=int(input("enter the cost
of the room of the customer "))
crid=int(input("enter the
room id of the room id of the
customer "))
csa=input("enter the service
availed by the customer ")
nop=int(input("enter the
number of person with the
customer "))
pot=input(" enter the purpose
of travel of the customer ")
ap=int(input("enter the amount
to be paid by the customer "))
cur.execute(f"insert into
customer
values({cid},'{cnm}','{cad}','{cge
n}','{cdob}',
{cidproof},'{ccid}','{ccod}','{crty
pe}',{crcost},{crid},'{csa}',
{nop},'{pot}',{ap})")
def roommodify():
rid=int(input("enter your room
id "))
print("enter your thing to be
modify ")
print("""1.room type
2. room vacancy
3. room cost
4. room facalities""")
ch=int(input("enter your
choice
"))
if ch==1:
rt=input("enter the room
type")
cur.execute("update room
set roomtype ={rt} where
roomid={rid}")
elif ch==2 :
rv=input("enter the vacancy
of the room ")
cur.execute ("update room
set vacancy = {rv} where
roomid={rid}")
elif ch==3:
rc=float(input("enter the
cost
of the room"))
cur.execute("update room
set cost={rc} where
roomid=(rid}")
elif ch==4:
rf=input("enter the
new
facalities of the room")
cur.execute("update
table
room set facalities= {rf} where
roomid={rid}")
def roomdetails():
cur.execute("select * from room
")
recs=cur.execute("fetch all ")
##room menu ##
def roommenu():
print("""1.room add
2. room modify
3. room remove
4. display room details
5. back to main menu""")
ch=int(input("input
your
choice"))
if ch==1:
roomadd()
elif ch==2:
roommodify()
elif ch==3:
roomremove()
elif ch==4:
roomdetails()
elif ch==5:
return
## customer menu##
def customermenu():
print("""1.customer add
2. customer details modify
3. customer remove
4. display customer details
5. back to main menu """)
ch=int(input("enter your
choice
"))
if ch==1:
customeradd()
elif ch==2:
pass
elif ch==3:
pass
elif ch==4:
pass
else :
return
## employmenu ##
def employeemenu():
print("""1.employee add
2. employee details modify
3. employee remove
4. display employee details
5. back to main menu """)
ch=int(input("enter your
choice
"))
if ch==1:
pass
elif ch==2:
pass
elif ch==3:
pass
elif ch==4:
pass
elif ch==5:
return
##service menu##
def servicemenu():
print("""1. service add
2. service details modify
3. service remove
4. service details
5. back to main menu """)
ch=int(input("enter the choice
"))
if ch==1:
pass
elif ch==2:
pass
elif ch==3:
pass
elif ch==4:
pass
elif ch==5:
return
##mainmenu ###
while True:
print("welcome to the hotel
management system of jaymeel ")
print('''1.room
2.customer
3.employee
4.service
5.exit''')
ch=int(input("input your
choice"))
if ch==1:
roommenu()
elif ch==2:
customermenu()
elif ch==3:
employeemenu()
elif ch==4:
servicemenu()
exit()