The DELETE statement is used to remove records from a table, and the DROP statement is used to completely remove all trace of a table from the database.
The DELETE statement has this general format:
Format of SQL DELETE statement |
Additional information |
|
If you forget the “where” clause, all records in the table are deleted! A table with no records still exists in the database, and can be queried, updated, etc. To get rid of all traces of a table (not a common operation in most databases), use the DROP statement.
The DROP statement has this general format.
Format of SQL DROP statement |
Additional information |
---|---|
|
There is frequently more than one way to write an SQL query. Some of the ways will do less work than other ways. Nowadays it is the database's responsibility to reorder queries for the best performance.
3.144.232.189