Begin select bno into bn from building where kindknd

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

View Full Document Right Arrow Icon
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)
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.
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern