DELETE Statement in SQL – DML Statements

In previous SQL post we had discussed about Data Definition Language  Statements such as  CREATE Command and ALTER Command and USE Command and DROP DATABASE Command and SQL SELECT Statement and SQL INSERT Statement and SQL UPDATE Statement.

Now in this SQL Post we will learn Data Manipulation Language (DML) DELETE Statement.

DELETE Statement in SQL – DML Statements

The DELETE Statement – The DELETE Statement is used to delete the records of an existing table.

If we want to delete the rows in a table, we need to use UPDATE query in SQL.

The SQL DELETE Statement Syntax :

DELETE FROM table_name WHERE Condition

table_name – is the name of table which data to be deleted.

In delete Statement we use WHERE  Condition, if we do not use WHERE  condition in delete statement then all the records of table will be deleted. so  it is  good practice to  use where condition while using delete command in sql.

SQL DELETE Statement Example :

For delete some records from an existing table, First we create a new database in database server  and then create a new table in database. After creating a table in database we insert some records using INSERT Statement, after inserting records in a table we apply DELETE query on table to delete records from a table.

We have already learned CREATE Database and CREATE Table and SELECT Statement and INSERT Statement in our previous SQL post.

Now, we have created table named “Student” with some columns like ID, Name, City, Email, Mobile.

Here, we have inserted some records in Student table using  INSERT Statement.

The SQL Student Table :

ID Name City Email
1 Meera Bombay
2 Ram Surat
3 Jay Bombay
4 Vaidehi Ahmedabad

Now, In above Student table we apply DELETE Statement for delete data from table.

The SQL DELETE Statement for Student table.


Above delete statement delete all records from student table.

If we want to delete records whose id is 3, the SQL Delete Statement is :


The Result of SQL DELETE query :

ID Name City Email
1 Meera Bombay
2 Ram Surat
4 Vaidehi Ahmedabad

I hope you will like this SQL DELETE Statement post…

Leave a Reply

Your email address will not be published. Required fields are marked *

1 + 4 =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">