{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Addresstypeknd in buildingkindtype as stat varchar225

Info iconThis preview shows pages 2–3. Sign up to view the full content.

View Full Document Right Arrow Icon
create or replace procedure checkstatus(add in building.address%type,knd in building.kind%type) As stat varchar2(25); bn number; begin select b_no into bn from building where kind=knd and address=add; select status into stat from building where b_no=bn; if stat = 'not available' then begin dbms_output.put_line('building is not available'); return; end; else dbms_output.put_line(bn); end if; end checkstatus; begin checkstatus('bb','cc'); end; b-- take the b_no and get the count of customer in it if their number < 15 --set the building status to be 'no enough rent'. create or replace procedure checkscount(bn in building.b_no%type) As cnt number; begin select count(*) into cnt from custbuild where b_no=bn; if cnt< 15 then begin update building set status='not enough rent' where b_no=bn; dbms_output.put_line('not enough rent'); end; else dbms_output.put_line(cnt); end if; end checkscount; begin checkscount(1); end; Assignment: Q1: You have the following tables: Book (ISBN, title, edition) Member (ID, m_name, age) ReserveBook (I_SBN, i_d, date) Create a procedure that accept the book title and list all the member names that borrowed this book. The procedure should return error message if title is missing or not found. Q2: You have the following tables: Hotel (H_id, h_name, contactperson) Room (R_id, Floor_no, occupied) Reserve (H_id, R_id, Guestname, date)
Background image of page 2

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Create a procedure for adding new hotel. Stored procedure should get an error when a duplicate name is entered. Q3: You have the following tables: Car (carno, model, hourprice) Driver (d_no, d_name) WorkDetail (trans_no, carno, dno) Create a procedure that accept specific car model and return numbers of drivers who drove this car.
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page2 / 3

addresstypeknd in buildingkindtype As stat varchar225 bn...

This preview shows document pages 2 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online