Insert,Update, Delete into SQL DB

Insert,Update, Delete into SQL DB.SQL Insert,Update & Delete are most essential command in SQ L(standard query language). These  command are frequently used in MySQL  database.

In this tutorial i will discuss about insert update & delete statement ,their purpose , syntax  and suitable example.

Purpose of Insert:

The  INSERT INTO  statement is used to insert a new row in a table.

Syntax 1: 

INSERT INTO table_name VALUES (‘value1’, ‘value2’,‘value2’…)


insert into tbl_student1
values(‘093021′,’Humayun kabir’,’Bogra’,’01723425643′)

Syntax 2: 

Insert into ‘database name’. ‘tbl_name'(column1,column2,column3,col4…..)

Values(‘ 093021’,’Humayun kabir’,’Bogra’,’01723425643’)


INSERT INTO `hum`.`tbl_student1` (`Roll`, `Name`, `HomeDistrict`, `MobileNo`)

VALUES (‘093012’, ‘sakil’, ‘khulna’, ‘01912356245’);

We can also insert multiple rows at a time

For example:

insert into tbl_student1
values(‘093024′,’Humayun kabir1′,’Bogra’,’01723425643′);
INSERT INTO tbl_student1

VALUES (‘093027’, ‘Humayun kabir1’, ‘Bogra’, ‘01723425643’);
insert into tbl_student1

values(‘093029′,’Humayun kabir1′,’Bogra’,’01723425643′);
INSERT INTO tbl_student1
VALUES (‘093026’, ‘Humayun kabir1’, ‘Bogra’, ‘01723425643’)

Output of the  insert multiple row at time look like below:

Purpose of UPDATE statement:

The UPDATE statement is used to update existing records in a table.

Syntax of UPDATE:

UPDATE table_name SET column1=new value , column2=new value ,…WHERE some_column=existence value


1. UPDATE tbl_student1 SET Name=’bashar’WHERE MobileNo=’01912356245′

2. UPDATE tbl_student1 SET Name=’Galib’WHERE Roll=’093010′

Output of above two statement:

Purpose of DELETE  statement:

The DELETE statement is used to delete rows in a table.

Syntax of DELETE:

delete from tbl_name where a column=some value


delete from  tbl_student1 where Roll=093045

Output of the  above statement:

Delete All Rows:

We can  delete all rows in a table without deleting the table. That  means   the table structure, indexes  and attributes  will  remain unchanged.

Example of Delete all rows of table:

delete  from table_name
delete* from table_name

Related Post:

1. Introduction of Database & SQL 

2. Create Database & Table

3. SQL Select and Where 

4. Database Connection

5.SQL And OR & Distinict Query