+1 vote
in MariaDB by
What is the use of DELETE statement in MariaDB?

1 Answer

0 votes
by
The MariaDB DELETE statement is used to delete one or more records from the table in the database. It can be used to delete records from the table as well the whole table if you use it without WHERE condition.

Syntax:

DELETE FROM table      

[WHERE conditions]      

[ORDER BY expression [ ASC | DESC ]]      

[LIMIT number_rows];          

Let's delete data using one condition.

Example

DELETE FROM Students    

WHERE student_name = 'Mahesh';     

Mariadb Delete data 1

The query is executed successfully. You can now see that selected data is deleted.

SELECT * FROM Students;    

Mariadb Delete data 2

You can see that "Mahesh" is not available in the table.

Similarly, you can delete data using multiple conditions.
...