Add unit tests for sql statements. Add printf for logging.