DROP TABLE
Perintah DROP TABLE digunakan untuk menghapus tabel dalam database.
SQL berikut menghapus tabel “Suppliers”:
Contoh
DROP TABLE Suppliers;
Catatan: Hati-hati sebelum menghapus tabel. Menghapus tabel mengakibatkan hilangnya semua informasi yang disimpan dalam tabel!
TRUNCATE TABLE
Perintah TRUNCATE TABLE digunakan untuk menghapus data di dalam tabel, tetapi tidak menghapus tabel itu sendiri.
SQL berikut memotong tabel “Shippers”:
Contoh
TRUNCATE TABLE Shippers;