Database Languages

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

3- 112

DATABASE LANGUAGES

Chapter#5

DBMS Languages
DATA DEFINITION LANGUAGE (DDL)
is used for defining the database schema.
Used by the DBA and database designers to specify the
conceptual schema of a database
is used to define the conceptual and internal schemas for
the database.
The DDL statements are also used to specify the integrity
rules .(constraints) in order to maintain the integrity of
the database.
DDL also accepts input in the form of instructions
(statements) and generates the description of schema as
output. The output is placed in the data dictionary,
which is a special type of table containing metadata .The
DBMS refers the data dictionary before reading or
modifying the data. database users cannot update the
data dictionary; instead it is only modified by database
system itself
Some examples:
CREATE - to create objects in the database
ALTER - alters the structure of the database
DROP - delete objects from the database
TRUNCATE - remove all records from a table, including
all spaces allocated for the records are removed
COMMENT - add comments to the data dictionary
RENAME - rename an object
separate storage definition language (SDL) and view
definition language (VDL) are used to define internal and
external schemas.

DATA MANIPULATION LANGUAGE (DML)


.is used to manipulate the database

data manipulation language (DML) that enables users to


.retrieve and manipulate the data

3 Page 1 of

3- 112
DATABASE LANGUAGES

The statement which is used to retrieve the information


.is called a query
The part of the DML used to retrieve the information is
called a query language
The DML are of two types, namely, non-procedural
.DML and procedural DML

The non-procedural or high-level or declarative


DML enables to specify the complex database
operations concisely. It requires a user to
specify whatdata is required without specifying how to
retrieve the required data. For example, SQL
.(Structured Query Language)
the procedural or low-level DML requires user to
specify what data is required and how to access that
data by providing step-by-step procedure. For example,
relational algebra
Some examples:
SELECT - Retrieve data from the a database
INSERT - Insert data into a table
UPDATE - Updates existing data within a table
DELETE - deletes all records from a table, the space
for the records remain
MERGE - UPSERT operation (insert or update)
CALL - Call a PL/SQL or Java subprogram
EXPLAIN PLAN - explain access path to data
LOCK TABLE - control concurrency

DATA CONTROL LANGUAGE


data control language (DCL) is used to create user roles,
grant permissions, and control access to database by
securing it.

3 Page 2 of

3- 112
DATABASE LANGUAGES

Some examples:
GRANT - gives user's access privileges to database
REVOKE - withdraw access privileges given with the
GRANT command

TRANSACTION CONTROL LANGUAGE (TCL)


Transaction control language is used to manage different
transactions occurring within a database.
Some examples:
COMMIT - save work done
SAVEPOINT - identify a point in a transaction to which
you can later roll back
ROLLBACK - restore database to original since the last
COMMIT
SET TRANSACTION - Change transaction options like
isolation level and what rollback segment to use
VIEW DEFINITION LANGUAGE (VDL)
.to define the external schema

3 Page 3 of

You might also like