Files
mindsdb--minds/docs/mindsdb_sql/sql/drop/model.mdx
2024-06-11 18:23:33 +02:00

77 lines
1.1 KiB
Plaintext

---
title: Remove a Model
sidebarTitle: Remove a Model
---
## Description
The `DROP MODEL` statement deletes the model table.
## Syntax
Here is the syntax:
```sql
DROP MODEL [IF EXISTS] predictor_name;
```
On execution, we get:
```sql
Query OK, 0 rows affected (0.058 sec)
```
Where:
| Name | Description |
| ------------------ | -------------------------------- |
| `predictor_name` | Name of the model to be deleted. |
## Example
Let's list all the available predictor tables.
```sql
SHOW MODELS;
```
On execution, we get:
```sql
+---------------------+
| name |
+---------------------+
| other_model |
| home_rentals_model |
+---------------------+
```
Now we delete the `home_rentals_model` table.
```sql
DROP MODEL home_rentals_model;
```
On execution, we get:
```sql
Query OK, 0 rows affected (0.058 sec)
```
We can check if the deletion was successful by querying the `mindsdb.models`
table again.
```sql
SHOW MODELS;
```
On execution, we get:
```sql
+---------------------+
| name |
+---------------------+
| other_model |
+---------------------+
```