1D0-541 practice question 3 of 25

To create a view, what are the minimal privileges that a user must have for the relations used to make the view?

Full set: 128 questions
Answer options
A: GRANT
B: REVOKE
C: SELECT Correct answer
D: CREATE VIEW
Correct Answer:
C. SELECT
Explanation

A view is essentially a stored SELECT query that acts as a virtual table. To define and create this view, the database user must have the necessary permissions to execute the underlying query. The minimal privilege required to read data from the source tables (relations) is the SELECT privilege. Without SELECT permission on all tables and columns referenced in the view's definition, the database system will reject the CREATE VIEW statement.

Why Incorrect

A. GRANT: This is a SQL command used to give privileges to a user; it is not a privilege itself that is required on a relation.
B. REVOKE: This is a SQL command used to remove privileges from a user; it is not a privilege required to perform an action.
D. CREATE VIEW: This is a system-level privilege that allows a user to create a view object within a schema, but it is not the privilege required on the source relations themselves.

References

1. Oracle Database SQL Language Reference, 21c: In the documentation for the CREATE VIEW statement, under "Prerequisites," it states: "The owner of the view must have been granted the SELECT, INSERT, UPDATE, or DELETE object privileges on all the tables or views on which the view is based... To create a view, you must have at least the SELECT privilege on each base table."

Source: Oracle Database Documentation, "CREATE VIEW Statement," Prerequisites section.

2. PostgreSQL 15 Documentation: The documentation specifies the privileges needed for view creation: "To create a view, you must have... SELECT privilege on all tables or views referenced in its query."

Source: PostgreSQL Documentation, Chapter 5. Data Definition, Section 5.9. Views.

3. Silberschatz, A., Korth, H. F., & Sudarshan, S. (2020). Database System Concepts (7th ed.). McGraw-Hill. In the chapter on SQL Authorization, the text explains that the creator of a view must have the necessary privileges on the underlying relations to define the view. For a standard view that reads data, this is the SELECT privilege.

Source: Chapter 4, Section 4.1.2 "Privileges in SQL".

4. Ramakrishnan, R., & Gehrke, J. (2003). Database Management Systems (3rd ed.). McGraw-Hill. This academic textbook clarifies the authorization requirements for views: "The creator of a view must have the SELECT privilege on all the tables that are referenced in the view definition."

Source: Chapter 5, Section 5.7.1 "Access Control for Views".

Scroll to Top