Exam: DP-900: Microsoft Azure Data Fundamentals 0 Likes
You need to modify a view in a relational database by adding a new (DP-900)
You need to modify a view in a relational database by adding a new column.
Which statement should you use?
A. MERGE
B. ALTER
C. INSERT
D. UPDATE
Solution
Correct answer: B. ALTER.
To modify an existing view in a relational database by adding a new column, you should use the ALTER VIEW statement.
The syntax for altering a view to add a new column is:
ALTER VIEW view_name
AS
SELECT existing_columns, new_column
FROM table_name
Here's a breakdown of the other options:
A. MERGE - The MERGE statement is used to perform insert, update, and delete operations on a target table based on the changes in a source table. It is not used to modify a view.
C. INSERT - The INSERT statement is used to add new rows to a table, not to modify the structure of a view.
D. UPDATE - The UPDATE statement is used to modify the values of existing rows in a table, not to modify the structure of a view.
So, the correct SQL statement to use to add a new column to an existing view is the ALTER VIEW statement.
Category: Identify considerations for relational data on Azure