here i have two tables like employee and one mobileoutbox table but these two tables are not connected to each other but i want to access data from two table i want to match data from two table and generate report .how to access data from two table without foreign key?
tables structure :
employee table mobileoutbox table
empid srno
empname mobileno
empphoneno textmsg
empaddress texttype
Maybe you are confusing foreign key constraint with data relationships. Yes, you may have two tables with data match (i.e. these likely phone numbers) and data constraint.
If you need to query both tables relating a column with matching data, just use a INNER JOIN:
Then you may want to report all the employees, even those who don’t have a mobile. In this case, you can use a LEFT OUTER JOIN to do this:
This will return all the employees and not null data for the mobileoutbox fields if the employee has a mobile number matching a mobile number in the right table.