Deleting a record in a SQL database typically uses the DELETE statement, which will give you a look at the syntax of the DELETE statement used to delete records in SQL for your reference, and hopefully it will help you.
The DELETE statement is used to delete a record or row from a table in the form of a statement:
Delete from "tablename"
where "ColumnName" OPERATOR "value" [and|or "column" OPERATOR "value"];
[] = optional
Here's an example:
Delete from employee;
This statement does not have a where statement, so it will delete all records, so be careful if you do not use where.
If you just want to delete one or a few lines, you can refer to the following statement:
Delete from employee
WHERE LastName = ' may ';
This statement removes the line LastName as ' may ' from the Emplyee table.
Delete from employee
where FirstName = ' Mike ' or FirstName = ' Eric ';
This statement removes the line from the Emplyee table of FirstName as ' Mike ' or ' Eric '.
To delete a complete record or row from the table, add the name of the table directly after the "delete from" and use the where to indicate what conditions the row is to be deleted. If you do not use the WHERE clause, all records or rows in the table are deleted.
Sql--delete statements