Lesson 21. Using Views

In this lesson, you’ll learn exactly what views are, how they work, and when they should be used. You’ll also see how views can be used to simplify some of the SQL operations performed in earlier lessons.

Understanding Views

Views are virtual tables. Unlike tables that contain data, views simply contain queries that dynamically retrieve data when used.

The best way to understand views is to look at an example. Back in Lesson 15, “Joining Tables,” you used the following SELECT statement to retrieve data from three tables:

Input

SELECT cust_name, cust_contactFROM customers, orders, orderitemsWHERE customers.cust_id = orders.cust_id  AND orderitems.order_num = orders.order_num  AND prod_id ...

Get Oracle PL/SQL in 10 Minutes, Sams Teach Yourself now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.