You are on page 1of 2

query transaction:

1/
select * from hotel

query transaction:

1/select FIRST_NAME,LAST_NAME
from customer
order by FIRST_NAME asc

2/select c.first_name,c.last_name
from customer c,reservation re
where re.CNO=c.customer_id

3/
select RNO reserved
from room r ,reservation re
where r.room_id=re.RNO AND START_DATE='17-JUN-12'

select RNO notreserved


from room r ,reservation re
where r.room_id=re.RNO AND START_DATE!='17-JUN-12'

4/update reservation
set END_DATE='20-JAN-20'
where RESERVATION_ID=2

5/select re.reservation_id ,s.FIRST_NAME,s.LAST_NAME,re.START_DATE as "check_in" ,


re.END_DATE as "check_out",r.room_id,r.room_type,rt.room_price,sum(SERVICE_PRICE)
as "total service",sum(room_price+SERVICE_PRICE) as "total bill price"
from room r ,reservation re ,customer s ,room_type rt,services ss,Resv_Ser rs
where rt.room_type=r.room_type AND r.ROOM_ID=re.RNO AND rs.RENO=re.reservation_id
AND rs.SNO=ss.service_id AND s.CUSTOMER_ID=re.CNO AND first_name='Alaa' AND
re.START_DATE='10-FEB-18'
group by re.reservation_id ,s.FIRST_NAME,s.LAST_NAME,re.START_DATE ,
re.END_DATE,r.room_id,r.room_type,rt.room_price

query transaction:
1/
select RNO notreserved ,h.hotel_id
from room r ,reservation re,hotel h
where r.room_id=re.RNO AND r.HID=h.hotel_id AND START_DATE!='10-FEB-04'

2/

3/insert into reservation


values (0006,'1-JAN-23','15-JAN-23',NULL,3,4)

4/delete from reservation


where reservation_id=2

select RNO reserved ,(select distinct(RNO) notreserved


from room r ,reservation re
where r.room_id=re.RNO AND START_DATE!='17-JUN-12')
from room r ,reservation re
where r.room_id=re.RNO AND START_DATE='17-JUN-12'

You might also like