O'Reilly logo

Practical SQL Handbook, The: Using SQL Variants, Fourth Edition by Sandra L. Emerson, Marcy Darnovsky, Judith S. Bowman

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

Advantages of Views

To clarify the advantages of using views, consider several possible users of the bookbiz database. Let's say that the promotion manager needs to know which authors are connected to which books and who has first, second, and third billing on the cover. Prices, sales, advances, royalties, and personal addresses are not of interest, but the promotion manager does need some information from each of the three tables: titles, authors, and titleauthors. Without a view, a query something like the following might be used:

SQL
select titles.title_id, au_ord, au_lname, au_fname
from authors, titles, titleauthors
where authors.au_id = titleauthors.au_id and
     titles.title_id = titleauthors.title_id

This query involves a lot of typing, ...

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