Hi, I just want to ask because i am confuse with my three tables,…my question is…Is it possible to use the join query like the inner join,left join,outer join.,etc…in the 3 tables, as i know that when we use the inner join it must be the pk and fk,example:…
select e.emp_no, e.f_name,e.l_name,p.proj_no,p.res_empno
from employee e join project p
on e.emp_no = p.res_empno
the emp_no is pk for the employee table and the res_empno is the fk for the project table.
but what if the design of my table is something like this
Hi cpradio,…I apologize for my last reply,I mean to say that Student.std_classno and Room.rm_stdclassno is not a foreign key and also it is not a primary key…but they both having the same values and datatypes…my question is this,is it okay to use inner join even they are not pK and Fk?can i still get the right data?.
Yes, you can still get the right data. It would be nice if they had some sort of relationship to verify data integrity, but that is the only issue the fk relationship would resolve. It would prevent both tables from having invalid data.