Database Basics

Which correctly describes a database view in a relational database?

  1. AA virtual table defined by a SELECT statement; it normally holds no data of its own and builds its result from the underlying tables each time it is referenced
  2. BA table that stores a copy of the underlying table's data; changing the underlying table does not change the view's contents
  3. CA tree-structured piece of data created to find values in a particular column of a table quickly
Show answer and explanation

Answer: A. A virtual table defined by a SELECT statement; it normally holds no data of its own and builds its result from the underlying tables each time it is referenced

A database view is a virtual table defined by giving a name to a SELECT statement, as in CREATE VIEW sales_staff AS SELECT emp_no, name FROM employee WHERE dept = 'Sales'. An ordinary view holds no data of its own; its result is built from the underlying (base) tables each time the view is referenced, so updates to the base tables are reflected in the view as they are. Views are used to make frequently used complex queries simple to write, and to limit what users can access by granting them privileges only on a view that shows the permitted columns and rows. There are also materialized views, which compute and store the result in advance; they make reads faster but must be refreshed to follow the base tables. A tree structure for finding values quickly describes an index.

  • A. Correct. A view is a virtual table defined by a SELECT statement, and changes to the base tables are reflected as they are.
  • B. An ordinary view does not copy data, so changes to the base tables are reflected. Even materialized views, which store results, are refreshed to follow the base tables.
  • C. This describes an index.
Practice this topic Back to topic

Related calculators

Books on Database Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Database Basics questions

  1. What is the main purpose of normalization of tables in a relational database?
  2. The primary key of an order table (order_no, item_no, qty, cust_no, cust_name) is {order_no, item_no}, and its functional dependencies are {order_no, item_no} → qty, order_no → cust_no and cust_no → cust_name. Which is the correct result of normalizing this table up to third normal form (3NF)?
  3. The primary key of an employee table (emp_no, name, dept_code, dept_name) is emp_no, and every column holds a single value. The functional dependencies are emp_no → name, emp_no → dept_code and dept_code → dept_name. Which correctly states the normal form of this table?
  4. In a database used mainly for reading and aggregation, normalized tables are sometimes deliberately merged into one so that the same data is held in duplicate (denormalization). Which correctly pairs an advantage and a disadvantage of this design?
  5. In an E-R diagram, there is a many-to-many relationship between students and courses: one student takes several courses, and one course is taken by several students. Which is an appropriate way to implement this relationship with relational database tables?