SQL Views MCQ Questions & Answers

Views MCQs : This section focuses on the "Views" in SQL. These Multiple Choice Questions (MCQ) should be practiced to improve the SQL skills required for various interviews (campus interview, walk-in interview, company interview), placements and other competitive examinations.

1. Views can be created for?

A. One table
B. Many table
C. another view
D. All of the above

View Answer


2. A view is actually a?

A. composition of a table
B. decomposition of a table
C. associated to a table
D. None of the above

View Answer


3. A view can contain all rows of a table?

A. TRUE
B. FALSE
C. Not all rows but all columns
D. Can't say

View Answer


4. What is true about view?

A. Database views are created using the CREATE VIEW statement.
B. To create a view, a user must have the appropriate system privilege according to the specific implementation.
C. Both A and B are true
D. Both A and B are false

View Answer


5. Which option in view is to ensure that all UPDATE and INSERTs satisfy the condition(s) in the view definition?

A. Uncheck
B. With Check
C. Check
D. With

View Answer


6. What is true statement while Updating a View?

A. The SELECT clause may not contain the keyword DISTINCT.
B. The SELECT clause may not contain summary functions.
C. The SELECT clause may not contain set functions.
D. All of the above

View Answer


7. Can we insert and delete rows into a View?

A. Yes
B. No
C. Rows of data can be inserted but can not deleted
D. Rows of data can be deleted but cacn not inserted

View Answer


8. What is syntax for delete the view?

A. DELETE VIEW view_name;
B. DROP VIEW view_name/table_name;
C. DROP VIEW view_name;
D. DROP VIEW table_name;

View Answer


9. Rules of UPDATE command and INSERT command are same as?

A. Inserting Rows into a View
B. Deleting Rows into a View
C. Both A and B
D. None of the above

View Answer


10. All NOT NULL columns from the base table must be included in the view in order for the INSERT query to function.

A. TRUE
B. FALSE
C. All NULL columns from the base table must be included in the view in order for the INSERT query to function.
D. None of the above

View Answer


11. Find the error in this query.

A. View …as
B. Scholar
C. Select
D. None of the above

View Answer


12. For the view Create view student_info as : If we insert tuple into the view as insert into instructor info values (’69987’, ’White’, ’CS’); What will be the values of the other attributes in instructor and department relations?

A. Default value
B. Null
C. Error
D. 0

View Answer


13. Which of the following is the syntax for views where v is view name?

A. Create view v as "query name";
B. Create "query expression" as view;
C. Create view v as "query expression";
D. Create view "query expression";

View Answer


14. Which of the following creates a virtual relation for storing the query?

A. Function
B. View
C. Procedure
D. All of the above

View Answer


15. Here the tuples are selected from the view.Which one denotes the view.

A. Course_id
B. Building
C. Watson
D. physics_fall_2009

View Answer


16. Which of the following is false?

A. We can update a view if it has multiple database relations in the from clause
B. One view can be used in the expression defining another view
C. Both A and B
D. None of the above

View Answer


17. The process of maintaining views up to date is called?

A. View materialization
B. View isolation
C. View updating
D. View maintenance

View Answer


18. _______ views help to keep the database up-to-date.

A. View materialization
B. View isolation
C. View updating
D. View maintenance

View Answer


19. You can perform ______ operation(s) on SQL Views?

A. Filter
B. Sort
C. Join
D. All of the above

View Answer


20. In Oracle SQL no insert, update, or delete modifications on views are allowed that use one of the following constructs in the view definition:

A. Joins
B. Aggregate function such as sum, min, max etc.
C. group by clause or distinct clause
D. All of the above

View Answer





Discussion


* You must be logged in to add comment.