SQL PHP HTML ASP JavaScript articles and free scripts to download
 
 

SQL delete Command

Delete query is used to delete records from the table. This query is used along with some condition to selectively delete records from the table. To delete all the records from the table we can use truncate command like this

TRUNCATE `student`

This will remove all the records from the table. This is one way of deleting all the records from a table. Now let us try to delete records based on some selection. Now let us delete records of the students who has got mark less than 60. Here we are selectively deleting the records so we have to use WHERE clause to match the selection.
Related Tutorial
Number of Affected rows
Copy data to new table
SQL Left Join
SQL Rename table
PHP MySQL functions


DELETE FROM student WHERE mark < 60
This will delete records for which mark is less than 60. We can use all the WHERE clause we learned at SQL WHERE page.


Discuss this tutorial at forum

List of SQL Tutorials


 
Scripts
PHP
JavaScript
HOME
SQL Tutorial List
SQL (Home)
SQL Commands
Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.