SQL is a terrible general-purpose programming language by the standards of today, which makes it a terrible way to express business logic.