Skip to content

Commit

Permalink
Add delete
Browse files Browse the repository at this point in the history
  • Loading branch information
peymanslh committed Jan 1, 2024
1 parent f7b3dbe commit 175e8e7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Create a new post: `hugo new --kind post posts/<post-name>.md`
- [x] WHERE
- [x] INSERT
- [x] UPDATE
- [ ] DELETE
- [x] DELETE
- [ ] ORDER BY
- [ ] GROUP BY
- [ ] AND, OR, NOT
Expand Down
26 changes: 26 additions & 0 deletions content/posts/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: "Delete"
date: 2024-01-01T20:40:45+03:30
---
With `DELETE` we can delete one or multiple rows from a table.

{{< tabs tabTotal="1" >}}
{{< tab tabName="PostgreSQL" >}}
```sql
-- when you don't provide a where condition with your delete it will
-- delete all rows in your table
-- Don't run this query on your sample database, until you know what you're doing
DELETE FROM orders;

-- delete all orders of a user with id of 10
DELETE FROM
orders
WHERE
user_id = 12;
```

Read more about Delete on
[PostgreSQL docs](https://www.postgresql.org/docs/current/sql-delete.html)

{{< /tab >}}
{{< /tabs >}}

0 comments on commit 175e8e7

Please sign in to comment.