SQL DELETE Statement
The DELETE statement in SQL is used to remove rows from a table. It allows you to delete specific rows or all rows in a table, depending on the presence of the WHERE clause. This command is useful for managing and maintaining accurate data in a database.
The basic syntax is:
DELETE FROM table_name WHERE condition;Example
This example removes a specific row from the Orders table.
Code Example
-- Delete the row for the product 'Camera'
DELETE FROM Orders
WHERE Product = 'Camera';
-- View the updated table
SELECT * FROM Orders;
            Output
| Product | Category | Price | 
|---|---|---|
| Laptop | Electronics | 1300.00 | 
| Phone | Mobile Devices | 800.00 | 
| Tablet | Gadgets | 600.00 | 
| Smartwatch | Gadgets | 250.00 | 
| Headphones | Gadgets | 150.00 | 
Explanation
        - The DELETE statement targets the Orders table.
        - The WHERE clause ensures that only the row with the product "Camera" is deleted.
        - After execution, the updated table no longer includes the "Camera" product.
    
