Database Reference
In-Depth Information
Index is another database object used to improve database performance. Like an index at the
end of a topic, indexes are created on tables or views to improve data search performance. Besides
improving search performance, indexes are also used for sorting rows in a table and enforcing
uniqueness.
When multiple database applications try to access the same database object, the performance
can be signiicantly reduced. A solution to the overload problem is to divide a database object
into multiple parts and distribute the parts to multiple server nodes. Based on the needs of the
front-end users, their requests can be sent to diferent servers. Federation is the technology used
to balance workload. With the federation, it is possible to expand and shrink database objects
according to needs.
In this chapter, we will discuss all the three units. Some hands-on activities on these units will
also be given in this chapter. We begin with views.
8.2 Views
After a database is populated with data, the next step is to get ready to support database applica-
tions. A view is a database object that collects data from various data sources for a database applica-
tion such as a form used by front-end users. To support database applications, you can irst create
views and then bind the views to the applications. he use of views simpliies the way a database
application interacts with a database. A view can be created by selecting data from one or multiple
data sources, such as tables from one or more databases, other views, calculated values, or even
data from spreadsheets. You may consider a view as a virtual table. It looks like a single table and
can be used as a single table. An SQL statement that selects data from a view is just like an SQL
statement that selects data from a table. he advantages of using views are summarized below:
Views are more secure. Views limit the database management activities such as inserting,
deleting, and updating tables directly by front-end users. A view only provides data that are
necessary for an application.
Views improve the performance. Data stored in a view are ready for an application to use. here
is no need for the application to search various data sources to obtain the data. Usually, tables
are not used to store calculated values, which may hold back performance. A view can have all
the columns needed for calculation and a calculated column that stores calculation results.
Views simplify data manipulation tasks. When a table name is changed, one can redeine
the view to use the new table name; there is no need to modify the code in every database
application that is tied to the view.
Owing to these advantages, views are widely used with database applications. Next, you will
learn how to create and manage the views.
8.2.1 Create Views
Like creating other database objects, you can use the CREATE VIEW statement to create a view.
he syntax for creating a view is given below:
CREATE VIEW [ db_name .] [ owner .] view_name [( column [,... n ])]
[WITH < view_attribute > [,...n]]
Search WWH ::




Custom Search