Skip to main content
DATABASES-EXPLAINED5 MIN READ

Sort Constraints by the Rule They Enforce

Choose the right relational constraint for common integrity rules.

Match each business rule to the constraint that should enforce it first. Primary key Foreign key Unique Check Not null Every customer row needs one stable identifier used to target updates. Each invoice line is identified by invoice_id plus line_number. An order cannot reference a customer that does not exist. Each approval decision must point at a real invoice and a real user. Coupon code values cannot repeat across active coupons. Only one active subscription may exist per customer and plan. Invoice total must be greater than or equal to zero. Discount amount cannot exceed the invoice total on the…

Read the full lesson

Sign up free — one personalized lesson every day, matched to your role and goals.

Already have an account? Sign in

← Back to library
Contact us