Introduction


This chapter takes an in-depth look at views. Views were introduced in Chapter 3, "Physical Database Design," as a component that makes up part of the physical design of the database. Chapter 3 only introduced views as one of the many components that can make up a database, and this chapter follows up on the topics that were introduced there and expands on them.

Before beginning this chapter, you should have a good understanding of Chapter 4, "Querying and Modifying Data," which deals with data retrieval and the SELECT statement. Views are based on the SELECT statement, but have some restrictions, which are also covered in this chapter.

In simple terms, a view is a predefined SELECT statement that creates a dynamic virtual table. Although not a real table, a view can be used for many tasks for which an actual table can be used and is often referenced in the same way as a table. You will see a view based on the SELECT statement when the CREATE VIEW statement is covered.

Views can be used to define numerous combinations of rows and columns from one or more tables. When views use only a few of the columns in a table, then the table data is referred to as being vertically filtered ; and when views use only a portion of the rows in a table, then the table data is referred to as being horizontally filtered . The capability to filter data is a great advantage of using views. For example, if you need only a subset of data from a table, then a view prevents users from accidentally (or intentionally) seeing too much data, because the most that can be seen is what is contained in the view. The next few sections describe how to design and create views in SQL Server 2000.

Views can also be used with horizontally or vertically partitioned data through a partitioned view. This is where data that could have been put into one table is split into several tables to improve performance. A view can then be used to join all this data together. If the data is on different servers, then you are working with a distributed partitioned view .

NOTE

Server Federation With horizontal and vertical partitioning of data across several servers, the servers that are working together to provide the data are referred to as a federation of servers .




MCSE Training Guide (70-229). Designing and Implementing Databases with MicrosoftR SQL ServerT 2000 Enterprise Edition
MCSE Training Guide (70-229). Designing and Implementing Databases with MicrosoftR SQL ServerT 2000 Enterprise Edition
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 228

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net