Oracle: Check Table Exists & Drop
You can determine if a table exists in an Oracle database by querying the data dictionary views and can use the DROP TABLE statement to delete the table. Here is an example SQL query and operation:
- Check if the table exists.
SELECT table_name
FROM user_tables
WHERE table_name = '表名';
If the query result returns the table name, it means the table exists; otherwise, it means the table does not exist.
- Delete table:
DROP TABLE 表名;
Caution: Deleting a table operation is irreversible. Once the deletion is executed, data cannot be recovered. Therefore, please make sure the operation is correct before deleting the table.