O'Reilly logo

OCA Oracle Database 11g: SQL Fundamentals I: A Real-World Certification Guide by Steve Ries

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with views

Although we began our study of SQL by using some very simple queries, at this point we have definitely graduated to some fairly complex ones. Multi-table joins, subqueries, and nested functions can all play a part in the need for long and complicated SQL code. Often, this code is created to be reused numerous times for business needs such as reporting. A view allows us to store a query as a database object so that it is simplified and reusable.

Creating a view

Since views are objects that store queries, we should look at an example of the type of SELECT statement that can be stored as a view. The following example contains a SQL statement we used in Chapter 5, Combining Data from Multiple Tables to create a reasonably complex ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required