Database Constraints
Everything on SkillVeris tagged Database Constraints — collected across the glossary, study notes, blog, and cheat sheets.
6 resources across 1 library
Interview Questions(6)
What Is a CHECK Constraint and When Would You Use One?
A CHECK constraint is a rule attached to a column or table that the database evaluates on every insert or update, rejecting any row whose values do not satisfy…
What Is the Difference Between a UNIQUE Constraint and a UNIQUE Index?
A UNIQUE constraint is a schema-level rule declaring that a column or set of columns must contain no duplicate values, while a UNIQUE index is the physical dat…
How Should You Decide Which Columns Get a NOT NULL Constraint?
A NOT NULL constraint should be applied to any column whose absence would make a row meaningless or would break downstream logic, such as identifiers, foreign…
How Does a DEFAULT Value Constraint Behave in SQL?
A DEFAULT constraint supplies a predetermined value for a column automatically whenever an INSERT statement omits that column entirely, but it never overrides…
What Do ON DELETE CASCADE, SET NULL, and RESTRICT Mean for Foreign Keys?
These are referential actions attached to a foreign key that tell the database what to do to child rows when the referenced parent row is deleted or updated: C…
What Are Idempotency Keys and How Do They Prevent Duplicate Database Writes?
An idempotency key is a unique client-generated token attached to a write request that a database uses, via a unique constraint, to guarantee the same logical…