liveBook · Manning

Deletion

As explained in Build Python Web Apps with Streamlit

DELETE FROM is a SQL statement that removes rows from a table, optionally restricted by a condition.

Use DELETE FROM to remove rows from a table. A WHERE condition selects which rows to delete; omitting it deletes every row, so check the condition carefully. section 8.2.4

DELETE FROM haikus WHERE haiku_id = 2;

This example deletes the haiku whose ID is 2 by specifying a WHERE condition. section 8.2.4

How Build Python Web Apps with Streamlit covers it

How deep it goes
Explains WHERE targeting, warns that omitting it deletes every row, and distinguishes deleting rows from dropping a table.
Examples
Uses a DELETE FROM statement to remove the haiku with ID 2.
What you can do after
Apply SQL DELETE FROM with a WHERE condition to remove a chosen row.
How it connects
Connects row deletion to SQL WHERE conditions, UPDATE, and DROP TABLE.

Also explained in

Compare how 8 books explain deletion →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build Python Web Apps with Streamlit. The section links point to the parts of the book it draws on.