Triggers assign - Assignment Q1: Hotel(Hotel_id,h_name,contactperson Room(room_no,floor_no,occupied Reserve(h_id,r_no,guestname,date _roo

Triggers assign - Assignment Q1:...

This preview shows page 1 - 2 out of 2 pages.

Assignment: Q1: You have the following tables: Hotel (Hotel_id , h_name, contact person) Room (room_no , floor_no, occupied) Reserve (h_id, r_no , guestname, date) Create a trigger that update the occupied field in the room to ‘y’ when the room is reserved to a guest. create or replace trigger t_room after insert on reserve for each row begin update room set occupied='yes' where r_id=:new.r_id; end; Q2: You have the following tables: Car (car_no , model, hour_price, no_of_drivers) Driver (d_no , d_name) Workdetails (trans_no , dno , carno ) Create a trigger that increases the no of drivers by one when a driver drives this car. create or replace trigger t_drive after insert on workdetails for each row
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read both pages?

  • Fall '08
  • 5odfatrek
  • following tables

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes