You can run your query against another database with Run > Run Against, or use the Run against item in the toolbar.
The query will only work if your run-against-database has the same tables/columns as the database you are building the query against.
This does not change the database you are building the query against.