How to automatically join a two tables based on key

I created a recruitment website. I need to allot a HR to the new applicants for processing. I want to generate a key for the HR using rnd() but am not able to connect the tables so that the details for the hr can be seen. Is there a way to automatically connect tables without a user having to select the hr key number to link.