---
title: "Discussion on \"SQL: Soft Deleting and Unique Constraint\" | Hashnode"
description: "Discussion on \"SQL: Soft Deleting and Unique Constraint\". One issue with soft delete, it's not compatible with unique constraints."
url: "https://hashnode.com/posts/sql-soft-deleting-and-unique-constraint/63fcf73b91d7eb950bc20026"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [SQL: Soft Deleting and Unique Constraint](https://halimsamy.com/sql-soft-deleting-and-unique-constraint?utm_source=hashnode&utm_medium=feed)

One issue with soft delete, it's not compatible with unique constraints.

Feb 27, 2023 · 4 min read · halimsamy.com  
Updated Feb 28, 2023  
Read the article

-   [#mysql](https://hashnode.com/tag/mysql)
-   [#sql](https://hashnode.com/tag/sql)

## Written by

[Halim Samy](https://hashnode.com/@halimsamy)

@halimsamy · Cairo, Egypt

  
[View profile](https://hashnode.com/@halimsamy)

A Jack of All Trades!

A software developer who is also a full-time student because apparently being a software developer isn't enough of a challenge. I am currently working on B.Sc. in Computer Science and have experience with various languages and frameworks. A jack of all trades, master of some, with a technical, thorough, and fast approach. I enjoy developing software that makes people's lives easier and more efficient. Overall, I am friendly, outgoing, highly skilled, and always looking for new opportunities to grow and learn.

## Responses 2

Markdown supported · ⌘↵ to post

[Michael J. Stallinger](https://hashnode.com/@mjStallinger)

[Apr 24, 2023](https://hashnode.com/posts/sql-soft-deleting-and-unique-constraint/63fcf73b91d7eb950bc20026/comment/6446b4a7994f853a1efef557)

Great article, thank you!

[Halim Samy](https://hashnode.com/@halimsamy)

[Apr 24, 2023](https://hashnode.com/posts/sql-soft-deleting-and-unique-constraint/63fcf73b91d7eb950bc20026/comment/6446b4a7994f853a1efef557#reply-6446b4e7994f853a1efef562)

Thanks!

[Youssef](https://hashnode.com/@ybocktor)

[Feb 28, 2023](https://hashnode.com/posts/sql-soft-deleting-and-unique-constraint/63fcf73b91d7eb950bc20026/comment/63fdc170c72bc5248ac26504)

That's interesting, thank you for sharing

[Halim Samy](https://hashnode.com/@halimsamy)

[Feb 28, 2023](https://hashnode.com/posts/sql-soft-deleting-and-unique-constraint/63fcf73b91d7eb950bc20026/comment/63fdc170c72bc5248ac26504#reply-63fdc1a75b969e24bab6f671)

Indeed it is.
