# Write records

Insert, update and delete application records.

Source: https://particledb.ai/sql/insert-update-delete/

Insert, update and delete application records.

## Example

```sql
CREATE TABLE docs_write (id BIGINT PRIMARY KEY, title TEXT, status TEXT);
INSERT INTO docs_write VALUES (1, 'Review', 'pending'), (2, 'Reply', 'pending');
```

```sql
UPDATE docs_write SET status = 'completed' WHERE id = 1;
DELETE FROM docs_write WHERE id = 2;
SELECT id, status FROM docs_write ORDER BY id;
```

## Behavior

Record 1 remains with status `completed`. Always check the affected-row count. An omitted `WHERE` can change every record. Use a transaction when multiple writes form one application operation.

## Related

[SQL reference](/sql/overview/) · [Application guide](/guides/relational-data/) · [Troubleshooting](/guides/troubleshooting/)
