Exam 1z0-071 All QuestionsBrowse all questions from this exam
Question 240

Examine this schema information:

1. EMPLOYEES.DEPARTMENT_ID has a foreign key referencing DEPARTMENTS.DEPARTMENT_ID.

2. EMP_VIEW is based on the EMPLOYEES and DEPARTMENTS tables.

3. EMP_VIEW has columns EMPLOYEE_ID, EMPLOYEE_NAME and DEPARTMENT_NAME.

You must add a new column, MANAGER_ID, from the EMPLOYEES table, to the view, showing each employee’s manager.

Which statement will do this?

    Correct Answer: D

    The correct way to modify an existing view to add a new column is to use the CREATE OR REPLACE VIEW statement. This statement allows you to redefine the view with the new structure, including the new column manager_id. The other options do not provide the correct syntax for modifying a view or do not correctly integrate the new column into the view's structure.

Discussion
TomZhOption: D

You cannot alter view. You can only alter tables or sequences. SELECT - tables, views, sequences ALTER - tables, sequences all other - tables, views