91.
How do you remove the view USA_STATES from the schema?
- [A]ALTER VIEW USA_STATES REMOVE;
- [B]DROP VIEW USA_STATES;
- [C]DROP VIEW USA_STATES CASCADE;
- [D]DROP USA_STATES;
- Answer & Explanation
- Report
Answer : [B]
Explanation :
Explanation :
A view is dropped using the DROP VIEW view_name; command. |
92.
In a join view, on how many base tables can you perform a DML operation (UPDATE/
INSERT/DELETE) in a single step?
- [A]One
- [B]The number of base tables in the view definition
- [C]The number of base tables minus one
- [D]None
- Answer & Explanation
- Report
Answer : [A]
Explanation :
Explanation :
You can perform an INSERT, UPDATE, or DELETE operation on the columns involving only one base table at a time. There are also some restrictions on the DML operations you perform on a join view. |
93.
The following code is used to define a view. The EMP table does not have a primary key or
any other constraints.
CREATE VIEW MYVIEW AS SELECT DISTINCT ENAME, SALARY FROM EMP WHERE DEPT_ID = 10;Which operation is allowed on the view?
- [A]SELECT, INSERT, UPDATE, DELETE
- [B]SELECT, UPDATE
- [C]SELECT, INSERT, DELETE
- [D]SELECT
- [E]SELECT, UPDATE, DELETE
- Answer & Explanation
- Report
Answer : [D]
Explanation :
Explanation :
Since the view definition includes a DISTINCT clause, only queries are allowed on the view. |
94.
Which statements are used to modify a view definition? (Choose all that apply.)
- [A]ALTER VIEW
- [B]CREATE OR REPLACE VIEW
- [C]REPLACE VIEW
- [D]CREATE FORCE VIEW
- [E]CREATE OR REPLACE FORCE VIEW
- Answer & Explanation
- Report
Answer : [B, E]
Explanation :
Explanation :
The OR REPLACE option in the CREATE VIEW statement is used to modify the definition of the view. The FORCE option can be used to create the view with errors. The ALTER VIEW statement is used to compile a view or to add or modify constraints on the view. |
95.
You create a view based on the EMPLOYEES table using the following SQL.
CREATE VIEW MYVIEW AS SELECT * FROM EMPLOYEES;
You modify the table to add a column named EMP_SSN. What do you need to do to have this new column appear in the view?
CREATE VIEW MYVIEW AS SELECT * FROM EMPLOYEES;
You modify the table to add a column named EMP_SSN. What do you need to do to have this new column appear in the view?
- [A]Nothing. Since the view definition is selecting all columns, the new column will appear in the view automatically.
- [B]Recompile the view using ALTER VIEW MYVIEW RECOMPILE.
- [C]Re-create the view using CREATE OR REPLACE VIEW.
- [D]Add the column to the view using ALTER VIEW MYVIEW ADD EMP_SSN.
- Answer & Explanation
- Report
Answer : [C]
Explanation :
Explanation :
When you modify the base table, the view becomes invalid. Oracle will recompile the view the first time it is accessed. Recompiling the view will make it valid, but the new column will not be available in the view. This is because when you create the view using *, Oracle expands the column names and stores the column names in the dictionary. |