Interview Question

What is DELETE statement?

DELETE removes selected rows while keeping the table definition.

💡 Concept ✅ Quick Revision 🗃️ SQL

Answer

DELETE removes rows from a table. • WHERE chooses the rows to remove. • Without WHERE, all rows are deleted but the table remains. • Foreign-key actions may restrict or propagate a deletion.

💡 SQL Example

DELETE FROM sessions WHERE expires_at < CURRENT_TIMESTAMP;

Result

DELETE 12

⚡ Quick Revision

DELETE removes selected rows while keeping the table definition.