Which SQL statement would you use to create a new view called 'TopSellers' based on products sold by a specific salesperson?

Prepare for the WGU ITEC2104 C175 Data Management Test with comprehensive questions and detailed explanations. Discover essential concepts with flashcards and multiple-choice questions. Boost your confidence and ace your exam!

The correct choice involves using the CREATE VIEW statement, which is a standard SQL command for defining a new view. A view is essentially a virtual table that you can query just like a regular table but is based on the result set of a specific SQL query.

In this scenario, the intention is to create a new view called 'TopSellers' that would presumably include data about products sold by a specific salesperson. The first statement, which selects all columns from the Sales table, serves as the foundational query for this view. This option sets up the view to contain all the records corresponding to the products sold, allowing users to later query this view specifically when they are interested in that information.

The other provided options do not appropriately create a view. Notably, simply stating "FROM Products" in the second option does not specify a SQL command that would define a view. The third option, "DROP VIEW TopSellers," is meant for removing an existing view, not creating one. Lastly, "INSERT VIEW TopSellers" does not conform to SQL syntax and does not fulfill the requirements of creating a new view. Thus, the option that correctly accomplishes the task of creating a new view is the first choice, which appropriately employs the CREATE VIEW syntax

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy