Assignment3 B
Assignment3 B
Questions [8 marks]
1. The home page of the Brewbean's Web site has an option for members to log on with
their IDs and passwords. Develop a procedure named MEMBER_CK_SP that accepts
the ID and password as inputs, checks whether they make up a valid logon, and returns
the member name and cookie value. The name should be returned as a single text string
containing the first and last name.
The head developer wants the number of parameters minimized so that the same
parameter is used to accept the password and return the name value. Also, if the user
doesn't enter a valid username and password, return the value INVALID in a parameter
named p_check. Test the procedure using a valid logon first, with the username rat55
and password kile. Then try it with an invalid logon by changing the username to rat.
Assignment #3 Page 1 of 3
Advanced Database COMP214
2. Create a procedure named DDPAY_SP that identifies whether a donor currently has an
completed pledge with no monthly payments. A donor ID is the input to the procedure.
Using the donor ID, the procedure needs to determine whether the donor has any
currently completed pledges based on the status field and is/was not on a monthly
payment plan. If so, the procedure is to return the Boolean value TRUE. Otherwise, the
value FALSE should be returned. Test the procedure with an anonymous block.
4. The Reporting and Analysis Department has a database containing tables that hold
summarized data to make report generation simpler and more efficient. They want to
schedule some jobs to run nightly to update summary tables. Create two procedures to
update the following tables(assuming that existing data in the tables is deleted before
these procedures run):
table, which holds total sales dollars and total sales quantity by product ID, month,
and year. The order date should be used for the month and year information.
Assignment #3 Page 2 of 3
Advanced Database COMP214
table, which holds total dollar sales by shopper ID. The total should include only
DESCRIBE command to review their table structures. Run pl/sql block to execute
and present results for both procedures.
Assignment #3 Page 3 of 3