December 2005
Intermediate to advanced
336 pages
4h 52m
English
In this chapter 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 chapters.
Requires MySQL 5. Support for views was added to MySQL 5. As such, this chapter is applicable to MySQL 5 or later only.
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 Chapter 15, “Joining Tables,” you used the following SELECT statement to retrieve data from three tables:
• Input
SELECT cust_name, cust_contact FROM customers, orders, orderitems WHERE customers.cust_id ...
Read now
Unlock full access