How to delete a row in SQL ?


We will be using the DELETE query to delete existing rows from the table:

DELETE FROM table_name
WHERE [condition];
We will start off by giving the keywords DELETE FROM, then we will give the name of the table, after that we will give the WHERE clause and give the condition on the basis of which we would want to delete a row. For example, from the employee table, if we would like to delete all the rows, where the age of the employee is equal to 25, then this will the command:

DELETE FROM employee 
WHERE [age=25];
       

Advertisements

ads