Comments on Mid-Term Examination

Section 1:

Question 1.

    Generally OK, with all sorts of minor problems.

Question 2.

(a)    This is supposed to be the easy question as it is pure SQL, not PL/SQL.  A little surprised by the problems many encountered.  Most answered the question incorrectly, giving instead the SNum that supplies a part that 'S5' does not supply.  Only a few answered correctly.

(b)    Many forgot the 'group by' clause.  Nobody handled the case where no records for the input PNum is found correctly.  As we have not covered exception handling formally, no point is deducted for the problem.  Several printed something within the function.  Nearly in all situation except debugging, do not print anything inside a function body.

(c)    This turrned out to be difficult.  Most do not know that it is not necessary to use cursors.  Many use two cursors and a nested loop.  These solution will be inefficient even if correct.

(d)    Generally OK, except only very few set the LogId correctly.  None do so correctly using the sequence number.  The nextval function cannot be called directly from PL/SQL.  It must appear in a SQL statement.