Question 1:

Create a procedure that accepts 3 parameters, the first two are of mode IN with number as their datatype and the third one is of mode OUT in form of Varchar2. The procedure will compare the first two numbers and output the result as EQUAL, or DIFFERENT.

Create a second procedure called L8Q1 that accepts the two sides of a rectangle. The procedure will calculate the area and the perimeter of the rectangle. Use the procedure created previously to display if the shape is a square or a rectangle. The following are the example on how we execute the procedure and the expected output.

SQL > exec L4Q1(2,2)
The area of a square size 2 by 2 is 4. It`s perimeter is 8.
SQL > exec L4Q1(2,3)
The area of a rectangle size 2 by 3 is 6. It`s perimeter is 10.

Question 2:

Create a pseudo function called pseudo_fun that accepts 2 parameters represented the height and width of a rectangle. The pseudo function should return the area and the perimeter of the rectangle.

Create a second procedure called L4Q2 that accepts the two sides of a rectangle. The procedure will use the pseudo function to display the shape, the area and the perimeter.

SQL > exec L4Q2(2,2)
The area of a square size 2 by 2 is 4. It`s perimeter is 8.
SQL > exec L4Q2(2,3)
The area of a rectangle size 2 by 3 is 6. It`s perimeter is 10.

Question 3:

Create a pseudo function that accepts 2 parameters represented the inv_id, and the percentage increase in price. The pseudo function should first update the database with the new price then return the new price and the quantity on hand.

Create a second procedure called L4Q3 that accepts the inv_id and the percentage increase in price. The procedure will use the pseudo function to display the new value of the inventory (hint: value = price X quantity on hand)

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.