Home > Articles > Data > SQL

  • Print
  • + Share This
This chapter is from the book

Summary

This chapter covered views that allow you to control just how your users see data:

  • The familiar CREATE and DROP keywords allow you to set up and remove views. You retrieve data through views with the SELECT statement, treating the view as a kind of table. However, the view does not contain any data: It is simply a way of looking at table data.

  • Views allow you to provide focus, simplification, and customization of tables. They also offer a security mechanism (they restrict users from seeing tables but provide access to views based on the tables). In addition, views keep the data independent of the database structure.

  • System catalogs hold the view definition. When you query the view, SQL runs the query that created the view. Because of this, you need to make sure any derived or computed columns have names in the view and look out for broken view chains (views based on wounded tables or views).

  • Data modification through views is a sticky issue. Because views are often summary data, there may be no way to change data through them. It is important to understand the limitations of your system.

Views out of the way, the chapter moved on to ways of creating copies of data.

The next chapter is a roundup of some remaining database management issues: security, transactions, performance, and integrity.

  • + Share This
  • 🔖 Save To Your Account