Data Manipulation Language (DML)

Posted in Information Technology & Systems, Total Reads: 440
Advertisements

Definition: Data Manipulation Language (DML)

Data Manipulation Language (DML) is a language by which users access and manipulate data. Data manipulation refers to retrieval, insertion, deletion and modification of data or information stored in the database. The basic goal is to attain efficient human interaction with the system. DML is just like simple English language and is mostly used as a Structured Query Language (SQL) for information retrieval and manipulation.

 

Data Manipulation Language is of two types:

a)     Procedural – The type of data needed and the mechanism to get it is specified by the user.

b)     Non Procedural – Only the type of data needed is specified by the user.

 

The basic DML commands are:

 

a)   SELECT – This is the most widely used DML command. It retrieves information or records from the database.

 

Syntax: SELECT [column name(s)] from [table name]

Example:

To select all records of the table employee that have salary greater the 2000 – SELECT * FROM EMPLOYEE WHERE SALARY > 2000

 

b)   UPDATE – This command is used for modification purpose. It can modify data of one or more records according to the specified conditions.

 

Syntax: UPDATE [table name] SET [column name = value] where [condition]

Example:

To update the salary of an employee (id = 101) who has been promoted by increasing it by 5000 –

UPDATE EMPLOYEE SET SALARY = SALARY + 5000 WHERE EMPLOYEE_ID =101

 

 

c)   INSERT – This command is used for adding one or more records to a database.

 

Syntax: INSERT INTO [table name] [column(s)] VALUES [value(s)]

Example:

Insert the details of a new employee who has joined the organization –

INSERT INTO EMPLOYEE (ID, NAME, SALARY) VALUES (‘102’,’MAYANK’,’10000’)

 

d)   DELETE – This command is used for removing one or more records from a database according to the specified conditions.

 

Syntax:  DELETE FROM [table name] where [condition]

Example:

Delete the record of an employee (id = 100) who has left the company –

DELETE FROM EMPLOYEE WHERE EMPLOYEE_ID = 100

 

Data manipulation languages were initially used only within computer programs but with the coming of SQL, the database administrators are using it for better interactively.

 

Advertisements



Looking for Similar Definitions & Concepts, Search Business Concepts