Dhyey It File
Dhyey It File
NAME:- DHYEY R
DHADUK STD:- 11
COMMERCE ROLL NO :-6
YEAR:- 2024-2025
TOPIC:- PRACTICAL FILE
Python Programms
Question 1: Accept three numbers and show which
one is big and which one is small.
a = int(input("enter first no"))
b = int(input("enter second no"))
c = int(input("enter third no"))
if a > b:
if a > c:
print(a, "is big")
if b < c:
print(b, "is small")
else:
print(c, "is small")
else:
print(c, "is big")
print(b, "is smallest")
else:
if b > c:
print(b, "is big")
if a < c:
print(a, "is small")
else:
print(c, "is small")
else:
print(c, "is big")
print(a, "is smallest")
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 13:- Display all those record whose sal not yet
decided
Select * from emp where Sal is NULL;
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%’;
HOTEL
MANAGEMENT
system
import mysql.connector as
sql
con=sql.connect(host="local
host",
user="root",password="Vis
ma@12 3")
cur=con.cursor()
cur.execute("create
database if not exists
dhyeyproject")
cur.execute("use
dhyeyproject") ## room
table ## cur.execute("create
table if not exists room
(roomid int (50) primary
key , roomtype varchar (10),
roomvacancy int(1),
roomcost float(10,2),
roomfacilities varchar (30))")
## customer table ##
cur.execute("create table if
not exists customer (cid int
(50) primary key , cnm
varchar (70), cad varchar
(100), cgen varchar (20),
cdob date , cidproof int (20),
ccid date, ccod date, crtype
varchar (20), crcost
float(10,2), crid int (50), csa
varchar (50), nop int (10),
pot varchar (30), ap float
(10,2))")
## employee table ##
cur.execute("create table if
not exists employee
(employeeid int(20),
employeename varchar
(100), departmentname
varchar
(20), designation varchar
(30),
salary float
(10))") ##
service table ##
cur.execute("create table if
not exists service (roomid int
(10), dining int (20), laundry
int (20), roomservice int
(10), totalamt int (10))")
## room add
def## def
roomadd():
roomid=int(input("enter
room id
"))
roomtype=input("enter
the
room type")
roomvacancy=int(input("e
nter
the vacancy of the room"))
roomcost=float(input("ent
er the cost of the room"))
roomfacalities=input("ente
r the facalities of the room
available")
cur.execute(f"insert into
room
values({roomid},'{roomtype
}',0,
{roomcost},'{roomfacalitie
s}')") con.commit()
print("record saved")
f=int(input("enter any
number
too continue"))
##room modify def
## 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}")
## room details
def## def
roomdetails():
cur.execute("select * from
room
")
recs=cur.execute("fetch all
")
## room remove def
## 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})") ##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
c if
h ch==5
= :
= return
3
:
p
a
s
s
el
i
f
c
h
=
=
4
:
p
a
s
s
el
##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()