# Unique Constraints

> Is a unique constraint the same as a unique index? What are the practical differences?

Canonical: https://www.internhack.in/learn/interview/database-design/db-unique-constraint-vs-index
Last updated: 2026-11-28

Difficulty: Beginner

## Question

Is a unique constraint the same as a unique index? What are the practical differences?

*The full answer is for InternHack members. Open the page link above to read it.*

## Concepts covered

Unique Constraint, Unique Index, Partial Index, NULL Handling, Deferrable Constraints

Previous: [Index Overhead](https://www.internhack.in/learn/interview/database-design/db-indexing-overhead) · Next: [Database Triggers](https://www.internhack.in/learn/interview/database-design/db-trigger-use-cases) · [All of Database Design](https://www.internhack.in/learn/interview/database-design)

## More Database Design questions

- [Horizontal vs Vertical Partitioning](https://www.internhack.in/learn/interview/database-design/db-partitioning-horizontal-vs-vertical)
- [UUID as Primary Key](https://www.internhack.in/learn/interview/database-design/db-uuid-vs-int-primary-key)
- [Fan-out Problem](https://www.internhack.in/learn/interview/database-design/db-fan-out-problem)
- [Write-Ahead Logging (WAL)](https://www.internhack.in/learn/interview/database-design/db-write-ahead-logging-wal)
- [Read Replicas vs. Caching](https://www.internhack.in/learn/interview/database-design/db-read-replicas-vs-caching)
- [Full-Text Search](https://www.internhack.in/learn/interview/database-design/db-full-text-search-vs-like)

## Related

- [Learn](https://www.internhack.in/learn)
- [Interview Prep](https://www.internhack.in/learn/interview)
- [Database Design](https://www.internhack.in/learn/interview/database-design)
