nerdexam
Oracle

1Z0-007 · Question #3

You created a view called EMP_DEPT_VU that contains three columns from the EMPLOYEES and DEPARTMENTS tables: EMPLOYEE_ID, EMPLOYEE_NAME AND DEPARTMENT_NAME. The DEPARTMENT_ID column of the EMPLOYEES…

The correct answer is E. CREATE OR REPLACE VIEW emp_dept_vu AS. When we want to alter the underlying data used in the definition of a view, we use the CREATE OR REPLACE VIEW statement. When a CREATE OR REPLACE VIEW statement is issued, Oracle will disregard the error that arises when it encounters the view that already exists with that…

Monitor and Troubleshoot a XenDesktop 7 Environment

Question

You created a view called EMP_DEPT_VU that contains three columns from the EMPLOYEES and DEPARTMENTS tables:

EMPLOYEE_ID, EMPLOYEE_NAME AND DEPARTMENT_NAME. The DEPARTMENT_ID column of the EMPLOYEES table is the foreign key to the primary key DEPARTMENT_ID column of the DEPARTMENTS table. You want to modify the view by adding a fourth column, MANAGER_ID of NUMBER data type from the EMPLOYEES tables. How can you accomplish this task?

Options

  • AALTER VIEW emp_dept_vu (ADD manager_id NUMBER);
  • BMODIFY VIEW emp_dept_vu (ADD manager_id NUMBER);
  • CALTER VIEW emp_dept_vu AS
  • DMODIFY VIEW emp_dept_vu AS
  • ECREATE OR REPLACE VIEW emp_dept_vu AS
  • FYou must remove the existing view first, and then run the CREATE VIEW command with a new

How the community answered

(21 responses)
  • B
    5% (1)
  • C
    5% (1)
  • D
    10% (2)
  • E
    81% (17)

Explanation

When we want to alter the underlying data used in the definition of a view, we use the CREATE OR REPLACE VIEW statement. When a CREATE OR REPLACE VIEW statement is issued, Oracle will disregard the error that arises when it encounters the view that already exists with that name, and it will overwrite the definition for the old view with the definition for the new one. Incorrect Answers A: There is no ALTER VIEW command in Oracle. B: There is no MODIFY VIEW command in Oracle. C: There is no ALTER VIEW command in Oracle. D: There is no MODIFY VIEW command in Oracle. F: You don't need to remove the existing view to create modified view. You are able to do that with CREATE OR REPLACE command.

Topics

#SQL views#CREATE OR REPLACE VIEW#view modification#SQL DDL

Community Discussion

No community discussion yet for this question.

Full 1Z0-007 Practice