Administering Database Views

Database views are database objects just as tables, synonyms, or sequences are database objects. The CREATE VIEW command is used to add the views to the database. The following is a syntax template of the command:

				Create [or replace] [force|noforce]
				view
				viewname
				as
				select statement
				[with check option [constraint
				constraint]]
				[with read only];
			

Listing 10.1 illustrates the creation and use of a database view. The view is typical of one that might be used to mask the complexity of the query. The query has the following features:

  • The Last_name and First_name columns were concatenated into one expression with a column alias of Name.

  • Two runtime values are created. The query computes and formats the employees’ ages and ...

Get Oracle SQL and PL/SQL Handbook: A Guide for Data Administrators, Developers, and Business Analysts now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.