It seems you need to create a view form in remedy if the another database is remote :
With Direct SQL you can issue any valid SQL statement that you can issue logged in as the DB users Remedy is connecting to the DB with. For example if you can login to the DMBS client (you didn't state which DBMS your are using) as the Remedy DB account and run the SQL against CompanyDatabase you would be able to then do it via Direct SQL.
All of your setup would be done at the DB level. What I mean by that is if you need to issue SQL against a remote DB on another server you would need to link the servers so the Direct SQL action can also access the remote server.
Direct SQL is the one instance when AR System does not sanitize what is being sent to the DB. You must use this with caution as to no introduce a SQL Injection vulnerability. The best practice, safest and most reliable thing to is create a stored procedure (or function if appropriate) at the DB level that receive parameters. Then call that SP from the Direct SQL action passing the parameters.