3
So far we've covered how to put data into the database and how to modify it, but now we're going to start deleting data. The syntax is DELETE FROM <table> WHERE <field>=<value> LIMIT <number of rows>;. Here we're introducing the LIMIT statement, which is used in this situation to LIMIT the rows to delete. The LIMIT statement can also be used in other queries such as INSERT and UPDATE. LIMIT statements cannot be used in multi-table deletes.
Simple delete statement that deletes all rows from table1 where field1 is greater than 3.
In this delete statement we delete the first 5 rows where field2 is greater than field4.
This statement deletes any row from table1 where field3 is greater than field3 of table2 minus 5.
The DRROP DATABASE function is used to delete databases. The syntax is DRROP DATABASE <database name>;.
This deletes the database db1 and all tables in the database.
Deleting tables is much like deleting databases. All data in the table will deleted along with the structure when the DRROP TABLE <table name>; command is executed.
This deletes the table table1 and all data in the table.