Multiple choice technology databases

Which two statements about views are true? (Choose two)

  1. A view can be created as read only

  2. A view can be created as a join on two or more tables.

  3. A view cannot have an ORDER BY clause in the SELECT statement

  4. A view cannot be created with a GROUP BY clause in the SELECT statement

  5. A view must have aliases defined for the column names in the SELECT statement

Reveal answer Fill a bubble to check yourself
A,B Correct answer
Explanation

Explanation: To answer this question, we need to understand the concept of views in the context of databases.

A. A view can be created as read-only - This statement is true. A view can be created with the SELECT statement that restricts the columns and rows that are returned. This can be used to ensure a user only has read access to certain data.

B. A view can be created as a join on two or more tables - This statement is true. A view can be created as a SELECT statement that combines data from two or more tables. This can be used to simplify queries by combining data that is frequently used together.

C. A view cannot have an ORDER BY clause in the SELECT statement - This statement is false. A view can have an ORDER BY clause in the SELECT statement to sort the data returned by the view.

D. A view cannot be created with a GROUP BY clause in the SELECT statement - This statement is false. A view can be created with a GROUP BY clause in the SELECT statement to group the data returned by the view.

E. A view must have aliases defined for the column names in the SELECT statement - This statement is false. A view does not require aliases for the column names in the SELECT statement, although it can be useful to provide more meaningful names for the columns.

Therefore, options A and B are both true statements, making the correct answer B.