In SQL, the ______ command is used to recompile view.
2020
In SQL, the ______ command is used to recompile view.
- A.
ALTER VIEW
- B.
DEFINE VIEW
- C.
CREATE VIEW
- D.
COMPILE VIEW
Attempted by 250 students.
Show answer & explanation
Correct answer: A
The correct option is A (ALTER VIEW).
In database dialects that support explicit view recompilation (such as Oracle SQL), the ALTER VIEW view_name COMPILE; statement is used to manually recompile an invalid or outdated view. This occurs when underlying base tables are modified, ensuring dependencies are verified without recreating the view definition.