Dbms Language

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

1.

Data Definition Language (DDL)


o DDL stands for Data Definition Language. It is used to define database structure or pattern.
o It is used to create schema, tables, indexes, constraints, etc. in the database.
o Using the DDL statements, you can create of the database.
o Data definition language is used to store the information of metadata like the number of tables
and schemas, their names, indexes, columns in each table, constraints, etc.

Here are some tasks that come under DDL:


o Create: It is used to create objects in the database.
o Alter: It is used to alter the structure of the database.
o Drop: It is used to delete objects from the database.
o Truncate: It is used to remove all records from a table.
o Rename: It is used to rename an object.

For example, creating a new table would be a DDL operation:


CREATE TABLE Employees (
EmployeeID int,
EmployeeName varchar(255),
Role varchar(255)
);

2. Data Manipulation Language (DML)

DML stands for Data Manipulation Language.It is used for accessing and manipulating data in a
database.
It allows user insert, delete, update, and retrieve data from the database. Dml is also known as
query language
o Select: It is used to retrieve data from a database.
o Insert: It is used to insert data into a table.
o Update: It is used to update existing data within a table.
o Delete: It is used to delete all records from a table.
INSERT INTO Employees (EmployeeID, EmployeeName, Role)

VALUES (1, 'John Doe', 'Software Developer');

3.Data Control Language (DCL)


o DCL stands for Data Control Language. It is used to retrieve the stored or saved data.
o The DCL execution is transactional. It also has rollback parameters.
Here are some tasks that come under DCL:
o Grant: It is used to give user access privileges to a database.
o Revoke: It is used to take back permissions from the user.

4. Transaction Control Language (TCL)


TCL command are used to manage transaction in the database.
TCL is used to run the changes made by the DML statement.
The changes in the database that we made using DML command are either performed or rollbacked
using TCL.
o Commit: It is used to save the transaction on the database.
o Rollback: It is used to restore the database to original since the last Commit.
o Savepoint : savepoint command is used to temporarily save a transaction so that you can
rollback to that point whenever necessary.

You might also like