Faculty Of Computer Science
Database Concept
Lecturer: Lutfullah Haqnesar
Chapter Three
Database Language
Agenda
Database Language
Data Manipulation Language
Types of Database Language
Data Manipulation Language (DML)
• DML stands for Data Manipulation Language.
• It is used for accessing and manipulating data in a database. It handles
user requests.
• Like insert, delete and update command and etc.
Data Manipulation Language (DML)
Here are some tasks that come under DML:
• Select: It is used to retrieve data from a database.
• Insert: It is used to insert data into a table.
• Update: It is used to update existing data within a table.
• Delete: It is used to delete all records from a table.
Data Manipulation Language (DML)
1. Insert Statement
• INSERT statement is used to add a single record or multiple records into
the table.
Syntax:
INSERT into table (column1, column2, ...column_n) values (
expression1, expression2, ... expression_n );
Example:
insert into emp (id, name, ADDRESS) VALUES (2, 'ahmad', 'kabul');
Data Manipulation Language (DML)
2. SELECT Statement
• SELECT statement is used to retrieve data from one or more than one tables, views,
etc.
Syntax:
SELECT expressions FROM tables WHERE conditions;
Parameters:
• expressions: It specifies the columns that you want to retrieve.
• conditions: It specifies the conditions that must be followed for selection.
Data Manipulation Language (DML)
2. SELECT Statement
Example:
select name, address from emp;
select * from emp;
select * from emp where id > 10;
Note: if we want to retrieve the data of all the columns we use the (*) in
expression.
Data Manipulation Language (DML)
3. UPDATE Statement
• UPDATE statement is used to update the existing records in a table.
Syntax:
UPDATE table_name SET column1 = expression1 WHERE conditions;
Example:
update emp set name = 'karim', address = 'balkh' where id = 2;
Data Manipulation Language (DML)
4. DELETE Statement
• DELETE statement is used to remove or delete a single record or multiple
records from a table.
Syntax:
DELETE FROM table_name WHERE conditions;
Example:
delete from emp where id > 10;
END OF CHAPTER