Introduction
You use DELETE with WHERE to remove only specific rows from a table, not everything.
DELETE FROM table_name WHERE condition;
DELETE FROM employees WHERE employee_id = 5;
DELETE FROM orders WHERE order_date < '2023-01-01';
DELETE FROM products WHERE category = 'obsolete';
CREATE TABLE customers (id INT, name VARCHAR(20)); INSERT INTO customers VALUES (1, 'Alice'), (2, 'Bob'), (3, 'Charlie'); DELETE FROM customers WHERE name = 'Bob'; SELECT * FROM customers ORDER BY id;
WHERE clause do in a DELETE statement in MySQL?age is less than 18 from a table named users?employees with rows:{id:1, name:'Alice', dept:'HR'},{id:2, name:'Bob', dept:'IT'},{id:3, name:'Carol', dept:'HR'}DELETE FROM employees WHERE dept = 'HR';DELETE FROM orders WHERE;products with columns id, name, and stock. You want to delete all products that have zero stock but keep products with NULL stock values. Which query correctly deletes only products with stock exactly zero?Pass the test and this pattern moves unknown