PrepZone Logo
PrepZone
Back to Database

Database · Easy

What integrity constraints does SQL support and when do you use each?

DatabaseFundamentalsFresher

Answer preview

Integrity constraints are rules the database enforces on every write, so bad data cannot enter regardless of which application, script, or DBA is writing. SQL supports NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK, and DEFAULT, plus PostgreSQL's EXCLUDE.…