Technofunction

All About View in Oracle SQL Database

What is a View in Oracle SQL Database?

A view is a logical table based on table or another view which is used to present the combinations of data present in the database. A view as itself doesn’t contain any data but it is more like a window through which the data from the tables can be viewed or changed. The table on which view is based is known as the base table and view is stored as a select statement in the data dictionary.

Advantages of Creating a View:-

  • It restricts the data access to predefined tables and columns so that a database user can see only information relevant for him.
  • It makes the complex queries easy.
  • Provides the data independence.
  • Can be used to present the different views of the same data.

There are majorly two types of views:-

1.    Simple Views

2.    Complex Views

The major difference b/w the two lies in the DML operations.

(more…)

Introduction to SQL and SQL vs SQL *PLUS

Structured Query Language(SQL) is a language that provides an interface to relational database systems. SQL was developed by IBM for use in system R, and is a standard. It is both ISO and ANSI standard.

Basically SQL is composed of different languages which are as follows:-

Components of SQL

1. DDL (DATA DEFINITION LANGUAGE):-

  • CREATE: – to create the objects in the database.
  • ALTER: – Alters the structure of the database.
  • TRUNCATE: – Remove all records from a table, including all the spaces allocated for the records are removed.
  • COMMENT: – Add comment to the data dictionary.
  • GRANT: – Gives user’s the access privilege to the databases.
  • REVOKE: – Withdraw the access privileges given with the GRANT command.

2. DML (DATA MANIPULATION LANGUAGE)

  • INSERT:- Insert the data into a table
  • UPDATE:- Updates the existing data within a table
  • DELETE: – Deletes all records from a table, the space from the records remain.
  • CALL: – call a PL/SQL or Java subprogram.
  • EXPLAIN PLAN: - Explain the access path to data.
  • LOCK: – Table control concurrency.

(more…)