MySQL Views MCQs with answers Page - 4

You will find multiple-choice questions (MCQs) related to #MySQL Views here. Go through these questions to prepare effectively for your upcoming exams and interviews.

To view the correct answer for any question, simply click the "Show Answer" button.

Have a question to share? Click on "Add Question" to contribute!

A

Admin • 828.03K Points
Coach

Q. Can a view contain aggregate functions like COUNT() or SUM()?

  • (A) Yes
  • (B) No
  • (C) Only in subqueries
  • (D) Only if indexes exist

A

Admin • 828.03K Points
Coach

Q. What type of object is a view in MySQL?

  • (A) Virtual table
  • (B) Physical table
  • (C) Temporary table
  • (D) Stored procedure

A

Admin • 828.03K Points
Coach

Q. Which clause ensures that only unique rows appear in a view?

  • (A) DISTINCT
  • (B) UNIQUE
  • (C) ONLY
  • (D) PRIMARY

A

Admin • 828.03K Points
Coach

Q. Can you create an index directly on a view in MySQL?

  • (A) Yes, always
  • (B) No, views do not support indexes
  • (C) Yes, only clustered indexes
  • (D) Yes, but only on materialized views

A

Admin • 828.03K Points
Coach

Q. Which keyword is used to display the definition of a view?

  • (A) SHOW VIEW view_name
  • (B) SHOW CREATE VIEW view_name
  • (C) DESCRIBE view_name
  • (D) SELECT VIEW view_name

A

Admin • 828.03K Points
Coach

Q. What happens if you use 'DROP VIEW IF EXISTS view_name'?

  • (A) It throws an error if the view doesn’t exist
  • (B) It silently drops the view only if it exists
  • (C) It drops the table and view together
  • (D) It replaces the view definition

A

Admin • 828.03K Points
Coach

Q. Can a view be used to enforce security by restricting access to certain columns?

  • (A) Yes
  • (B) No
  • (C) Only if indexes exist
  • (D) Only in subqueries

A

Admin • 828.03K Points
Coach

Q. What is the main advantage of using views?

  • (A) They store data permanently
  • (B) They simplify complex queries and improve security
  • (C) They always improve performance
  • (D) They automatically index columns

A

Admin • 828.03K Points
Coach

Q. Can you join multiple tables inside a view?

  • (A) Yes
  • (B) No
  • (C) Only two tables
  • (D) Only if they share the same primary key

A

Admin • 828.03K Points
Coach

Q. If a base table is updated, what happens to the view?

  • (A) The view automatically reflects the changes
  • (B) The view must be refreshed manually
  • (C) The view becomes invalid
  • (D) The view is dropped automatically
What's Tag

As you may know, questions are organized under broad categories. Each category can include various types of questions. For example, the "History" category might contain questions about the Revolt of 1857, Shivaji Maharaj, Ancient History, Buddhism, and more.

To further refine this organization, we've introduced tags, which act as sub-categories to group questions more specifically.

Verified users can add tags to any question. If you have any suggestions regarding this system, we'd love to hear from you. Contact Us

Learn More