The DELETE command is used to remove entire rows of data from a table. The DELETE command is not used to remove values from specific columns; a full record, including all columns , is removed. The DELETE statement must be used with cautionas it works all too well. The next section discusses methods for deleting data from tables. To delete a single record or selected records from a table, the DELETE statement must be used with the following syntax: delete from table_name [where condition]; DELETE FROM ORDERS_TBL WHERE ORD_NUM = '23A16'; 1 row deleted. Notice the use of the WHERE clause. The WHERE clause is an essential part of the DELETE statement if you are attempting to remove selected rows of data from a table. You rarely issue a DELETE statement without the use of the WHERE clause. If you do, your results will be similar to the following example: DELETE FROM ORDERS_TBL; 11 rows deleted. | If the WHERE clause is omitted from the DELETE statement, all rows of data are deleted from the table. As a general rule, always use a WHERE clause with the DELETE statement. Also, remember that the DELETE command may have a permanent impact on the database. Ideally, it should be possible to recover erroneously deleted data via a backup, but in some cases, it may be difficult or even impossible to recover data. If data cannot be recovered, it must be re-entered into the databasetrivial if dealing with only one row of data, but not so trivial if dealing with thousands of rows of data. Hence, the importance of the WHERE clause. | | The temporary table that was populated from the original table earlier in this hour can be very useful for testing the DELETE and UPDATE commands before issuing them against the original table. | |