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.


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.
How to delete tabel or database ?
Download sql dump of this student table


Further readings
Changing structur of the table bu alter query
Create table query with if exists sql with php script
Creating a new table by using data from one table
Change the name of a table
Copying data from one table to another table
Delete records from a table with conditinos
Delete table by using DROP sql
Updating another table with data from main table
Update SQL commands
Inserting SUM, AVG data from one table column to other using group by command
Table Records are downloaded as .csv file
Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked

Join Our Email List
Email:  
For Email Newsletters you can trust
Modify Table
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2013 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer