In this short article, we’re going to learn how to use the SQL DELETE command to delete records in a PostgreSQL database table. This article builds on top of Inserting Data Into a Table.
2. SQL DELETE Command
To delete a record in a table, we use the SQL DELETE command.
The syntax of the DELETE command is:
DELETE FROM table_name WHERE condition;
3. DELETE Examples
The following statement will delete the record(s) that contains the email [email protected] records:
-- Name of Table DELETE FROM customer -- Where condition WHERE email = '[email protected]
In this short article, we learned how to delete a record in a PostgreSQL database table.