Loading...
Loading...
Browse 4 real-world technical and behavioral interview questions about Constraints. Review scenarios, edge cases, and architectural best practices.
Separate what the design costs users from what you personally dislike, then reconstruct the constraint that produced it: a business model, an organisational boundary, a regulatory rule or a migration nobody can finish. Any change you propose has to survive that constraint or it is not a proposal.
Give every entity a surrogate primary key but keep a unique constraint on the business identifier, and model a negotiated price as a row with a validity period rather than a mutable column - then copy the agreed price onto the order line so history cannot be rewritten.
Usually nothing is wrong with the solver: it is optimising against a model missing constraints the planner knows and never told it, so the plan is optimal and unrunnable. The fix is to capture the overrides as data and turn the recurring ones into constraints, rather than to improve the objective.
Soft deletion is a modelling decision rather than a convenience: it silently breaks uniqueness, leaves foreign keys pointing at rows that are logically gone, and adds a predicate every future query has to remember. Model the lifecycle explicitly instead.