Modern QA2026Practical Exercise — tiles
Log inJoin
31 / 65 · 15 SQL & Database Testing · Constraint Testing← prev⊞ allnext →☰ Read as one page

4.6Practical Exercise

  1. Write tests for each constraint type on a users table: PK, FK, UNIQUE, NOT NULL, CHECK
  2. Test CASCADE vs RESTRICT behavior on a foreign key
  3. Test default values: verify defaults are applied when columns are omitted
  4. Query the database to discover all constraints on a table, then write tests for each
  5. Test a case-sensitivity edge case on a unique constraint