Question 7 of 10Pro Only

What are database constraints? Explain the different types and when to use them.

Sample answer preview

## What are Constraints? Constraints are **rules that enforce data integrity** at the database level. They ensure that data in your tables meets specific criteria. ## Types of Constraints ### 1. PRIMARY KEY Uniquely identifies each row. Combines UNIQUE + NOT NULL.

constraintsPRIMARY KEYFOREIGN KEYUNIQUENOT NULLCHECK

Unlock the full answer

Get the complete model answer, key points, common pitfalls, and access to 9+ more Full-Stack Developer interview questions.

Upgrade to Pro

Starting at $19/month • Cancel anytime