precondition SQL (unfinished)