Practical 5 - Dropping a Table - CSU357P - Shoolini U

Practical 5: Dropping a Table

5. Drop a Table

The DROP TABLE command is used to delete a table along with all its rows from the database. This operation removes the table's structure and all its data, unlike deleting all records, which leaves the table's structure intact.

5.1. Usage

To delete an entire table, issue the DROP TABLE command followed by the table name:

DROP TABLE "tablename";

For example, to drop a table named myemployees_ts0211, you would use the following command:

DROP TABLE myemployees_ts0211;

5.2. Key Points

5.3. Exercise

Practice by dropping your employee table using the DROP TABLE command:

DROP TABLE employee;

5.4. Effects of Dropping a Table

When a table is dropped, the following happens:

5.5. Precautions