©  Rahul Batra 2018
Rahul BatraSQL Primerhttps://doi.org/10.1007/978-1-4842-3576-8_14

14. Views

Rahul Batra1 
(1)
Gurgaon, Haryana, India
 

One of the beautiful aspects of the relational data model and SQL is that the output of a query is also a table, a relation to be precise. It may consist of a single column or a single row, but it is a table nonetheless. A view is a query that can be used like a table.

Think of it as a virtual table that stores for the viewer’s convenience a pre-computed resultset. It does not truly exist like a base table but provides a different angle to view the data without the tedium of details.

Why Are Views Needed?

Most production database systems would contain a lot of tables. It is also possible that some of these tables ...

Get SQL Primer: An Accelerated Introduction to SQL Basics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.