Chapter 3 Database Language
Chapter 3 Database Language
Database Concept
Database Language
Agenda
Database Language
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