Book Image

Oracle Database XE 11gR2 Jump Start Guide

By : Asif Momen
Book Image

Oracle Database XE 11gR2 Jump Start Guide

By: Asif Momen

Overview of this book

Oracle Database XE 11gR2 is an excellent beginner-level database and is a great platform to learn database concepts. "Oracle Database XE 11gR2 Jump Start Guide" helps you to install, administer, maintain, tune, back up and upgrade your Oracle Database Express Edition. The book also helps you to build custom database applications using Oracle Application Express.Using this book, you will be able to install Oracle Database XE on Windows/Linux operating system.This book helps you understand different database editions and it guides you through the installation procedure with the aid of screenshots. You will learn to interact with the database objects. You will gain a solid understanding of stored sub-programs which is followed by an introduction to Oracle Application Express (APEX). Solid database performance tuning strategies are also discussed in this book followed by backup and recovery scenarios. All in all, "Oracle Database XE 11gR2 Jump Start Guide" delivers everything that you should know to get started with Oracle Database administration.
Table of Contents (20 chapters)
Oracle Database XE 11gR2 Jump Start Guide
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface

Creating and managing views


A view is a stored query. You write a SQL query and save it in the database as a view. A view can reference a single table/view, or multiple tables/views.

The following is an example of the CREATE VIEW statement:

-- Create a new view
CREATE [OR REPLACE] VIEW salary_gr_1000 AS
select emp_no, emp_name, salary
FROM emp
WHERE salary > 1000;

In the preceding statement, we created a salary_gr_1000 view, which fetches data from the emp table for all employees whose salary is greater than 1000. We can use the OR REPLACE clause to change the query in the view.

We will use the ALTER VIEW statement to compile and modify/drop constraints. The following is an example:

-- Compiling view
ALTER VIEW salary_gr_1000 COMPILE;

To change the query of a view, we use the CREATE or REPLACE VIEW statement.

Removing a view from the database is achieved using the DROP VIEW statement, as shown in the following code snippet:

-- Permanently remove the view from the schema
DROP VIEW salary_gr_1000...