You will need to add this to the script you are writing that processes the selected option.
The correlation can only be made if at least one column in the two tables contain related data.
Here is an example, the columns that contain related data are
emp_id of employee_data and
e_id of employee_per.
Here you conduct a table join and extract the names (from employee_data) and spouse names (from employee_per) of married employee.
select CONCAT(f_name, " ", l_name) AS Name,
s_name as 'Spouse Name' from
employee_data, employee_per
where m_status = 'Y' AND
emp_id = e_id;
+-----------------+-----------------+
| Name | Spouse Name |
+-----------------+-----------------+
| Manish Sharma | Anamika Sharma |
| John Hagan | Jane Donner |
| Ganesh Pillai | Sandhya Pillai |
| Anamika Sharma | Manish Sharma |
+-----------------+-----------------+
Because you want to return results from another table you will need to join the tables....
