Delete a record
A DELETE statement is used to delete a record or row from a table, and its statement is in the following format:
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 don't use a where.
If you just delete one or more lines, you can refer to the following statement:
Delete from employee
WHERE LastName = ' may ';
This statement deletes the line LastName ' may ' from the Emplyee table.
Delete from employee
where FirstName = ' Mike ' or FirstName = ' Eric ';
This statement deletes the line FirstName as ' Mike ' or ' Eric ' from the Emplyee table.
To delete a complete record or row from the table, add the name of the table directly after "delete from" and use where to indicate which row to match. If you do not use a WHERE clause, all records or rows in the table are deleted.