3.3k views
5 votes
Which of the following is the valid syntax for creating a view to view a subset of a table?

a) CREATE VIEW subset_view AS SELECT * FROM original_table WHERE condition;
b) CREATE VIEW original_table AS SELECT * FROM subset_view WHERE condition;
c) CREATE VIEW subset_view FROM original_table WHERE condition;
d) CREATE VIEW original_table WHERE subset_view = condition;

User Kravietz
by
7.0k points

1 Answer

6 votes

Final answer:

The valid syntax for creating a view to view a subset of a table is option a) CREATE VIEW subset_view AS SELECT * FROM original_table WHERE condition;.

Step-by-step explanation:

The valid syntax for creating a view to view a subset of a table is option a) CREATE VIEW subset_view AS SELECT * FROM original_table WHERE condition;

This syntax creates a new view called subset_view that consists of all rows from the original table, original_table, that satisfy the given condition. The view will display all columns (indicated by *) from the original table.

User Kscottz
by
7.4k points