--> Sayadasite: DML

Multiple Ads

Search

Menu Bar

DML

 DML(data manipulation language)

It deals with data of objects it provides 3 commands

Insert

Update

Delete

INSERT:

Syntax: insert into tablename values(data1,data2,………datan);

UPDATE:

Syntax: update table set <field>=<update> where <field>=<reference_data>;

Select * from singer;

NAME    ADDRESS

Neha       mumbai

Arejeet    kolkata

update table singer set name=’arjeet’ where address=’kolkata’;

1 row updated

Select * from singer;

NAME    ADDRESS

Neha       mumbai

arjeet        kolkata

DELETE:

Delete from table_name;

Delete from table_name where conditional_statement;

Select * from singer;

NAME    ADDRESS

Neha       mumbai

arjeet       kolkata

 delete from singer;

2 rows deleted;

 Select * from singer;

No rows selected

Select * from emp2;

EID     ENAME         EADD

10         ANKIT      jamshedpur

20         ankush         mysore

30         anish           sandore

Delete from emp2 where edi=10;

1 row deleted

 DQL(data query language)

It is used to retrive information from database

It has only one select command

Syntax: select * from table_name;

Select * from stu;

ROLL  NAME           ADDRESS

1           rahul               kerala

2           pankaj              mysore

3           rohit                  sandore


Select * from stu where roll=2;

ROLL  NAME           ADDRESS

2           pankaj          mysore

 

 

No comments: