Implemented SQL database interface in script.