You are on page 1of 4

Section 15 Quiz

(Answer all questions in this section)
1. Evaluate this CREATE VIEW statement:
Mark for Review
(1) Points
CREATE VIEW emp_view
AS SELECT SUM(salary)
FROM employees;

Which statement is true?
You can update any data in the EMPLOYEES table using the EMP_VIEW view.
You can delete records from the EMPLOYEES table using the EMP_VIEW view.
You can update only the SALARY column in the EMPLOYEES table using the
EMP_VIEW view.
You cannot update data in the EMPLOYEES table using the EMP_VIEW view. (*)

Correct
2. Which keyword(s) would you include in a CREATE VIEW statement to create the view
whether or not the base table exists? Mark for Review
(1) Points
NOFORCE
WITH READ ONLY
FORCE (*)
OR REPLACE

Correct
3. Views must be used to select data from a table. As soon as a view is created on a table,
you can no longer select directly from the table. True or False? Mark for Review
(1) Points
True
False (*)

Correct
4. Which option would you use to modify a view rather than dropping it and recreating it?
Mark for Review
(1) Points
CREATE OR REPLACE (*)
FORCE
WITH ADMIN OPTION
NOFORCE

Correct
5. Which statement about the CREATE VIEW statement is true?
Mark for Review
(1) Points
A CREATE VIEW statement CANNOT contain an ORDER BY clause.

which of the following statements are true? Mark for Review (1) Points Allows for DELETES from other tables. Which option would you use when creating a view to ensure that no DML operations occur on the view? Mark for Review (1) Points .first_name.department_name FROM employees e. (*) Correct Section 15 Quiz (Answer all questions in this section) 6.department_id AND d.last_name emp_name. DELETE SELECT. DELETE (*) Correct 9. which operations would be allowed on the emp_dept view? Mark for Review (1) Points CREATE OR REPLACE VIEW emp_dept AS SELECT SUBSTR(e. INSERT SELECT. (*) Prohibits DML actions without administrator CHECK approval The view will allow the user to check it against the data dictionary Correct 7.department_id >=50. e. A CREATE VIEW statement CANNOT contain a function. UPDATE of some columns. Given the following view.1) ||' '||e. SELECT.1.salary. including ones not listed in subquery Prohibits changing rows not returned by the subquery in the view definition. A CREATE VIEW statement CAN contain a join query. Mark for Review (1) Points A column alias A join A GROUP BY clause (*) A WHERE clause Correct 8.department_id = d.hire_date. A CREATE VIEW statement CANNOT contain a GROUP BY clause. For a View created using the WITH CHECK OPTION keywords. You cannot insert data through a view if the view includes ______. d. UPDATE of all columns SELECT. departments d WHERE e. e.

The CUSTOMER_FINANCE table contains these columns: Mark for Review (1) Points CUSTOMER_ID NUMBER(9) NEW_BALANCE NUMBER(7. You want Sales employees to be able Mark for Review to update the SALESREP table through the view. Mark for Review (1) Points The WITH CHECK OPTION clause A subquery in the FROM clause The DISTINCT keyword (*) A WHERE clause Correct Section 15 Quiz (Answer all questions in this section) 11. What should not be specified in your CREATE VIEW statement? A WHERE clause The AS keyword A GROUP BY clause (*) The IN keyword Correct 12. Which SELECT statement clause is included in your query? Inner query: SELECT customer_id.2) PREV_BALANCE NUMBER(7. You cannot modify data in a view if the view contains ______. WITH READ ONLY (*) FORCE NOFORCE WITH ADMIN OPTION Correct 10. You plan to grant access to this view to members of the Sales department.2) FINANCE_CHARGE NUMBER(7. new_balance ROWNUM Inner query: WHERE ROWNUM = 800 Inner query: ORDER BY new_balance DESC (*) .2) CREDIT_LIMIT NUMBER(7) You created a Top-n query report that displays the account numbers and new balance of the 800 accounts that have the highest new balance value. which you plan to name (1) Points SALESREP_VIEW. The results are sorted by payments value from highest to lowest. You want to create a view based on the SALESREP table.2) PAYMENTS NUMBER(7.

DROP VIEW emp_hist_v. Evaluate this CREATE VIEW statement: Mark for Review (1) Points CREATE VIEW sales_view AS SELECT customer_id. customer_id. (*) DROP emp_hist_v. An inline view is an unnamed select statement found: Mark for Review (1) Points Enclosed in parentheses within the select list of a surrounding query. The EMP_HIST_V view is no longer needed. (*) You can modify data in the SALES table using the SALES_VIEW view. Which statement is true? You can only insert records into the SALES table using the SALES_VIEW view. Outer query: ORDER BY new_balance DESC Correct 13. SUM(sales_amount) FROM sales WHERE region IN (10. Correct 14. Correct 15. (*) In a special database column of a users table. Which statement should you use to the remove this view? Mark for Review (1) Points REMOVE emp_hist_v. You cannot modify data in the SALES table using the SALES_VIEW view. DELETE emp_hist_v. The CREATE VIEW statement generates an error. In the user_views data dictionary view. 20. Correct . Enclosed in parentheses within the FROM clause of a surrounding query. 30. 40) GROUP BY region. region.