removing-data

Removing Data from All Rows in a Table

To delete all rows from a table:

DELETE FROM <table>;

Examples:

DELETE FROM logs;
DELETE FROM users;
DELETE FROM products;

Removing Specific Rows

To delete specific rows from a table:

DELETE FROM <table> WHERE <condition>;

Examples:

DELETE FROM users WHERE email = "andrew@teamtreehouse.com";
DELETE FROM movies WHERE genre = "Musical";
DELETE FROM products WHERE stock_count = 0;

Last updated

Was this helpful?