SQL DELETE keyword is used to delete the records from the table. Here is the general form to use DELETE keyword in SQL to delete the rows present in the table:
DELETE FROM table_name WHERE some_column=some_value;
Here SQL Where clause is used to specify which record(s) is going to delete.
Here is an example of SQL DELETE keyword. Let's suppose, we have the following table named CUSTOMERS in the database:
Following is an example, which would DELETE a customer, whose ID is 3.
DELETE FROM CUSTOMERS WHERE ID = 3;
After querying the above SQL statement, it will delete the customer having id as 3.
Now the new table will be:
© Copyright 2021. All Rights Reserved.