When you want to get rid of a table, you can drop it from the database.
You can delete a table from an Oracle database by using the SQL syntax found in the MouseOver below:
The DROP TABLE command has several different effects. It can:
Delete all of the rows in the table
Delete the table structure from the database
Delete any indexes associated with the table from the database
Remove all entries for the table and its components from the data dictionary table
The DROP TABLE command will not affect any other database objects that use the table.
For instance,
views that are built on the table, or
foreign key relationships that use the table, or
stored procedure code that references the table.
If you attempt to access other database objects after you drop a table they depend on, you will get an error message from Oracle.
You can search the appropriate tables in the data dictionary to find out which of these conditions may occur, or use a CASE[1] tool like Oracle Designer to help you understand the impact of dropping a table.
If you only want to delete the data from a table, you can use the syntax of:
DELETE * FROM tablename
wheretablename = the unique name of the table. As with any SQL statement, the effect of a DROP TABLE command is not made a permanent part of the database until you add a COMMIT command. You can use the ROLLBACK statement to negate the effects of a SQL statement before you issue a COMMIT command. The next lesson is the module wrap-up. You will briefly review the topics covered in this module. You can take a quiz to see what you learned and discover topics that you need to review in a more detailed manner.
[1]CASE: Computer Aided Software Design, a process where the implementation details of application systems are partially determined through computerized automation.