250+ TOP MCQs on Using Views and Answers

MySQL Database Multiple Choice Questions on “Using Views”.

1. Which of these is also known as a virtual table?
a) SCHEMA
b) DATABASE
c) JOIN
d) VIEW

Answer: d
Clarification: In MySQL, a ‘View’ is also called a virtual table. It does not contain any data but only appears as a table. It is an alternative way to show or describe a table similar to the original table.

2. A View can be used to select a subset of the table columns.
a) True
b) False

Answer: a
Clarification: In MySQL, a ‘View’ is used to present a table in the database. It is a virtual table. It is also used to present a subset of the columns that are present in the original table of the database.

3. What is xyz in the following MySQL statement?

CREATE VIEW xyz AS SELECT a, b FROM t;

a) table
b) column
c) view
d) database

Answer: c
Clarification: A ‘View’ is created in MySQL by writing the clause ‘CREATE VIEW’ followed by the view name. Then follows the list of column names of the table that are to be presented as the view.

4. What is abc in the following MySQL statement?

CREATE VIEW xyz (abc) AS SELECT a FROM t;

a) row name
b) column name
c) view
d) database

Answer: b
Clarification: Column names for a view can be explicitly provided in the ‘CREATE VIEW’ clause itself. It presents the table view with the aliased column names instead of the original column names.

5. A view can refer to multiple tables via __________
a) UNION
b) JOIN
c) GROUP
d) SELECT

  250+ TOP MCQs on The from Clauses and Answers

Answer: b
Clarification: In MySQL, a ‘View’ can refer to multiple tables. This makes it a lot simpler to execute the queries involving joins. When a selection is made from the view, the join is executed producing the results.

6. Views are not updatable.
a) True
b) False

Answer: b
Clarification: In MySQL, some ‘Views’ are updatable. The operators ‘INSERT’, ‘DELETE’ and ‘UPDATE’ can be used. They can be operated on the ‘Views’ to make changes to it. A table can be created and set as a view.

7. A view can be deleted using the command __________
a) REMOVE
b) DELETE
c) CLEAR
d) DROP

Answer: d
Clarification: In MySQL, ‘Views’ act as virtual tables. Many operations can be performed on views like the operations on tables. A view can be created, displayed and dropped. They can also be used to perform calculations.

8. What cannot be done on a view?
a) display
b) filter
c) index
d) drop

Answer: c
Clarification: In MySQL, ‘Views’ act as virtual tables. It is not possible to create indexes on a view. However, they can be used for the views that are processed using the merge algorithm.

9. What can be used to check for views that have been invalidated by DROP or ALTER operations?
a) CREATE TABLE
b) VERIFY TABLE
c) DETAILS TABLE
d) CHECK TABLE

Answer: d
Clarification: A ‘View’ is created in MySQL by writing the clause ‘CREATE VIEW’ followed by the view name. Once a view is dropped or altered after being created, it can be checked by the ‘CHECK TABLE’ clause.

10. Which of the following does not support a materialized view?
a) MySQL
b) Oracle
c) PostgreSQL
d) SybaseSQL

  250+ TOP MCQs on Access Control and Security and Answers

Answer: a
Clarification: In MySQL, ‘Views’ are treated a little differently than Oracle, PostgreSQL and SybaseSQL since they support materialized views and MySQL does not use the materialized view.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top