Deleting a Table
Function
This statement is used to delete tables.
Syntax
1
|
DROP TABLE [IF EXISTS] [db_name.]table_name; |
Keyword
- If the table is stored in OBS, only the metadata is deleted. The data stored on OBS is not deleted.
Parameters
Parameter |
Description |
---|---|
db_name |
Database name, which consists of letters, digits, and underscores (_). The value cannot contain only digits or start with a digit or underscore (_). |
table_name |
Table name |
Precautions
The to-be-deleted table must exist in the current database. Otherwise, an error is reported. To avoid this error, add IF EXISTS in this statement.
Example
- Create an OBS or DLI table, for example, student. For details, see Creating an OBS Table or Creating a DLI Table.
- Run the following statement to delete a table named student in the current database:
1
DROP TABLE IF EXISTS student;
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot