-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSQL_queries.py
12 lines (12 loc) · 1.07 KB
/
SQL_queries.py
1
2
3
4
5
6
7
8
9
10
11
12
room_all='''SELECT ROOM_NO,CATEGORY,OCCUPANCY FROM ROOMS;'''
room_occupied='''SELECT ROOM_NO,CATEGORY,OCCUPANCY FROM ROOMS WHERE OCCUPANCY IS NOT NULL;'''
room_empty='''SELECT ROOM_NO,CATEGORY,OCCUPANCY FROM ROOMS WHERE OCCUPANCY IS NULL;'''
list_customers = '''SELECT ID FROM CUSTOMER;'''
customer_details = '''SELECT NAME,PHONE_NO,AADHAR,GENDER,ENTRY_TIME FROM CUSTOMER WHERE ID=?;'''
calc_fare = '''select entry_time,datetime("now","localtime"),(strftime("%s","now","localtime")-strftime("%s",entry_time))/3600*price from customer,rooms where occupancy=customer.id and customer.id=?;'''
empty_room='''update rooms set occupancy=Null where occupancy=?;'''
delete_customer='''delete from customer where id=?;'''
get_bill_details='''select strftime("%d-%m-%Y","now","localtime"),time("now","localtime"),name,aadhar,phone_no,entry_time,datetime("now","localtime"),room_no,price from customer,rooms where occupancy=id and id=?;'''
get_bill_id = '''select id from bills order by id desc;'''
save_bill = '''insert into bills(bill) values(?);'''
obtain_bill = '''select bill from bills where id=?;'''