View

term_id: view

Category: basic_concepts

Definition

In database management, a view acts as a saved SQL query that behaves like a table but contains no data itself. It provides a simplified or customized perspective of underlying data, enhancing security by restricting access to specific columns. Views simplify complex joins and aggregations for users, allowing them to interact with structured data representations without needing to understand the base schema’s complexity.

Summary

A virtual table in a database resulting from a stored query, presenting data from one or more tables without storing it physically.

Key Concepts

  • Virtual Table
  • SQL Query
  • Data Abstraction
  • Security

Use Cases

  • Creating simplified reports for non-technical users
  • Restricting access to sensitive columns in a table
  • Standardizing complex join logic across applications

Code Example

1
CREATE VIEW ActiveUsers AS SELECT id, name FROM users WHERE status = 'active';