September 2010
Intermediate to advanced
440 pages
9h 23m
English
Dropping tables in MySQL follows the same pattern as dropping databases.
DROP TABLE <table name>;
We use the keyword DROP so MySQL knows what we want to do. We then indicate that we want to drop a table and follow that with the name of the table to be deleted.
When the DROP command is executed, the table and its definition are deleted unrecoverably from the database. You should therefore exercise caution when using it.
It is worth noting that the user who passes the DROP statement to MySQL must have the DROP privilege. Otherwise, MySQL will not execute the statement.
If you create a temporary table and want to ensure that only that table is dropped, use the TEMPORARY keyword:
DROP TEMPORARY TABLE <table name>;
So to ...
Read now
Unlock full access