H I O X INDIA
MySQL Tutorial
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Templates 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)
Español Français 中文 Deutsch
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

Mysql Tutorial
Introduction
How to Install
Database
Datatypes
Tables
INSERT
SELECT
UPDATE
DELETE
Operators
Functions
Ask Your Doubts
More about Mysql
Feedback




DELETE or Deleting Statement in Mysql


Topic

How to remove or delete a record from the database table?
How to delete all the records in a table?
Delete Query in MySQL
How to delete rows and columns of database table?



Explanation


DELETE Statement :

    The deleting query is used to delete the values from a table.

The syntax is


DELETE FROM tbl_name
[WHERE where_condition];
    The DELETE statement deletes the rows from tbl_name and returns the number of rows deleted. The WHERE clause is used to specify the conditions that identify which rows to be deleted. If the DELETE statement contains without WHERE clause, all rows will be deleted.

    Now lets see an example for DELETE statement.

mysql> delete from student where name='michael';
Query OK, 1 row affected (0.00 sec)
    The above example will delete the record of the student Michael from the table.

    We can also delete all the values in the table as the following query.

mysql> delete from student;
Query OK, 8 rows affected (0.00 sec)
    The above example will delete all the records from the student table.






        MySQL is the most popular open source Relational database Management system (RDBMS). Being a open source anyone can use and change the software for their needs. Hope you enjoy this tutorial. We welcome your Valuable feedbacks or suggestions on this MySQL tutorial. This is a copyright content.


privacy policy     license     sitemap
© 2004-2009 HIOX INDIA - hioxindia.com

Other Links