1. SQL – DROP TABLE:
- An existing SQL table can be dropped/deleted using “DROP TABLE” statement.
- But, before dropping any parent table, its child table also should have been already dropped. Unless, parent table can’t be dropped due to its integrity.
|DROP TABLE table_name;|
|DROP TABLE student;|
2. SQL – TRUNCATE TABLE:
If you want only to drop all records in a table and don’t want to delete the table, then you can use TRUNCATE statement. In this case, this table will exist and be empty
|TRUNCATE TABLE table_name;|
|TRUNCATE TABLE student;|
3. SQL – DROP DATABASE:
An existing SQL database can be deleted using DROP DATABASE statement.
|DROP DATABASE database_name;|
|DROP DATABASE STUDENT_DB;|
Ask your questions or clarify your/others doubts from,