HCL Interview Question

Temp tables and Views, How to write a query for two tables present in different databases in different servers? Why Stored procedure? Etc.