sql "first prototype" fix