Databases are not just storage boxes β they are the last line of defense for your data. Imagine a form on a website that accepts a user's role. Your application might validate that the role must be either "admin", "editor", or "viewer" β but what if someone bypasses the application and writes directly to the database? What if there is a bug in your code? This is where database-level constraints come in. They act as permanent guards that protect your data no matter how it gets written. In these notes, we will explore the most important constraint types, understand why they matter more than application-level validation, and apply them to real-world system design problems.