To operate whith two tables from different databases, one have to use 'join' operation. There are several types of this operations.
simple sql statement below:
select * from db_1.tb_1 JOIN db_2.tb_2 where db_1.tb_1.col_1 = db_2.tb_2.col_2
note that column names must be similar here. For example, if your column name in first table is user_id, then column name in second table should be user_id too.
The result of this operation: table with all the columns existing both in first table and in second table.