Question: 4. a. Create a stored procedure which has one IN parameter that is one of the BuildingIDs and two OUT parameters: one for the number

 4. a. Create a stored procedure which has one IN parameter

4. a. Create a stored procedure which has one IN parameter that is one of the BuildingIDs and two OUT parameters: one for the number of apartments in that building, and one for the average number of bedrooms on that building. b. Write the call statements that will retrieve the information for building B9.

5. Create a stored function called bonus_pct which calculates what percent the bonus is based on salary. Write a select statement that shows manager first and last names and bonus_pct for all managers whose bonus amount is not null.

6. Create a before update trigger on HAmanager called check_salaries that tests to see if the new salary value is greater than 100000. If it is, then set the new salary value back to the original salary. (Hint: the trigger should not update the table. It should only change the value being used in an update.

7. Write an update statement to test your trigger. (Triggers have their own tab for editing.)

8. Suppose you want to automatically assign new clients to any empty apartments. Create an after insert trigger on HAcorpclient that sets the ccid in HAapartment to the new ccid wherever the ccid in HAapartment IS NULL.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!