Sample Exam Questions
※This sample exam is different from those that appear in the actual OSS-DB Exam.
2024/05/01
To define a view, you use CREATE VIEW. There is an ALTER VIEW command to change the attributes of a defined view, but the only attributes that can be changed are the view name, owner, and schema, and ALTER VIEW can do very little. Note that this is very different from ALTER TABLE which can change most attributes of a table.
To rename a view, use
ALTER VIEW old_view_name RENAME TO new_view_name
for example.
To change the owner of a view, use
ALTER VIEW view_name OWNER TO new_owner
for example.
Changes to the SQL statements that define a view, such as adding columns to a view, can be done with
CREATE OR REPLACE VIEW view_name AS SQL_statement
However, this syntax only allows columns in the existing view to remain in the same order and data type, and append the new column to the end. You cannot drop a column or change its data type even with CREATE OR REPLACE VIEW. You must drop the view with DROP VIEW and then recreate it with CREATE VIEW.
So the correct answers are D and E.
© EDUCO All Rights Reserved.