+1 vote
in Sql by

Why do I need views in a database?

1 Answer

0 votes
by
There are a number of scenarios where we have to look for a view as a solution.

• To hide the complexity of the underlying database schema, or customize the data and schema for a set of users.

• To control access to rows and columns of data.

• To aggregate data for performance.

Views are used for security purposes because they provide encapsulation of the name of the table. Data is in the virtual table, not stored permanently. Views display only selected data.

Syntax of a View:

CREATE VIEW view_name AS

SELECT column_name(s) FROM table_name WHERE condition

There are two types of views.

• Simple View

• Complex View

Related questions

+1 vote
asked Jun 13, 2023 in Sql by rahuljain1
+1 vote
asked May 2, 2021 in JAVA by sharadyadav1986
...