Table Of Contents
How to update & delete data in SQL (Postgres), with interactive examples.
Last Tended | |
---|---|
Planted | |
Status | Seed |
Update Data
Update a Row
/query.sql
result
Update Multiple Rows
/query.sql
result
Update a Row (& return modified row)
/query.sql
result
Delete Data
/query.sql
result
Transaction
A transaction bundles multiple steps into a single, all-or-nothing operation. If some failure occurs that prevents the transaction from completing, then none of the steps affect the database at all. The intermediate states between the steps are not visible to other concurrent transactions. Note, the transaction being referred to here is also known as a transaction block. Technically, a single database operation (such as delete a row) is also classified as a transaction.
/query.sql
result
Rollback
We can undo a transaction using the ROLLBACK
command.
This can only be done when a transaction hasn't been committed.
/query.sql
result
Update a Table
Add a new column
/query.sql
result
Remove a column
/query.sql
result
Change a column's name
/query.sql
result
Delete a Table
/query.sql
result
Playground
- DB Fiddle - SQL Database Playground