Hour 22, "Advanced SQL Topics"

Quiz Answers

1: Can a trigger be altered?
A1: No, the trigger must be replaced or re-created.
2: When a cursor is closed, can you reuse the name?
A2: This is implementation-specific. In some implementations, the closing of the cursor will allow you to reuse the name and even free the memory, while for other implementations you must use the DEALLOCATE statement before the name can be reused.
3: What command is used to retrieve the results after a cursor has been opened?
A3: The FETCH command.
4: Are triggers executed before or after an INSERT, DELETE, or UPDATE?
A4: Triggers can be executed before or after an INSERT, DELETE, or UPDATE. There are many different types of triggers that can be created.

Exercise Answers

Get Sams Teach Yourself SQL in 24 Hours, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.