You are on page 1of 2

Practical 2

AIM: Implementation of DML(Data Manipulation Language) commands of SQL


1. Insert
Insert is used to add records into the table.
Syntax:-
insert into table_name values (val1, val2, val3,val4);
Example:-
insert into Student values(1,'Raj','BBA','A');
insert into Student values(2,'Renu','BBA','B');
insert into Student values(3,'Pihu','BCA','A');
insert into Student values(4,'Rohan','BCA','A');
insert into Student values(5,'Piyush','BBA','B');

2.Update
The UPDATE command is used to modify the existing records in a table.
Syntax:-
update table_name set column1 = value1, column2 = value2, ...where
condition;
Example:-
update Student set Name ='Renu joshi' where Roll_Number=2;
update Student set Course ='MCA' where Roll_Number=3;

3.Delete
The DELETE command is used to delete existing records in a table.
Syntax:-
delete from table_name where condition ;
Example:-
delete from Student where Roll_number=2;

You might also like