nerdexam
Snowflake

COF-C02 · Question #219

How can a user change which columns are referenced in a view?

The correct answer is C. Recreate the view with the required changes. In Snowflake, to change the columns referenced in a view, the view must be recreated with the required changes. The ALTER VIEW command does not allow changing the definition of a view; it can only be used to rename a view, convert it to or from a secure view, or add, overwrite…

Data Transformations

Question

How can a user change which columns are referenced in a view?

Options

  • AModify the columns in the underlying table
  • BUse the ALTER VIEW command to update the view
  • CRecreate the view with the required changes
  • DMaterialize the view to perform the changes

How the community answered

(32 responses)
  • A
    3% (1)
  • B
    9% (3)
  • C
    84% (27)
  • D
    3% (1)

Explanation

In Snowflake, to change the columns referenced in a view, the view must be recreated with the required changes. The ALTER VIEW command does not allow changing the definition of a view; it can only be used to rename a view, convert it to or from a secure view, or add, overwrite, or remove a comment for a view. Therefore, the correct approach is to drop the existing view and create a new one with the desired column references.

Topics

#Views#DDL#View Management#CREATE OR REPLACE VIEW

Community Discussion

No community discussion yet for this question.

Full COF-C02 Practice