Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

Database Management Systems Database Management Software Relational Databases Database Systems Edit Topics

What is view in DBMS?


Answer Follow · 3   

Promoted by Elefantos  

Looking for an easy and automated way to backup your MySQL?


Start your free trial for an easy to set up, super secure backup solution. Save time and avoid
data loss.

Learn More

5 ANSWERS

Lucky Verma, All Around Development Studyeer, NITian, LBSNAA dreamer


Answered Dec 3, 2016

Oracle Database Architecture

An Oracle database is a collection of data treated as a unit. The purpose of a database is


to store and retrieve related information. A database server is the key to solving the
problems of information management. In general, a server reliably manages a large
amount of data in a multiuser environment so that many users can concurrently
access the same data. All this is accomplished while delivering high performance. A
database server also prevents unauthorized access and provides efficient solutions for
failure recovery.

Oracle Database is the first database designed for enterprise grid computing, the most
flexible and cost effective way to manage information and applications. Enterprise
grid computing creates large pools of industry-standard, modular storage and servers.
With this architecture, each new system can be rapidly provisioned from the pool of
components. There is no need for peak workloads, because capacity can be easily
added or reallocated from the resource pools as needed.

The database has logical structures and physical structures. Because the physical and
logical structures are separate, the physical storage of data can be managed without
affecting the access to logical storage structures.

Oracle Components

I. Oracle DBMS

A. Oracle Display System (ODS) - activities in the system displayed on the system console.

B. Oracle Data Loader (ODL) - loads raw data into tables.

C. After Image Journaling (AIJ) - program for journaling each change to data in case of
need for recovery.

D. System Global Information (SGI) - shows shared memory set up.

E. IOR - program for start and stopping ORACLE system for the DBA. This contains the
setups and saves.

F. Export/Import - for use to restore of backup archival storage.

II. Pro*SQL - host language interface - group of subroutines which translates SQL statements
into machine code.

III. SQL*Plus - include SQL and SQL*Plus commands.

IV. Oracle Report Writer:

A. Report text formatter - similar to a word processor.

B. Report generator - procedural language that creates a report from the data base.

V. SQL*FORMS - interactive facility to create and edit forms (screens).

A. IAG - Interactive Applications Generator.

B. IAC - Interactive Applications Converter.

C. IAD - Interactive Applications Designer.

D. IAP - Intaeractive Applications Processor.

E. Crt Utility - for different types of displays.

VI. Audit- Trail - enables DBA to monitor activities in system for security or tuning
purposes.

VII. SORT/MERGE - to improve efficiency.


Compare Oracle 8i vs. 9i vs. 10g vs. 11g vs. 12c

It can be said without altering that Oracle database management systems are the most
widely used DBMSs in the world. Oracle is an object-relational DBMS, and it has the
capability to operate essentially on every computer type: PCs as well as Macs, minicomputers
and huge mainframes alike.

Oracle underwent redesign to fulfill the need brought by network computing as well as to
give the market a secure and reliable application data management system. It can
comfortably support small applications on departmental levels, and scale upwards to serve
high-volume online transaction systems and data warehouse applications with query-
intensity.

From its creation in the early 1980s, Oracle had undergone continuous improvement and
redefinition until the Oracle 8i, first released in 1997 to its most recent release, the Oracle 12c
released in June 2013. Below is a basic overview of the five generations of Oracle Databases
from 8i to 12c.

75 Easy Face Paintin

An in-depth discussion of all features would obviously require a different forum, a book most
precisely. Therefore, what we offer today will be a brief outline of the most significant
features that set each generation apart from its predecessors.

Oracle 8i

The database development and management environment from Oracle provides for
client/server DBMS, including a number of utilities useful in the development of database
systems:

● Oracle Navigator –useful in the creation of new tables within a visual environment

● Oracle Browser – useful in the creation of SQL queries as well as QBE (query by example
queries).

● Oracle Forms – these create/develop menus and/or graphical forms applicable to user
applications.

● Oracle Reports – generation of reports in printing and display of data

● SQL Plus – creation testing and debugging command-prompt SQL queries

● Oracle Graphics – generation of graphical representations and visual aids based on


information stored in the database.

● Enterprise Manager – management and tuning of the database


● Oracle Webserver – used to create a WWW site to enable users develop dynamic web pages
using Oracle databases.

Oracle 9i

The improvement in Oracle 9i aims at improved optimization of conventional business


applications, stimulations of the emergent hosted applications market and facilitation of vital
advancement capabilities required for internet-based business.

s regards availability, the Oracle 9i DB provides an extension of Internet Database Availability


in principal areas, including online data evolution, enhanced disaster recovery environments
and precision database repair. Enhanced data recovery environments have seen
implementation through the introduction of many features and enhancements, which can
condense into the four categories below:

● System fault recovery – within seconds failover on Real Application Clusters, Oracle
Application Clusters Guard among others.

● Disaster recovery – LogMiner, Data Guard with automation and monitoring, zero data loss
log transport, delayed mode etc.

● Planned downtime – online changes in schema, reorganization of indexes and tables,


comprehensive online index operation, dynamic parameters on databases etc.

● Human error safeguards – Flashback Query, comprehensive log analysis and presumable
space allocation etc.

It also implements new online architecture featuring the following:

● Changes on any physical table attributes

● Changes on many of the logical attributes as well

● Secondary indexes on IOTs may be created and/or rebuilt online

● Online creation and analysis of indexes

● Online repair for physical guesses proven invalid

Oracle 10g

There are several hundred feature differences between the 9i and 10g versions, but the following
offers and worth summary of the new features implemented on the Oracle 10g database version:

● SQL optimizer internals have been majorly altered

● Oracle grid computing


● RAC in Oracle 10g enhanced to enable dynamic scalability on server blades

● Oracle Enterprise Manager (OEM) in 10g completely redesigned

● The OEM performance pack now includes ASH and AWR tables, same as the Diagnostic Pack

● The imp utility on the Data Pump has been replaced with impdp

● SQLTuning Advisor

● Automatic Database Diagnostic Monitor (ADDM)

● SQLAccess Advisor

● The Stripe and Mirror Everywhere Standard (SAME) introduced Automatic Storage
Management (ASM)

● Automatic Workload Repository introduced to replace the STATSPACK

● Automated Session History (ASH)able to materialize the Oracle Wait Interface in time

● Scheduling package dbms_job is replaced by the dbms_scheduler package

● Introduction of the OEM Partition Manager

● Provision for support of Multiple Temporary Tablespaces to decrease sorting stress in TEMP

● Introduction of backup compression by RMAN

Oracle 11g

At the time of launch, Oracle 11g was a promise to consumers as an implementation of 482 new
features. These changes aimed at satisfying a then hungry commercial database market that
had since developed rather mature and high expectations of an RDBMS solution.

One outstanding enhancement in Oracle 11g is its heavy investment towards self-tuning
capabilities. The design implemented this through creation of automated storage,
automated memory management and creation of intelligent tuning advisors. The loop ended
through the provision of intelligent automation tools, resulting in a self-healing database. The
most important enhancement in this is the SQL tuning advisor that is capable of tuning SQL
statements automatically.

A list of enhancements in Oracle 11g is as outlined below:

● Automatic memory tuning

● Fully automated SQL Tuning through the SQL Performance Analyzer


● Automated load balancing in storage

● Automated Diagnostic Repository

● Enhancement of the Information Lifecycle Management (ILM) – 11g codified the approach to
ILM

● CBO statistics refresh threshold with table-level control

● Tables interval partitioning

● File group repository

● Load balancing utilities

among many others.

Oracle 12c

Here are the features that make Oracle 12c, first released in June 2013 the best Oracle
experience yet:

● Better upgrade experience – the process of upgrading is simpler and less prone to risks as
much of the process uses Oracles automated Upgrade Assistants. A lot of resources on
implementation and upgrades can also be available online.

● Price differences – Oracle 12c still enjoys the uplift waive for Extended support, meaning that
customers paying for the 11g support would also enjoy support for the new 12c improvements
and features. An upgrade would therefore make better economic sense.

● Awesome support – Oracle 12c has been on the market for over a year, and as with previous
generations, comes with better user support than any of the previous versions.

Here is a list of the three most compelling improvements to Oracle version 12c:

● Multi-tenant and pluggable databases offering less taxing amalgamation of several


databases as well as cloud deployment into DBaaS, IaaS and PaaS.

● Automatic data optimization – monitoring of the read-write characteristics of the database


allowing grouping and data tiers according to access frequency.

Column Store and In-memory Caching and Compression – a new set of features that permit
data caching in larger amounts than the conventional buffer caches. Data cached is then
stored in compressed columnar format, having a dramatic impact on performance and
optimization of server resources.

SQL Definition and History


Every business has data, which requires some organized method or mechanism for
maintaining the data. This mechanism is referred to as a database management system
(DBMS). Database management systems have been around for years, many of which started
out as flat-file systems on a mainframe. With today's technologies, the accepted use of
database management systems has begun to flow in other directions, driven by the demands
of growing businesses, increased volumes of corporate data, and of course, Internet
technologies.

The modern wave of information management is primarily carried out through the use
of a relational database management system (RDBMS), derived from the traditional
DBMS. Modern databases combined with client/server and Web technologies are
typical combinations used by current businesses to successfully manage their data
and stay competitive in their appropriate markets. The trend for many businesses is to
move from a client/server environment to the Web, where location is not a restriction
when users need access to important data. The next few sections discuss SQL and the
relational database, the most common DBMS implemented today. A good fundamental
understanding of the relational database, and how to apply SQL to managing data in
today's information technology world, is important to your understanding of the SQL
language.

What Is SQL?

SQL, Structured Query Language, is the standard language used to communicate with a
relational database. The prototype was originally developed by IBM using Dr. E.F.
Codd's paper ("A Relational Model of Data for Large Shared Data Banks") as a model. In
1979, not long after IBM's prototype, the first SQL product, ORACLE, was released by
Relational Software, Incorporated (it was later renamed Oracle Corporation). It is,
today, one of the distinguished leaders in relational database technologies. SQL is
pronounced either of two ways: as the letters S-Q-L, or as "sequel"; both
pronunciations are acceptable. However, most experienced SQL users tend to use the
latter pronunciation.

If you travel to a foreign country, you may be required to know that country's language
to get around. For example, you may have trouble ordering from a menu via your
native tongue if the waiter speaks only his country's language. Look at a database as a
foreign land in which you seek information. SQL is the language you use to express
your needs to the database. Just as you would order a meal from a menu in another
country, you can request specific information from within a database in the form of a
query using SQL.

What Is ANSI SQL?

The American National Standards Institute (ANSI) is an organization that approves


certain standards in many different industries. SQL has been deemed the standard
language in relational database communication, originally approved in 1986 based on
IBM's implementation. In 1987, the ANSI SQL standard was accepted as the
international standard by the International Standards Organization (ISO). The
standard was revised again in 1992 and was called SQL-92. The newest standard is now
called SQL-99; it's also referred to as SQL3.

The New Standard: SQL-99

SQL-99 has five interrelated documents and other documents may be added in the near
future. The five interrelated parts are as follows:

Part 1—SQL/Framework— Specifies the general requirements for conformance and


defines the fundamental concepts of SQL.

Part 2—SQL/Foundation— Defines the syntax and operations of SQL.

Part 3—SQL/Call-Level Interface— Defines the interface for application programming


to SQL.

Part 4—SQL/Persistent Stored Modules— Defines the control structures that then
define SQL routines. Part 4 also defines the modules that contain SQL routines.

Part 5—SQL/Host Language Bindings— Defines how to embed SQL statements in


application programs that are written in a standard programming language.

The new ANSI standard (SQL-99) has two levels of minimal compliance that a DBMS
may claim: Core SQL Support and Enhanced SQL Support.

ANSI stands for American National Standards Institute, an organization that is responsible
for devising standards for various products and concepts.

With any standard comes numerous, obvious advantages, as well as some


disadvantages. Foremost, a standard steers vendors in the appropriate industry
direction for development. In the case of SQL, a standard provides a basic skeleton of
necessary fundamentals, which as an end result, allows consistency between various
implementations and better serves increased portability (not only for database
programs, but databases in general and individuals who manage databases).

Some may argue that a standard is not so good, limiting the flexibility and possible
capabilities of a particular implementation. However, most vendors who comply with
the standard have added product-specific enhancements to standard SQL to fill in
these gaps.

A standard is good, considering the advantages and disadvantages. The expected


standard demands features that should be available in any complete SQL
implementation and outlines basic concepts that not only force consistency between
all competitive SQL implementations, but also increase the value of a SQL
programmer.

A SQL implementation is a particular vendor's SQL product, or relational database


management system. It is important to note, as you will hear numerous times in this book,
that implementations of SQL vary widely. There is no one implementation that follows the
standard completely, although some are mostly ANSI-compliant.

What Is a Database?

In very simple terms, a database is a collection of data. Some like to think of a database
as an organized mechanism that has the capability of storing information, through
which a user can retrieve stored information in an effective and efficient manner.

People use databases every day without realizing it. A phone book is a database. The
data contained consists of individuals' names, addresses, and telephone numbers. The
listings are alphabetized or indexed, which allows the user to reference a particular
local resident with ease. Ultimately, this data is stored in a database somewhere on a
computer. After all, each page of a phone book is not manually typed each year a new
edition is released.

The database has to be maintained. As people move to different cities or states, entries
may have to be added or removed from the phone book. Likewise, entries will have to
be modified for people changing names, addresses, or telephone numbers, and so on.
Figure 1.1 illustrates a simple database.

An Introduction to the Relational Database

A relational database is a database divided into logical units called tables, where tables are
related to one another within the database. A relational database allows data to be broken
down into logical, smaller, manageable units, allowing for easier maintenance and providing
more optimal database performance according to the level of organization. In Figure 1.2, you
can see that tables are related to one another through a common key (data value) in a
relational database.

Again, tables are related in a relational database, allowing adequate data to be


retrieved in a single query (although the desired data may exist in more than one
table). By having common keys, or fields, among relational database tables, data from
multiple tables can be joined to form one large result set. As you venture deeper into
this book, you see more of a relational database's advantages, including overall
performance and easy data access.

A relational database is a database composed of related objects, primarily tables. A table is


the most basic means of storage for data in a database.

An Introduction to Client/Server Technology

In the past, the computer industry was predominately ruled by mainframe computers;
large, powerful systems capable of high storage capacity and high data processing
capabilities. Users communicated with the mainframe through dumb terminals—
terminals that did not think on their own, but relied solely on the mainframe's CPU,
storage, and memory. Each terminal had a data line attached to the mainframe. The
mainframe environment definitely served its purpose, and does today in many
businesses, but a greater technology was soon to be introduced: the client/server
model.

In the client/server system, the main computer, called the server, is accessible from a network
—typically a local area network (LAN) or a wide area network (WAN). The server is normally
accessed by personal computers (PCs) or by other servers, instead of dumb terminals. Each
PC, called a client, is provided access to the network, allowing communication between the
client and the server, thus explaining the name client/server. The main difference between
client/server and mainframe environments is that the user's PC in a client/server
environment is capable of thinking on its own, capable of running its own processes using its
own CPU and memory, but readily accessible to a server computer through a network. In
most cases, a client/server system is much more flexible for today's overall business needs
and is much preferred.

Modern database systems reside on various types of computer systems with various
operating systems. The most common types of operating systems are Windows-based
systems and common line systems such as UNIX. Databases reside mainly in
client/server and Web environments. A lack of training and experience is the main
reason for failed implementations of database systems. Nevertheless, an
understanding of the client/server model and Web-based systems is imperative with
the rising (and sometimes unreasonable) demands placed on today's businesses as
well as the development of Internet technologies and network computing.
An Introduction to Web-Based Database Systems

Business information systems are moving toward Web integration. Databases are now
accessible through the Internet, meaning that customers' access to an organization's
information is enabled through an internet browser such as Internet Explorer or
Netscape. Customers (users of data) are able to order merchandise, check on
inventories, check on the status of orders, make administrative changes to accounts,
transfer money from one account to another, and so forth.

A customer simply invokes an Internet browser, goes to the organization's Web site,
logs in (if required by the organization), and uses an application built into the
organization's Web page to access data. Most organizations require users to register
with them, and will issue a login and password to the customer.

Of course, there are many things that occur behind the scenes when a database is being
accessed via a Web browser. SQL, for instance, can be executed by the Web application.
This executed SQL is used to access the organization's database, return data to the Web
server, and then return that data to the customer's Internet browser.

The basic structure of a Web-based database system is similar to that of a client server
system from a user's standpoint. Refer to Figure 1.3. Each user has a client machine,
which has a connection to the Internet and contains a Web browser. The network (in
the case of a Web-based database) just happens to be the Internet, as opposed to a local
network. For the most part, a client is still accessing a server for information. It doesn't
matter that the server may exist in another state, or even another country. The main
point of Web-based database systems is to expand the potential customer base of a
database system that knows no physical location bounds, thus increasing data
availability and an organization's customer base.

Some Popular Relational Database Vendors

Some of the most predominant database vendors include Oracle, Microsoft, Informix,
Sybase, and IBM. These vendors distribute various versions of the relational database
for a significant cost. There are many other vendors who supply an open source
version of an SQL database (relational database). Some of these vendors include
MySQL, PostgresSQL, and SAP. Although there are many more vendors than those
mentioned, this list includes names that you may have recognized on the bookshelf, in
the newspaper, in magazines, on the stock market, or on the World Wide Web.

Differences Between Implementations

As each individual in this world is unique in both features and nature, so is each
vendor-specific implementation of SQL. A database server is a product, like any other
product on the market, manufactured by a widespread number of vendors. It is to the
benefit of the vendor to ensure that its implementation is compliant with the current
ANSI standard for portability and user convenience. For instance, if a company is
migrating from one database server to another, it would be rather discouraging for the
database users to have to learn another language to maintain functionality with the
new system.

With each vendor's SQL implementation, however, you find that there are
enhancements that serve the purpose for each database server. These enhancements,
or extensions, are additional commands and options that are simply a bonus to the
standard SQL package and available with a specific implementation.

Types of SQL Commands

The following sections discuss the basic categories of commands used in SQL to perform
various functions. These functions include building database objects, manipulating objects,
populating database tables with data, updating existing data in tables, deleting data,
performing database queries, controlling database access, and overall database
administration.

The main categories are

● DDL (Data Definition Language)

● DML (Data Manipulation Language)

● DQL (Data Query Language)

● DCL (Data Control Language)

● Data administration commands

● Transactional control commands

Defining Database Structures

Data Definition Language, DDL , is the part of SQL that allows a database user to create and
restructure database objects, such as the creation or the deletion of a table.

Some of the most fundamental DDL commands discussed during following hours include the
following:

● CREATE TABLE

● ALTER TABLE

● DROP TABLE
● CREATE INDEX

● ALTER INDEX

● DROP INDEX

● CREATE VIEW

● DROP VIEW

Manipulating Data

Data Manipulation Language, DML , is the part of SQL used to manipulate data within
objects of a relational database.

There are three basic DML commands:

● INSERT

● UPDATE

● DELETE

Selecting Data

Though comprised of only one command, Data Query Language (DQL) is the most
concentrated focus of SQL for modern relational database users. The base command is as
follows:

● SELECT

This command, accompanied by many options and clauses, is used to compose queries
against a relational database. Queries, from simple to complex, from vague to specific, can be
easily created.

A query is an inquiry to the database for information. A query is usually issued to the
database through an application interface or via a command line prompt.

Data Control Language

Data control commands in SQL allow you to control access to data within the database. These
DCL commands are normally used to create objects related to user access and also control the
distribution of privileges among users. Some data control commands are as follows:

● ALTER PASSWORD

● GRANT
● REVOKE

● CREATE SYNONYM

Data Administration Commands

Data administration commands allow the user to perform audits and perform analyses on
operations within the database. They can also be used to help analyze system performance.
Two general data administration commands are as follows:

● START AUDIT

● STOP AUDIT

Do not get data administration confused with database administration. Database


administration is the overall administration of a database, which envelops the use of all
levels of commands. Database administration is much more specific to each SQL
implementation than are those core commands of the SQL language.

Transactional Control Commands

In addition to the previously introduced categories of commands, there are commands that
allow the user to manage database transactions.

● COMMIT Saves database transactions

● ROLLBACK Undoes database transactions

● SAVEPOINT Creates points within groups of transactions in which to ROLLBACK

● SET TRANSACTION Places a name on a transaction

What is SQL?

SQL stands for Structured Query Language use for storing, manipulating and retrieving
relational database data.

SQL queries to retrieve data from database same as you can adding and manipulating
database data.

SQL is a very powerful and diverse database language use to storing data into databases. SQL
is loosely typed language so you can learn easily.

In this SQL tutorial, we use command line examples to know about executing speed of SQL.
It's take very bit of time for executing and retrieving result.

SQL is a greater tool with web languages such as PHP, Python, Java, ASP et cetera to build
dynamic web applications.

Before starting SQL, relational databases have several point that are important to keep in
mind.

1. RDBMS stands for Relational Database Management System.

2. Data Integrity : Store data only once and avoiding data duplication.

3. SQL Constraints : Constraints are the rules which are apply to table columns to store valid
data and prevents the user to storing/entering invalid data into table columns.

4. Better security : Assign grant or privilege to a individual User. Using this grant user can
store confidential data into table by using username or password.

5. Database Normalization : Database normalization is the process to store database data very
efficiently. No need to store same data more then one time and reduce the Data redundancy.

6. Different types of relationships : One to one, One to many, Many to many

1. One to one relationship : merging for two tables.

2. One to many relationship : create a foreign key from an parent table to the child table.

3. Many to many relationship : create a new relation table.

7. Keep in your mind...

● SQL is not case sensitive.

● But SQL Data is a case sensitive.

SQL Process Flow

When you execute SQL query come to a SQL Server. SQL Server work is managing database,
load balancing, transaction management etc. SQL server call to a actual physical database
table and return the result. This process is take small bit of time and depend of query and
SQL server load.

Rules of Semicolon(;) or Forward Slash(/) in SQL

There is a huge difference in SQL between the meaning of a / and a ; because they work
differently.

● SQL database systems require semicolon(;) at the end of statement to know it's ending.

● Use forward slash(/) once at the end of each script, to tell SQL that there is not more lines of
code. you can't use forward slash(/) at the middle of the script.

The ; means terminate the current statement execute it and store it to the "SQL buffer",
whereas the / executes whatever statement script is in the current "SQL buffer".

Type of SQL Statement (DDL, DML, DCL, TCS, SCS Commands)

SQL statements are divided into five different categories: Data definition language (DDL),
Data manipulation language (DML), Data Control Language (DCL), Transaction Control
Statement (TCS), Session Control Statements (SCS).

Data Definition Language (DDL) Statements

Data definition statement are use to define the database structure or table.

Statement

Description

CREATE

Create new database/table.

ALTER

Modifies the structure of database/table.

DROP

Deletes a database/table.

TRUNCATE

Remove all table records including allocated table spaces.

RENAME

Rename the database/table.

Data Manipulation Language (DML) Statements

Data manipulation statement are use for managing data within table object.

Statement

Description

SELECT
Retrieve data from the table.

INSERT

Insert data into a table.

UPDATE

Updates existing data with new data within a table.

DELETE

Deletes the records rows from the table.

MERGE

MERGE (also called UPSERT) statements to INSERT new records or UPDATE existing records
depending on condition matches or not.

LOCK TABLE

LOCK TABLE statement to lock one or more tables in a specified mode. Table access denied
to a other users for the duration of your table operation.

CALL

EXPLAIN PLAN

Statements are supported in PL/SQL only for executed dynamically. CALL a PL/SQL program
or EXPLAIN PATH access the data path.

Data Control Language (DCL) Statements

Data control statement are use to give privileges to access limited data.

Statement

Description

GRANT

Gives privileges to user for accessing database data.

REVOKE

Take back for given privileges.

ANALYZE
ANALYZE statement to collect statistics information about index, cluster, table.

AUDIT

To track the occurrence of a specific SQL statement or all SQL statements during the user
sessions.

COMMENT

Write comment to the data table.

Transaction Control Statement (TCS)

Transaction control statement are use to apply the changes permanently save into database.

Statement

Description

COMMIT

Permanent work save into database.

ROLLBACK

Restore database to original form since the last COMMIT.

SAVEPOINT

Create SAVEPOINT for later use ROLLBACK the new changes.

SET TRANSACTION

SET TRANSACTION command set the transaction properties such as read-write/read only
access.

PL/SQL Transaction Commit, Rollback, Savepoint, Autocommit, Set Transaction

Session Control Statements (SCS)

Session control statement are manage properties dynamically of a user session.

Statement Description ALTER SESSION ALTER SESSION statement to modify conditions or


parameters that are affect to your database connection. SET ROLE SET ROLE statement to
enable or disable the roles that are currently enabled for the session.

What is PL/SQL?
PL/SQL stands for Procedural Language extension of SQL.

PL/SQL is a combination of SQL along with the procedural features of programming


languages.

It was developed by Oracle Corporation in the early 90’s to enhance the capabilities of SQL.

The PL/SQL Engine:

Oracle uses a PL/SQL engine to processes the PL/SQL statements. A PL/SQL language code
can be stored in the client system (client-side) or in the database (server-side).

About This PL SQL Programming Tutorial

This Oracle PL SQL tutorial teaches you the basics of database programming in PL/SQL with
appropriate PL/SQL tutorials with coding examples. You can use these free online tutorials
as your guide to practice, learn, for training, or reference while programming with PL SQL. I
will be making more Oracle PL SQL programming tutorials as often as possible to share my
knowledge in PL SQL and help you in learning PL SQL language and syntax better.

Even though the programming concepts discussed in this tutorial are specific to Oracle PL
SQL. The concepts like cursors, functions and stored procedures can be used in other
database systems like Sybase , Microsoft SQL server etc, with some change in SQL syntax.
This PL/SQL tutorial will be growing regularly; let us know if any topic related to PL SQL
needs to be added or you can also share your knowledge on PL SQL with us. Lets share our
knowledge about PL SQL with others.

A Simple PL/SQL Block:

Each PL/SQL program consists of SQL and PL/SQL statements which from a PL/SQL block.

PL/SQL Block consists of three sections:

● The Declaration section (optional).

● The Execution section (mandatory).

● The Exception Handling (or Error) section (optional).

Declaration Section:

The Declaration section of a PL/SQL Block starts with the reserved keyword DECLARE. This
section is optional and is used to declare any placeholders like variables, constants, records
and cursors, which are used to manipulate data in the execution section. Placeholders may
be any of Variables, Constants and Records, which stores data temporarily. Cursors are also
declared in this section.
Execution Section:

The Execution section of a PL/SQL Block starts with the reserved keyword BEGIN and ends
with END. This is a mandatory section and is the section where the program logic is written
to perform any task. The programmatic constructs like loops, conditional statement and SQL
statements form the part of execution section.

Exception Section:

The Exception section of a PL/SQL Block starts with the reserved keyword EXCEPTION. This
section is optional. Any errors in the program can be handled in this section, so that the
PL/SQL Blocks terminates gracefully. If the PL/SQL Block contains exceptions that cannot be
handled, the Block terminates abruptly with errors.

Every statement in the above three sections must end with a semicolon ; . PL/SQL blocks can
be nested within other PL/SQL blocks. Comments can be used to document code.

How a Sample PL/SQL Block Looks

DECLARE

Variable declaration

BEGIN

Program Execution

EXCEPTION

Exception handling

END;

SQL Command Categories

SQL commands are grouped into four major categories depending on their functionality.
They are as follows:

Data Definition Language (DDL)

These SQL commands are used for creating, modifying, and dropping the structure of
database objects. The commands are CREATE, ALTER, DROP, RENAME, and TRUNCATE.

Data Manipulation Language (DML)

These SQL commands are used for storing, retrieving, modifying, and deleting data. These
commands are SELECT, INSERT, UPDATE, and DELETE.
Transaction Control Language (TCL)

These SQL commands are used for managing changes affecting the data. These commands
are COMMIT, ROLLBACK, and SAVEPOINT.

Data Control Language (DCL)

These SQL commands are used for providing security to database objects. These commands
are GRANT and REVOKE.
1.4k Views · View Upvoters

Upvote · 1  

Comment... Recommended All

Promoted by Association for Computing Machinery  

Join ACM today and master DevOps. It’s time to smash your silos.
50,000+ titles from Safari, Skillsoft, O’Reilly, Addison-Wesley, Packt and more. Join now for
$75.

Learn More

Vignesh Waran, Microsoft Certified Professional


Answered Sep 25, 2016

1. A view is an combination or grouping of tables.

2. User can execute DDL,DML statements in view.

3. It will reflect in view, If user changed any structure in table which you are used in
views

4. User can avoid to write frequent big joins query once you write the view.

5. View will work same like the table.

6. User can customise the view like which columns should suppose to show.

7. Like tables you do indexing in views.

8. User can encrypt the views which you cannot do it in tables.

9. SYNTAX :
1 Create view viewname
2 As
3 Begin
4 ——/Here you can join whatever tables you want/——
5 End

And user can use views just like that

1 Select * from viewname

#Hope now you can understand views better :)


354 Views · View Upvoters

Upvote · 4  

Comment... Recommended All

John Walker, SQL Server DBA & Technology Geek


Answered Nov 26, 2016

View, in essence, is a virtual table that does not physically exist in SQL Server. Rather, it is
created by a query joining one or more tables. In SQL Server we make views for security
purpose since it restricts the user to view some columns/fields of the table(s).

There are two types of views in SQL server

1. System Defined Views

2. User Defined Views

For more information you can visit: Overview of Views and Types of Views in SQL Server
Database
213 Views · View Upvoters

Upvote · 2  

Comment... Recommended All

Nina Torres
Answered Feb 15, 2017

In DBMS a view is the consequence set of a stored query on the data, which the database
users are able to query now as they would in an unrelenting file compilation thing. Views
can unite and make simpler manifold tables keen on a solitary near table.
95 Views · View Upvoters
Upvote · 1  

Comment... Recommended All

Naseeb Singh, bca, it , bjmc C & Software and Applications, Government of India
(2017)
Answered Aug 20

INTRODUCTION OF DBMS WHAT IS DBMS :-

Hey guys in this category we learn about full details Database Management Systems. And
also in this post we discuss about some important definitions (also we can say introduction of
DBMS) whoes are most most important to start our course about DBMS.

http://gkallin.com/introduction-...
52 Views

Upvote  

Comment... Recommended All

RELATED QUESTIONS
Open In App
What is decomposition in DBMS?
1 20
18,148 Home
Views Answer Notifs You

What is view serializability? How to check View serializability in DBMS?


6,865 Views

What is trigger in DBMS?


2,713 Views

What are some good books to learn DBMS?


37,529 Views

What is Dbms? Use of Dbms? What are DBMS languages?


8,049 Views

What is the difference between DBMS and RDBMS?


9,546 Views
What is 4NF and 5NF in DBMS?
30,197 Views

What are the advantages of DBMS?


14,340 Views

What's the purpose of a DBMS?


13,524 Views

What is the difference between dbms and advanced dbms?


6,750 Views

 Ask New Question

More 

Open in app 

You might also like