You might be interested in my attempt: https://docs.racket-lang.org/plisqin/Nullability.html
I think it handles all the 3VL problems I've encountered in SQL, but that doesn't mean it handles all possible 3VL problems. It also might not make any sense to anyone except me.