Như tên gọi, lệnh DROP dùng để xóa hoàn toàn bảng khỏi database.
Cú pháp
DROP TABLE table_name;
Ví dụ
mysql> DROP TABLE Student; Query OK, 0 rows affected (0.09 sec)
Bảng Student bị xóa hoàn toàn. Kiểm tra lại:
mysql> SELECT * FROM Student; ERROR 1146 (42S02): Table 'query.student' doesn't exist