Moved database selection outside sql file

Selectin the database in the command line as opposed to the sql file may
be more reliable and less prone to failure.