ALERT

[FREE DEMO] Deploy Your Enterprise Cloud in Minutes

View

Definition - What does View mean?

A view is a subset of a database that is generated from a query and stored as a permanent object. Although the definition of a view is permanent, the data contained therein is dynamic depending on the point in time at which the view is accessed.

Views represent a subset of the data contained in a table. They can join and simplify multiple tables into one virtual table. They take up very little storage space because the database contains only the view definition, not the data. Furthermore, they can provide results for different calculations (like sum and average) along with the stored data, and can limit the degree to which tables are exposed to the outer world.

Techopedia explains View

A view is simply a structured query language (SQL) query stored as an object. For instance, the CUSTOMER_MASTER and ACCOUNTS_MASTER tables in the relational database of a commercial bank are frequently queried for customers and their account numbers. The following SQL query returns first name, surname, account number(s) and account types of customers:

SELECT c.first_name, c.surname, a.account_number, a.account_type
FROM customer_master c, accounts_master a
WHERE c.customer_id=a.customer_id
ORDER BY c.surname, a.account_number

Every time this query is run, it has to be parsed and loaded into the SQL optimizer, consuming valuable time and resources. If the query is saved as a view, then these overhead activities will only be performed once at the time the view is created. A sample SQL script to create a view is given below:

CREATE VIEW customer_accounts AS
(
SELECT c.first_name, c.surname, a.account_number, a.account_type
FROM customer_master c, accounts_master a
WHERE c.customer_id=a.customer_id
ORDER BY c.surname, a.account_number
)

Views can be used in queries just as in normal tables by selecting specific columns, restricting the results using a WHERE clause, and so on. Some relational database engines even allow the data to be updated directly through the view.

This definition was written in the context of Databases

Techopedia Deals

Connect with us

Techopedia on Linkedin
Techopedia on Linkedin
Tweat cdn.techopedia.com
"Techopedia" on Twitter


'@Techopedia'
Sign up for Techopedia's Free Newsletter!

Email Newsletter

Join thousands of others with our weekly newsletter

Resources
The 4th Era of IT Infrastructure: Superconverged Systems
The 4th Era of IT Infrastructure: Superconverged Systems:
Learn the benefits and limitations of the 3 generations of IT infrastructure – siloed, converged and hyperconverged – and discover how the 4th...
Approaches and Benefits of Network Virtualization
Approaches and Benefits of Network Virtualization:
Businesses today aspire to achieve a software-defined datacenter (SDDC) to enhance business agility and reduce operational complexity. However, the...
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.