What SQL command combination should a DBA use to create a view from two tables without allowing modifications?

Prepare for the CompTIA DataSys+ Exam with engaging content including flashcards and multiple choice questions, each offering hints and explanations to help you ace your exam!

Multiple Choice

What SQL command combination should a DBA use to create a view from two tables without allowing modifications?

The correct choice involves using the CREATE VIEW and SELECT commands to establish a view from two tables while ensuring that modifications to the data are not permitted.

Creating a view provides a way to encapsulate a SELECT query that can pull data from multiple tables, often using JOIN operations to combine relevant data into a unified dataset. By default, a view is a read-only representation of the data it references, meaning that any attempt to modify records via the view is generally disallowed to maintain data integrity and security.

When a DBA creates a view using a SELECT statement, they can specify exactly how the data from the two tables should be combined and displayed. This allows for creating complex queries that expose only the necessary data without allowing direct changes to the underlying tables.

The other options do not align with the requirement of creating a non-modifiable view from two tables. For example, using CREATE TABLE and INSERT would lead to the creation of a new table that is separate from the original data sources, and it wouldn't fulfill the requirement of creating a view. Similarly, ALTER VIEW and DROP pertain to modifying or removing existing views, not creating a new one. Therefore, the choice of CREATE VIEW and SELECT is the most appropriate for this scenario.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy