COMMIT permanently saves the changes made before it. ROLLBACK TO SAVEPOINT b reverses only work performed after savepoint b: it restores the deleted pen row and restores fountain pen's code from 30 to 3. The deletion of pencil occurred before savepoint b, so it remains deleted. The final committed rows therefore include pen with code 10 and fountain pen with code 3, but no pencil row. Oracle documents that a rollback to a savepoint reverses only changes made after that savepoint without ending the transaction.
Community Discussion