Implemented SQL output.