Delete Row in SQL
? How to Delete a Row in SQL
To delete a specific row from a table, use the DELETE statement with a WHERE clause that identifies the row uniquely.
? Syntax
DELETE FROM table_nameWHERE condition;The
conditionshould uniquely identify the row you want to delete.Without
WHERE, all rows will be deleted!
? Example
Suppose you want to delete the employee with id = 10:
DELETE FROM employeesWHERE id = 10;This will delete only the row where id equals 10.
? Tips
Always make sure your
WHEREclause is specific to avoid deleting multiple rows unintentionally.You can combine multiple conditions, e.g.:
DELETE FROM employeesWHERE first_name = 'John' AND last_name = 'Doe';If you want help with deleting rows with complex conditions or examples for your specific database, just ask!